This commit is contained in:
aozhiwei 2024-04-17 10:43:14 +08:00
parent 8471c502a4
commit bd7a68482d
2 changed files with 5 additions and 4 deletions

View File

@ -44,11 +44,12 @@ func (this *player) SendMsg(rspMsg proto.Message) {
GetWspListener().SendProxyMsg(this.socket.Conn, this.socket.SocketHandle, rspMsg)
}
func (this *player) reBind(socket f5.WspCliConn) {
func (this *player) reBind(socket f5.WspCliConn, sessionId string) {
if this.socket.IsValid() {
delete(_playerMgr.socketHash, this.socket)
}
this.socket = socket
this.sessionId = sessionId
_playerMgr.socketHash[this.socket] = this
}

View File

@ -83,7 +83,7 @@ func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
rspMsg.Errcode = proto.Int32(0)
rspMsg.Errmsg = proto.String("")
rspMsg.ServerInfo = proto.String(mt.Table.IMCluster.GetServerInfo())
oldHum.reBind(hdr.GetSocket())
oldHum.reBind(hdr.GetSocket(), msg.GetSessionId())
oldHum.SendMsg(&rspMsg)
return
}
@ -95,7 +95,7 @@ func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
rspMsg.Errcode = proto.Int32(0)
rspMsg.Errmsg = proto.String("")
rspMsg.ServerInfo = proto.String(mt.Table.IMCluster.GetServerInfo())
oldHum.reBind(hdr.GetSocket())
oldHum.reBind(hdr.GetSocket(), msg.GetSessionId())
oldHum.SendMsg(&rspMsg)
return
}
@ -270,7 +270,7 @@ func (this *playerMgr) CMReconnect(hdr *f5.MsgHdr, msg *cs.CMReconnect) {
"session_id no valid"))
return
}
hum.reBind(hdr.GetSocket())
hum.reBind(hdr.GetSocket(), msg.GetSessionId())
hum.SendMsg(rspMsg)
}