From 7e2fba6800afaaeef3ac9d2d3c8c42ebcefd2016 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期二, 05 三月 2019 15:53:48 +0800 Subject: [PATCH] 6328 【后端】优化代码eval --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py index bffd6cb..525da05 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerViewCache.py @@ -85,7 +85,7 @@ # 同步更新助战信息 if PlayerFBHelpBattle.IsInHelpBattleCheckInList(PlayerID): - PropDataDict = eval(PropData) + PropDataDict = json.loads(PropData) fightPower = PropDataDict.get("FightPower", 0) familyID = PropDataDict.get("FamilyID", 0) playerName = PropDataDict.get("Name", "") @@ -236,7 +236,7 @@ return playerEquipList = [] - equipItemList = eval(itemData) + equipItemList = json.loads(itemData) for equipItemDict in equipItemList: equipIndex = equipItemDict["ItemIndex"] if equipIndex not in ShareDefine.RoleEquipType: @@ -276,7 +276,7 @@ answerPack.OnlineType = ChConfig.Def_Offline answerPack.ServerGroupID = 0 else: - cacheDict = eval(curCache.GetPropData()) + cacheDict = json.loads(curCache.GetPropData()) answerPack.PlayerID = clientPack.PlayerID answerPack.PlayerName = cacheDict["Name"] @@ -305,7 +305,7 @@ curCache = ViewCacheMgr.FindCache(playerID) if not curCache: return - PropData = eval(curCache.GetPropData()) + PropData = json.loads(curCache.GetPropData()) PropData["FamilyID"] = familyID PropData["FamilyName"] = familyName playerLV = PropData["LV"] -- Gitblit v1.8.0