diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 9f5a9dcc..895ae654 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -70,6 +70,7 @@ type Team interface { OnPlayerOffline(Player) OnPlayerOnline(Player) IsCopy() bool + GetCopyIdx() int32 SendUpdateNotify() SendStateNotify() IsLeader(Player) bool diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index ade769cc..b3ceb92a 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -15,7 +15,7 @@ type team struct { cs.MsgHandlerImpl teamUuid string nextTeamUuid string - isCopy bool + copyIdx int32 zoneId int32 nodeId int32 mapInfo* common.MapInfoRsp @@ -29,9 +29,11 @@ type team struct { matchTick int64 } -func (this *team) init(teamUuid string, owner common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) { +func (this *team) init(copyIdx int32, teamUuid string, + owner common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) { this.sortIdx++ this.teamUuid = teamUuid + this.copyIdx = copyIdx this.zoneId = owner.GetZoneId() this.nodeId = owner.GetNodeId() this.mapInfo = mapInfo @@ -106,7 +108,11 @@ func (this *team) isFull() bool { } func (this *team) IsCopy() bool { - return this.isCopy + return this.copyIdx > 0 +} + +func (this *team) GetCopyIdx() int32 { + return this.copyIdx } func (this *team) Started() bool { @@ -364,6 +370,7 @@ func (this *team) genStartGameInfo() { payload := sign + ":" + "normal_room|" + q5.EncodeJson(&startInfo) this.stateNotifyMsg.JoinMsg.TeamUuid = proto.String(this.getMainTeam().GetTeamUuid()) this.stateNotifyMsg.JoinMsg.Payload = proto.String(payload) + this.stateNotifyMsg.NextTeamUuid = proto.String(this.nextTeamUuid) } func (this *team) broadcastMsg(msg proto.Message) { diff --git a/server/matchserver/team/teammgr.go b/server/matchserver/team/teammgr.go index b06f6570..82a3b4b0 100644 --- a/server/matchserver/team/teammgr.go +++ b/server/matchserver/team/teammgr.go @@ -25,7 +25,7 @@ func (this *teamMgr) UnInit() { func (this *teamMgr) CreateTeam(hum common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) common.Team { teamUuid := this.genTeamUuid(hum.GetZoneId(), hum.GetNodeId()) team := newTeam() - team.init(teamUuid, hum, msg, mapInfo) + team.init(0, teamUuid, hum, msg, mapInfo) this.teamUuidHash[team.teamUuid] = team return team }