1
This commit is contained in:
parent
15ca5cc7c0
commit
d79f947b7d
@ -47,6 +47,7 @@ type TeamMgr interface {
|
||||
ProcessCMMsg(*cs.CsNetMsgHandler, *f5.MsgHdr)
|
||||
CreateTeam(Player, *cs.CMLogin) Team
|
||||
GetTeamByUuid(string) Team
|
||||
RefreshHisTeam(Player)
|
||||
}
|
||||
|
||||
type Player interface {
|
||||
@ -66,10 +67,6 @@ type PlayerMgr interface {
|
||||
ProcessCMMsg(*cs.CsNetMsgHandler, *f5.MsgHdr)
|
||||
GetPlayerBySocket(f5.WspCliConn) Player
|
||||
GetPlayerByAccountId(string) Player
|
||||
HasHisPendingTeam(Player) bool
|
||||
TraverseHisPendingTeam(Player)
|
||||
HasHisStartedTeam(Player) bool
|
||||
TraverseHisStartedTeam(Player)
|
||||
}
|
||||
|
||||
type WspListener interface {
|
||||
|
@ -174,3 +174,8 @@ func (this *player) CMSetReady(hdr *f5.MsgHdr, msg *cs.CMSetReady) {
|
||||
|
||||
func (this *player) CMGrantInvitePermission(hdr *f5.MsgHdr, msg *cs.CMGrantInvitePermission) {
|
||||
}
|
||||
|
||||
func newPlayer() *player {
|
||||
hum := new(player)
|
||||
return hum
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
||||
}
|
||||
|
||||
if msg.GetCreateTeamParam() != nil {
|
||||
hum := new(player)
|
||||
hum := newPlayer()
|
||||
hum.init(pendingReq, &rspObj)
|
||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||
team := GetTeamMgr().CreateTeam(hum, msg)
|
||||
@ -196,7 +196,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
||||
hum.againInit(pendingReq, &rspObj)
|
||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||
} else {
|
||||
hum := new(player)
|
||||
hum := newPlayer()
|
||||
hum.init(pendingReq, &rspObj)
|
||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||
team.Join(hum)
|
||||
|
Loading…
x
Reference in New Issue
Block a user