diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index a6de954d..b67f0534 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -127,6 +127,7 @@ func (this *team) onPlayerOnline(hum common.Player) { } func (this *team) ReJoin(hum common.Player) { + this.checkMemberState() } func (this *team) Join(hum common.Player) bool { @@ -135,6 +136,7 @@ func (this *team) Join(hum common.Player) bool { hum.SetSortIdx(this.sortIdx) this.addMember(hum) this.rearrangementSortIdx() + this.checkMemberState() return true } @@ -272,6 +274,7 @@ func (this *team) Leave(hum common.Player) { if this.GetMemberNum() < 0 { this.Disband() } + this.checkMemberState() } } @@ -284,6 +287,7 @@ func (this *team) Disband() { this.broadcastMsg(notifyMsg) } _teamMgr.removeTeam(this.GetTeamUuid()) + this.checkMemberState() } } @@ -600,7 +604,22 @@ func (this *team) traverseMembers(cb func(common.Player) bool) { } func (this *team) checkMemberState() { + if !this.IsCopy() { + return + } +} +func (this *team) hasOnlinePlayer() bool { + has := false + this.traverseMembers( + func (m common.Player) bool { + if m.IsOnline() { + has = true + return false + } + return true + }) + return has } func newTeam() *team {