修改
This commit is contained in:
@@ -3,7 +3,6 @@ package player
|
||||
import (
|
||||
"blazing/common/data"
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/common/utils"
|
||||
"blazing/cool"
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/fight/info"
|
||||
@@ -20,6 +19,7 @@ import (
|
||||
"github.com/antlabs/timer"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
csmap "github.com/mhmtszr/concurrent-swiss-map"
|
||||
"github.com/panjf2000/gnet/v2"
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ func CountPlayer() int {
|
||||
}
|
||||
|
||||
// Mainplayer 全局玩家数据存储映射
|
||||
var Mainplayer = &utils.SyncMap[uint32, *Player]{}
|
||||
var Mainplayer = csmap.New[uint32, *Player]()
|
||||
|
||||
type OgrePetInfo struct {
|
||||
Id uint32
|
||||
@@ -226,7 +226,7 @@ func (player1 *Player) Kick() {
|
||||
//取成功,否则创建
|
||||
//player1.Save() //先保存数据再返回
|
||||
head := common.NewTomeeHeader(1001, player1.Info.UserID)
|
||||
head.Result = uint32(errorcode.ErrorCodes.ErrAccountLoggedInElsewhere)
|
||||
head.Result = uint32(errorcode.ErrorCodes.ErrXinPlanSleepMode)
|
||||
//实际上这里有个问题,会造成重复保存问题
|
||||
|
||||
player1.SendPack(head.Pack(nil))
|
||||
|
||||
Reference in New Issue
Block a user