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