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/GameWorldLogic/CrossRealmPK.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py index 9b62c48..9ae3cb6 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossRealmPK.py @@ -35,6 +35,7 @@ import operator import random import time +import json class CrossPKPlayer(): ## 跨服PK玩家类 @@ -1922,7 +1923,7 @@ overInfoData.OverType = overType overInfoData.PlayerID = playerID overInfoData.WinnerID = winnerID - overInfoData.RoundWinnerInfo = str(roundWinnerIDList) + overInfoData.RoundWinnerInfo = json.dumps(roundWinnerIDList, ensure_ascii=False) overInfoData.RoundWinnerLen = len(overInfoData.RoundWinnerInfo) overInfoData.PKScore = pkScore overInfoData.DanLV = danLV @@ -1957,7 +1958,7 @@ winnerID = overInfoData.WinnerID roundWinnerIDList = [] try: - roundWinnerIDList = eval(overInfoData.RoundWinnerInfo) + roundWinnerIDList = json.loads(overInfoData.RoundWinnerInfo) except: GameWorld.ErrLog("__OnLoginNotifyPKOverInfo roundWinnerIDList eval error! RoundWinnerInfo=%s" % overInfoData.RoundWinnerInfo, playerID) pkScore = overInfoData.PKScore -- Gitblit v1.8.0