This commit is contained in:
aozhiwei 2024-03-21 11:37:59 +08:00
parent f4da177f3c
commit 65ebd56c28
2 changed files with 14 additions and 4 deletions

View File

@ -963,7 +963,6 @@ func (this *player) FillMFUser(profile *PlayerProfile) *cs.MFUser {
}
*/
// FillMFChatUser 填充聊天信息
func (this *player) FillMFChatUser() *cs.MFChatUser {
/*
accountId := p.accountId
@ -1006,6 +1005,9 @@ func (this *player) IncrPrivateChatLastId() uint64 {
}
*/
func (this *player) onOffline() {
}
func newPlayer() *player {
hum := new(player)
return hum

View File

@ -8,7 +8,7 @@ import (
"github.com/golang/protobuf/proto"
"mt"
"q5"
//"net"
"net"
"main/constant"
"main/common"
. "main/global"
@ -47,7 +47,6 @@ func (this *playerMgr) init() {
f5.GetApp().RegisterIMMsgHandle(
constant.IM_WSP_CLOSE,
func(args q5.Args) {
/*
conn := args[0].(net.Conn)
deletedPlayers := make(map[f5.WspCliConn]*player)
for socket, hum := range this.socketHash {
@ -57,7 +56,7 @@ func (this *playerMgr) init() {
}
for socket, _ := range deletedPlayers {
this.onSocketClose(socket)
}*/
}
})
}
@ -276,3 +275,12 @@ func (this *playerMgr) CMReconnect(hdr *f5.MsgHdr, msg *cs.CMReconnect) {
hum.reBind(hdr.GetSocket())
GetWspListener().SendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg)
}
func (this *playerMgr) onSocketClose(conn f5.WspCliConn) {
hum := this.internalGetPlayerBySocket(conn)
if hum == nil {
return
}
delete(this.socketHash, conn)
hum.onOffline()
}