diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 78faca78..34ff19b9 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -146,6 +146,8 @@ type Team interface { HandoverLeader(Player, string) CancelMatch() SetMapInfo(*MapInfoRsp) + GetMapId() int32 + GetModeId() int32 IsMobaMode() bool } diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index 00b54a94..ed125488 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -300,7 +300,11 @@ func (this *player) CMStartGame(hdr *f5.MsgHdr, msg *cs.CMStartGame) { rspMsg := &cs.SMStartGame{} if !this.GetTeam().IsLock() { if this.GetTeam().CanStartGame(this) { - this.GetTeam().StartGame() + if GetHistoryMgr().CanStart(this.GetAccountId(), + this.GetTeam().GetMapId(), + this.GetTeam().GetModeId()) { + this.GetTeam().StartGame() + } } } this.SendMsg(rspMsg) diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index 78371510..6bf85b5f 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -95,6 +95,14 @@ func (this *team) GetNodeId() int32 { return this.nodeId } +func (this *team) GetMapId() int32 { + return this.mapInfo.MapId +} + +func (this *team) GetModeId() int32 { + return this.mapInfo.MapId +} + func (this *team) GetZnKey() int64 { return q5.MkInt64(this.GetZoneId(), this.GetNodeId()) }