1
This commit is contained in:
parent
e3307f7e64
commit
3a216a6795
@ -27,3 +27,10 @@ func (this *player) SendMsg(rspMsg proto.Message) {
|
||||
func (this *player) GetRoom() *common.Room {
|
||||
return this.room
|
||||
}
|
||||
|
||||
|
||||
func (this *player) init(req *pendingLoginRequest){
|
||||
this.socket = req.hdr.GetSocket()
|
||||
this.accountId = req.msg.GetAccountId()
|
||||
this.sessionId = req.msg.GetSessionId()
|
||||
}
|
||||
|
@ -148,14 +148,10 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
||||
return
|
||||
}
|
||||
|
||||
player := player{
|
||||
socket: hdr.GetSocket(),
|
||||
accountId: msg.GetAccountId(),
|
||||
sessionId: msg.GetAccountId(),
|
||||
}
|
||||
// Add to online user
|
||||
this.addplayer(&player)
|
||||
this.addSocketHash(hdr.GetSocket(), &player)
|
||||
hum := new(player)
|
||||
hum.init(pendingReq)
|
||||
this.addPlayer(hum)
|
||||
this.addSocketHash(hdr.GetSocket(), hum)
|
||||
|
||||
serverInfo := mt.Table.HallCluster.GetIp() + ":" + q5.ToString(mt.Table.HallCluster.GetListenPort())
|
||||
rspMsg.ServerInfo = &serverInfo
|
||||
@ -186,7 +182,7 @@ func (this *playerMgr) GetPlayers() map[string]*player {
|
||||
return this.accountIdHash
|
||||
}
|
||||
|
||||
func (this *playerMgr) addplayer(p *player) {
|
||||
func (this *playerMgr) addPlayer(p *player) {
|
||||
this.accountIdHash[p.accountId] = p
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user