This commit is contained in:
aozhiwei 2024-03-21 11:21:56 +08:00
parent 8547844fa7
commit b2ebe43b70

View File

@ -160,9 +160,10 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
}
hum := newPlayer()
hum.init(pendingReq, &rspObj)
// Add to online user
//this.addPlayer(&player)
//this.addSocketHash(hdr.GetSocket(), &player)
this.accountIdHash[hum.GetAccountId()] = hum
this.socketHash[pendingReq.hdr.GetSocket()] = hum
rspMsg.ServerInfo = proto.String(mt.Table.IMCluster.GetServerInfo())
GetWspListener().SendProxyMsg(hdr.Conn, hdr.SocketHandle, &rspMsg)
/*
// Add player profile
playerProfile := &PlayerProfile{
@ -235,10 +236,6 @@ func (this *playerMgr) GetPlayers() map[string]*player {
return this.accountIdHash
}
func (this *playerMgr) addPlayer(p *player) {
this.accountIdHash[p.accountId] = p
}
func (this *playerMgr) GetPlayerByAccountId(accountId string) *player {
player, ok := this.accountIdHash[accountId]
if ok {
@ -271,10 +268,6 @@ func (this *playerMgr) getPlayerBySocket(socket f5.WspCliConn) *player {
return nil
}
func (this *playerMgr) addSocketHash(wsp f5.WspCliConn, p *player) {
this.socketHash[wsp] = p
}
func (this *playerMgr) GetOnlineStatus(accountId string) int32 {
player := this.GetPlayerByAccountId(accountId)
if player != nil {