This commit is contained in:
aozhiwei 2023-09-08 15:11:36 +08:00
parent 74466e42d8
commit 02086f8467
2 changed files with 8 additions and 4 deletions

View File

@ -34,6 +34,13 @@ func (this *player) init(req *pendingLoginRequest){
this.sessionId = req.msg.GetSessionId() this.sessionId = req.msg.GetSessionId()
} }
func (this *player) onOffline(){
this.socket.Reset()
if this.room != nil {
this.room.OnPlayerOffline(this)
}
}
func (this *player) CMCreateRoom(hdr *f5.MsgHdr, msg *cs.CMCreateRoom) { func (this *player) CMCreateRoom(hdr *f5.MsgHdr, msg *cs.CMCreateRoom) {
} }

View File

@ -227,8 +227,5 @@ func (this *playerMgr) SS_WSP_SocketDisconnect(hdr *f5.MsgHdr, msg *ss.SS_WSP_So
return return
} }
delete(this.socketHash, hdr.GetSocket()) delete(this.socketHash, hdr.GetSocket())
hum.socket.Reset() hum.onOffline()
if hum.room != nil {
hum.room.OnPlayerOffline(hum)
}
} }