diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 0e189653..97477124 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -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() diff --git a/server/matchserver/player/playermgr.go b/server/matchserver/player/playermgr.go index b869c0b3..c73cd89b 100644 --- a/server/matchserver/player/playermgr.go +++ b/server/matchserver/player/playermgr.go @@ -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) diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index e73642a0..71c09a3a 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -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 {