1
This commit is contained in:
parent
d55122d764
commit
413fe047f5
@ -18,6 +18,7 @@ type Team interface {
|
|||||||
|
|
||||||
type TeamMgr interface {
|
type TeamMgr interface {
|
||||||
ProcessCMMsg(*cs.CsNetMsgHandler, *f5.MsgHdr)
|
ProcessCMMsg(*cs.CsNetMsgHandler, *f5.MsgHdr)
|
||||||
|
GetTeamByUuid(string) Team
|
||||||
}
|
}
|
||||||
|
|
||||||
type Player interface {
|
type Player interface {
|
||||||
|
@ -170,12 +170,25 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hum := new(player)
|
if msg.GetCreateTeamParam() != nil {
|
||||||
hum.init(pendingReq, rspObj.Info.Name, rspObj.Info.HeadId, rspObj.Info.HeroId, rspObj.Info.HeadFrame)
|
hum := new(player)
|
||||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
hum.init(pendingReq, rspObj.Info.Name, rspObj.Info.HeadId, rspObj.Info.HeroId, rspObj.Info.HeadFrame)
|
||||||
|
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||||
|
|
||||||
rspMsg.ServerInfo = proto.String(mt.Table.MatchCluster.GetServerInfo())
|
rspMsg.ServerInfo = proto.String(mt.Table.MatchCluster.GetServerInfo())
|
||||||
GetWspListener().SendProxyMsg(hdr.Conn, hdr.SocketHandle, &rspMsg)
|
GetWspListener().SendProxyMsg(hdr.Conn, hdr.SocketHandle, &rspMsg)
|
||||||
|
} else if msg.GetJoinTeamParam() != nil {
|
||||||
|
team := GetTeamMgr().GetTeamByUuid(msg.GetJoinTeamParam().GetTeamUuid())
|
||||||
|
if team == nil {
|
||||||
|
rspMsg.Errcode = proto.Int32(101)
|
||||||
|
rspMsg.Errmsg = proto.String("join team error team not found")
|
||||||
|
GetWspListener().SendProxyMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg)
|
||||||
|
f5.GetSysLog().Warning("game2006api login auth errcode:%d", rspObj.Errcode)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
panic("CMLogin Param error")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *playerMgr) reportServerState(masterIp string, masterPort int32) {
|
func (this *playerMgr) reportServerState(masterIp string, masterPort int32) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user