From aee5f99d9d8b773862aa33c3a266f78c4af2f9f3 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 6 Jun 2024 14:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E4=B8=AA=E4=BA=BA=E6=B0=B4?= =?UTF-8?q?=E6=B1=A0=E8=B0=83=E6=8E=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gameparam.go | 1 + worldsrv/action_player.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/model/gameparam.go b/model/gameparam.go index d834e6b..8e10069 100644 --- a/model/gameparam.go +++ b/model/gameparam.go @@ -89,6 +89,7 @@ type GameParam struct { RankPlayerLevelMaxNum int //等级榜最大人数 CloseChannelSwitch bool //关闭渠道开关功能 BackendTimeLocal int //后台时区 + GameStaticsFightVersion int // 对战场游戏统计数据版本号 } var GameParamPath = "../data/gameparam.json" diff --git a/worldsrv/action_player.go b/worldsrv/action_player.go index dc1f3f6..8ae9704 100644 --- a/worldsrv/action_player.go +++ b/worldsrv/action_player.go @@ -1941,6 +1941,22 @@ func CSPlayerData(s *netlib.Session, packetid int, data interface{}, sid int64) if ls.clog != nil { PlayerSubjectSign.UpdateHeadUrl(p.SnId, ls.clog.HeadUrl) } + + // 重置对战场统计数据重置 + v, ok := p.GDatas[common.GetKeyGameType(2)] + if ok && v != nil { + if int(v.Statics.Version) < model.GameParamData.GameStaticsFightVersion { + v.Statics.Version = int32(model.GameParamData.GameStaticsFightVersion) + v.Statics.TotalIn = 0 + v.Statics.TotalOut = 0 + v.Statics.Tax = 0 + v.Statics.MaxSysOut = 0 + // 个人水池 + p.TotalIn = 0 + p.TotalOut = 0 + p.PlayerTax = 0 + } + } } // 有缓存数据