This commit is contained in:
aozhiwei 2024-04-20 11:46:20 +08:00
parent 8557cf5062
commit 097633cc40
3 changed files with 14 additions and 1 deletions

View File

@ -102,9 +102,9 @@ type Team interface {
GetTeamUuid() string
CanJoin(string) bool
Join(Player) bool
ReJoin(Player)
GetMemberByAccountId(string) Player
OnPlayerOffline(Player)
OnPlayerOnline(Player)
IsCopy() bool
GetCopyIdx() int32
SendUpdateNotify()

View File

@ -217,6 +217,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
}
hum.againInit(pendingReq, &rspObj)
this.socketHash[pendingReq.hdr.GetSocket()] = hum
team.ReJoin(hum)
} else {
hum = newPlayer()
hum.init(pendingReq, &rspObj)

View File

@ -32,6 +32,7 @@ type team struct {
startTime int64
stateNotifyMsg *cs.SMTeamStateNotify
memberIdHash map[string]common.Player
preTeamRealPlayerHash map[string]int64
robotList []*robot
matchOk *team
matchTick int64
@ -74,6 +75,12 @@ func (this *team) init(copyIdx int32, zoneId int32, nodeId int32,
this.memberIdHash[owner.GetAccountId()] = owner
}
func (this *team) postInit() {
if this.IsCopy() {
}
}
func (this *team) GetZoneId() int32 {
return this.zoneId
}
@ -119,6 +126,9 @@ func (this *team) OnPlayerOnline(hum common.Player) {
}
func (this *team) ReJoin(hum common.Player) {
}
func (this *team) Join(hum common.Player) bool {
this.sortIdx++
hum.SetTeam(this)
@ -499,6 +509,7 @@ func (this *team) genNextCopyTeam() {
}
}
_teamMgr.addTeam(nextTeam)
nextTeam.postInit()
}
func (this *team) broadcastMsg(msg proto.Message) {
@ -559,6 +570,7 @@ func newTeam() *team {
t.stateNotifyMsg = &cs.SMTeamStateNotify{}
t.stateNotifyMsg.JoinMsg = &cs.MFJoinMsg{}
t.memberIdHash = map[string]common.Player{}
t.preTeamRealPlayerHash = make(map[string]int64)
t.robotList = []*robot{}
{
cb := func (meta *mt.Robot) bool {