This commit is contained in:
aozhiwei 2024-03-14 19:59:38 +08:00
parent 6d2c0c67e6
commit 948e1b5c59
3 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,7 @@ type Team interface {
KickOut(Player, string)
HandoverLeader(Player, string)
CancelMatch()
SetMapId(int32)
}
type TeamMgr interface {

View File

@ -284,6 +284,7 @@ func (this *player) CMChooseMap(hdr *f5.MsgHdr, msg *cs.CMChooseMap) {
rspMsg.Errcode = proto.Int32(1)
rspMsg.Errmsg = proto.String("team already started")
} else {
this.GetTeam().SetMapId(msg.GetMapId())
}
this.SendMsg(rspMsg)
this.GetTeam().SendUpdateNotify()

View File

@ -211,6 +211,12 @@ func (this *team) CancelMatch() {
}
}
func (this *team) SetMapId(mapId int32) {
if !this.Started() {
this.mapId = mapId
}
}
func (this *team) rearrangementSortIdx() {
members := []common.Player{}
q5.NewSlice(&members, 0, 4)