This commit is contained in:
aozhiwei 2024-09-20 15:34:33 +08:00
parent 1501e2f17b
commit 9a7e9d19c4
3 changed files with 15 additions and 1 deletions

View File

@ -146,6 +146,8 @@ type Team interface {
HandoverLeader(Player, string)
CancelMatch()
SetMapInfo(*MapInfoRsp)
GetMapId() int32
GetModeId() int32
IsMobaMode() bool
}

View File

@ -300,9 +300,13 @@ func (this *player) CMStartGame(hdr *f5.MsgHdr, msg *cs.CMStartGame) {
rspMsg := &cs.SMStartGame{}
if !this.GetTeam().IsLock() {
if this.GetTeam().CanStartGame(this) {
if GetHistoryMgr().CanStart(this.GetAccountId(),
this.GetTeam().GetMapId(),
this.GetTeam().GetModeId()) {
this.GetTeam().StartGame()
}
}
}
this.SendMsg(rspMsg)
}

View File

@ -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())
}