This commit is contained in:
1
2025-10-10 03:06:23 +00:00
parent 4cb7b2d739
commit 4f9b33e85a
2 changed files with 12 additions and 8 deletions

View File

@@ -30,15 +30,18 @@ func KickPlayer(userid uint32) { //踢出玩家
//TODO 返回错误码
//var player *entity.Player
if player1, ok := Mainplayer.Load(userid); ok {
//取成功,否则创建
//player1.Save() //先保存数据再返回
head := NewTomeeHeader(1001, userid)
head.Result = uint32(errorcode.ErrorCodes.ErrAccountLoggedInElsewhere)
//实际上这里有个问题,会造成重复保存问题
if player1.IsLogin {
//取成功,否则创建
//player1.Save() //先保存数据再返回
head := NewTomeeHeader(1001, userid)
head.Result = uint32(errorcode.ErrorCodes.ErrAccountLoggedInElsewhere)
//实际上这里有个问题,会造成重复保存问题
player1.SendPack(head.Pack(nil))
player1.MainConn.MainConn.Close()
// clientdata.Player = player
}
player1.SendPack(head.Pack(nil))
player1.MainConn.MainConn.Close()
// clientdata.Player = player
}
//return player

View File

@@ -13,6 +13,7 @@ import (
)
type Conn struct {
MainConn gnet.Conn `struc:"[0]pad"` //TODO 不序列化,,序列化下面的作为blob存数据库
Mu sync.Mutex
}