From 35ea5958b7f66769273552e1003b88627a5ea7f3 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 17 六月 2022 19:11:02 +0800 Subject: [PATCH] 5416 【工具】兑换码优化(增加超时时间秒配置;修复兑换码在发送游戏服务器使用失败的情况下依然设置已使用的bug;优化错误日志详情输出) --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py | 27 ++++++++++++++++++++++++--- 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py index 7c5686e..322b1a8 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py @@ -21,8 +21,10 @@ import GameWorld import PlayerControl import NetPackCommon +import GameWorldArena import ChPyNetSendPack import PlayerFBHelpBattle +import CrossBattlefield import PyGameDataStruct import IpyGameDataPY import PyDataManager @@ -40,6 +42,12 @@ if PlayerFBHelpBattle.IsInHelpBattleCheckInList(playerID): return True + if GameWorldArena.IsArenaBattlePlayer(playerID): + return True + + if CrossBattlefield.IsBattlefieldCallPlayer(playerID): + return True + SaveDBLimitLV = IpyGameDataPY.GetFuncCfg("PlayerViewCache", 1) #校验玩家等级 if playerLV < SaveDBLimitLV: @@ -49,6 +57,15 @@ def IsSaveAllViewCache(playerID): ## 是否保存所有缓存数据 + + if PlayerFBHelpBattle.IsInHelpBattleCheckInList(playerID): + return True + + if GameWorldArena.IsArenaBattlePlayer(playerID): + return True + + if CrossBattlefield.IsBattlefieldCallPlayer(playerID): + return True NeedCheckBillBoardType = IpyGameDataPY.GetFuncEvalCfg("PlayerViewCache", 2) #校验玩家是否上排行榜 @@ -66,7 +83,7 @@ ## 删除过期的查看缓存数据 curTime = int(time.time()) - MaxTime = 30 * 3600 * 24 # 30天 + MaxTime = IpyGameDataPY.GetFuncCfg("PlayerViewCache", 3) * 3600 * 24 pyViewCacheMgr = PyDataManager.GetPlayerViewCachePyManager() playerViewCachePyDict = pyViewCacheMgr.playerViewCachePyDict @@ -106,7 +123,7 @@ ## 获取缓存基础属性字典信息 if not hasattr(curCache, "PropDataDict"): curCache.PropDataDict = {} - if not curCache.PropDataDict: + if not curCache.PropDataDict and curCache.PropData: curCache.PropDataDict = eval(curCache.PropData) return curCache.PropDataDict @@ -263,7 +280,11 @@ answerPack.LV = cacheDict["LV"] answerPack.RealmLV = cacheDict["RealmLV"] answerPack.OnlineType = ChConfig.Def_Offline - answerPack.ServerGroupID = cacheDict.get("ServerGroupID", 0) + + if GameWorld.IsCrossServer(): + answerPack.ServerGroupID = cacheDict.get("ServerGroupID", 0) + else: + answerPack.ServerGroupID = GameWorld.GetServerGroupID() else: answerPack.PlayerID = clientPack.PlayerID answerPack.PlayerName = tagPlayer.GetName() -- Gitblit v1.8.0