1
This commit is contained in:
parent
2daa458610
commit
8c0b66f891
@ -23,17 +23,18 @@ func (this *teamMgr) UnInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) CreateTeam(hum common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) common.Team {
|
func (this *teamMgr) CreateTeam(hum common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) common.Team {
|
||||||
teamUuid := this.genTeamUuid(hum.GetZoneId(), hum.GetNodeId())
|
var copyIdx int32 = 0
|
||||||
|
teamUuid := this.genTeamUuid(copyIdx, hum.GetZoneId(), hum.GetNodeId())
|
||||||
team := newTeam()
|
team := newTeam()
|
||||||
team.init(0, teamUuid, hum, msg, mapInfo)
|
team.init(copyIdx, teamUuid, hum, msg, mapInfo)
|
||||||
this.teamUuidHash[team.teamUuid] = team
|
this.teamUuidHash[team.teamUuid] = team
|
||||||
return team
|
return team
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) genTeamUuid(zoneId int32, nodeId int32) string {
|
func (this *teamMgr) genTeamUuid(zoneId int32, nodeId int32, copyIdx int32) string {
|
||||||
teamUuid := ""
|
teamUuid := ""
|
||||||
for true {
|
for true {
|
||||||
teamUuid = this.internalGenTeamUuid(zoneId, nodeId)
|
teamUuid = this.internalGenTeamUuid(zoneId, nodeId, copyIdx)
|
||||||
if this.GetTeamByUuid(teamUuid) == nil {
|
if this.GetTeamByUuid(teamUuid) == nil {
|
||||||
return teamUuid
|
return teamUuid
|
||||||
}
|
}
|
||||||
@ -41,9 +42,9 @@ func (this *teamMgr) genTeamUuid(zoneId int32, nodeId int32) string {
|
|||||||
panic("genTeamUuid error")
|
panic("genTeamUuid error")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) internalGenTeamUuid(zoneId int32, nodeId int32) string {
|
func (this *teamMgr) internalGenTeamUuid(zoneId int32, nodeId int32, copyIdx int32) string {
|
||||||
this.curIdx++
|
this.curIdx++
|
||||||
teamUuid := q5.ToString(zoneId) + "_" + q5.ToString(nodeId) + "_" +
|
teamUuid := q5.ToString(zoneId) + "_" + q5.ToString(nodeId) + "_" + q5.ToString(copyIdx) + "_" +
|
||||||
q5.Md5Str(q5.ToString(f5.GetApp().NewUuid()) + q5.ToString(f5.GetApp().GetPid()) +
|
q5.Md5Str(q5.ToString(f5.GetApp().NewUuid()) + q5.ToString(f5.GetApp().GetPid()) +
|
||||||
q5.ToString(this.curIdx) +
|
q5.ToString(this.curIdx) +
|
||||||
mt.Table.MatchCluster.GetIp() + "520d8eAbB(8cf1^#$^&!@d833a42c820432PDAFE^^)")
|
mt.Table.MatchCluster.GetIp() + "520d8eAbB(8cf1^#$^&!@d833a42c820432PDAFE^^)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user