This commit is contained in:
aozhiwei 2024-04-20 14:21:18 +08:00
parent 9b96e585b9
commit 4ff990d368

View File

@ -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 {