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) HandoverLeader(Player, string)
CancelMatch() CancelMatch()
SetMapInfo(*MapInfoRsp) SetMapInfo(*MapInfoRsp)
GetMapId() int32
GetModeId() int32
IsMobaMode() bool IsMobaMode() bool
} }

View File

@ -300,7 +300,11 @@ func (this *player) CMStartGame(hdr *f5.MsgHdr, msg *cs.CMStartGame) {
rspMsg := &cs.SMStartGame{} rspMsg := &cs.SMStartGame{}
if !this.GetTeam().IsLock() { if !this.GetTeam().IsLock() {
if this.GetTeam().CanStartGame(this) { 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) this.SendMsg(rspMsg)

View File

@ -95,6 +95,14 @@ func (this *team) GetNodeId() int32 {
return this.nodeId 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 { func (this *team) GetZnKey() int64 {
return q5.MkInt64(this.GetZoneId(), this.GetNodeId()) return q5.MkInt64(this.GetZoneId(), this.GetNodeId())
} }