Compare commits

...

3 Commits

Author SHA1 Message Date
sk bcac7f06d3 update public 2024-09-05 11:26:52 +08:00
sk 1948560a03 Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-09-05 11:25:13 +08:00
sk f056014c50 玩家游戏数据保存 2024-09-05 11:24:46 +08:00
7 changed files with 7 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@ -149,7 +149,7 @@ func NewPlayer(sid int64, data []byte, ws, gs *netlib.Session) *Player {
ShopLastLookTime: make(map[int32]int64),
IsFoolPlayer: make(map[string]bool),
},
GameData: make(map[int32]*model.PlayerGameData),
GameData: make(map[string]*model.PlayerGameData),
}
if p.init(data) {
@ -383,7 +383,7 @@ func (this *Player) MarshalData(gameid int) (d []byte, e error) {
if v.Platform == "" {
v.Platform = this.Platform
}
if v.Id == 0 {
if v.Id == "" {
v.Id = k
}
}

View File

@ -348,7 +348,7 @@ type MatchFreeSignupRec struct {
// 大厅玩家信息发送给游戏服
type WGPlayerInfo struct {
*PlayerData
GameData map[int32]*PlayerGameData // 游戏数据,只允许存储玩家对应某个游戏需要持久化的数据
GameData map[string]*PlayerGameData // 游戏数据,只允许存储玩家对应某个游戏需要持久化的数据
}
type PlayerData struct {

View File

@ -9,7 +9,7 @@ import (
type PlayerGameData struct {
Platform string `bson:"-"`
SnId int32
Id int32 // 游戏id或场次id
Id string // 游戏id或场次id
Data interface{} // 数据
}

2
public

@ -1 +1 @@
Subproject commit cbad2992a1ce71327def46ea01ebbcc8800bee89
Subproject commit 06da9b31abec96f3936877d7d73069e9852781ff

View File

@ -30,7 +30,7 @@ type AllPlayerInfo struct {
// PlayerInfo 玩家信息
type PlayerInfo struct {
GameData map[int32]*model.PlayerGameData // 游戏数据
GameData map[string]*model.PlayerGameData // 游戏数据
}
type PlayerInfoMgr struct {
@ -69,7 +69,7 @@ func (p *PlayerInfoMgr) Callback(player any, ret *internal.PlayerLoadReplay) {
return
}
info := &PlayerInfo{
GameData: make(map[int32]*model.PlayerGameData),
GameData: make(map[string]*model.PlayerGameData),
}
// 游戏数据