1
This commit is contained in:
parent
68b0188257
commit
ba90357060
@ -2,10 +2,12 @@ package team
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"cs"
|
"cs"
|
||||||
|
"main/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type team struct {
|
type team struct {
|
||||||
cs.MsgHandlerImpl
|
cs.MsgHandlerImpl
|
||||||
|
teamUuid string
|
||||||
zoneId int32
|
zoneId int32
|
||||||
nodeId int32
|
nodeId int32
|
||||||
}
|
}
|
||||||
@ -17,3 +19,27 @@ func (this *team) GetZoneId() int32 {
|
|||||||
func (this *team) GetNodeId() int32 {
|
func (this *team) GetNodeId() int32 {
|
||||||
return this.nodeId
|
return this.nodeId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *team) GetTeamUuid() string {
|
||||||
|
return this.teamUuid
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) CanJoin(accountId string) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) GetMemberByAccountId(accountId string) common.Player {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) OnPlayerOffline(hum common.Player) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) OnPlayerOnline(hum common.Player) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) Join(hum common.Player) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
@ -5,15 +5,18 @@ import (
|
|||||||
"f5"
|
"f5"
|
||||||
"cs"
|
"cs"
|
||||||
"main/common"
|
"main/common"
|
||||||
|
"mt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type teamMgr struct {
|
type teamMgr struct {
|
||||||
cs.MsgHandlerImpl
|
cs.MsgHandlerImpl
|
||||||
|
curIdx int64
|
||||||
teamUuidHash map[string]*team
|
teamUuidHash map[string]*team
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) Init() {
|
func (this *teamMgr) Init() {
|
||||||
this.teamUuidHash = make(map[string]*team)
|
this.teamUuidHash = make(map[string]*team)
|
||||||
|
this.curIdx = f5.GetApp().GetNowSeconds()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) UnInit() {
|
func (this *teamMgr) UnInit() {
|
||||||
@ -24,7 +27,18 @@ func (this *teamMgr) CreateTeam(hum common.Player, msg *cs.CMLogin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *teamMgr) genTeamUuid(zoneId int32, nodeId int32) string {
|
func (this *teamMgr) genTeamUuid(zoneId int32, nodeId int32) string {
|
||||||
|
this.curIdx++
|
||||||
teamUuid := q5.ToString(zoneId) + "_" + q5.ToString(nodeId) + "_" +
|
teamUuid := q5.ToString(zoneId) + "_" + q5.ToString(nodeId) + "_" +
|
||||||
q5.Md5Str(q5.ToString(f5.GetApp().NewUuid()))
|
q5.Md5Str(q5.ToString(f5.GetApp().NewUuid()) + q5.ToString(f5.GetApp().GetPid()) +
|
||||||
|
q5.ToString(this.curIdx) +
|
||||||
|
mt.Table.MatchCluster.GetIp() + "520d8eAbB(8cf1^#$^&!@d833a42c820432PDAFE^^)")
|
||||||
return teamUuid
|
return teamUuid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *teamMgr) GetTeamByUuid(teamUuid string) common.Team {
|
||||||
|
team, ok := this.teamUuidHash[teamUuid]
|
||||||
|
if ok {
|
||||||
|
return team
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user