From 23b3fbb321e68c78fa4ceda608de44ea1a8fd585 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 13 三月 2019 17:25:16 +0800
Subject: [PATCH] 6328 【后端】优化代码eval - 二进制流 不能直接输出
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
index b25ce9b..d61c9c3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -32,7 +32,7 @@
import BossHurtMng
import time
-import cPickle
+import json
Def_Process_Tick = "ProcessPlayerCache"
##玩家下线同步
@@ -73,6 +73,7 @@
sendPack.PlusData = curPlayerPlusData
sendPack.PlusDataSize = len(curPlayerPlusData)
sendPack.IsLogouting = IsLogouting #通知本次同步是否下线前保存
+ sendPack.OffTime = int(time.time()) # 最后一次发送即当做离线时间
NetPackCommon.SendPyPackToGameServer(sendPack)
GameWorld.DebugLog('ViewCache### UpdateGameServerPlayerCache out')
return
@@ -105,8 +106,6 @@
#推送提醒
curPlayerPropDict[ChConfig.Def_PDict_GeTuiSet] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GeTuiSet)
curPlayerPropDict[ChConfig.Def_PDict_NoGeTuiTime] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NoGeTuiTime)
- curPlayerPropDict['GeTuiClientID'] = curPlayer.GetAccountData().GetGeTuiClientID()
- curPlayerPropDict['Time'] = int(time.time()) # 最后一次发送即当做离线时间
# 各类功能 BOSS次数, BOSS相关对应B.Boss信息.xlsx的CntMark
# 封魔坛剩余次数
@@ -169,9 +168,9 @@
curPlayerPlusDict["Fruit"] = PlayerAttrFruit.GetAttrFruitEatCntDict(curPlayer)
#-----------
- curPlayerPropData = cPickle.dumps(curPlayerPropDict, 2)
- curPlayerItemData = cPickle.dumps(curEquipItemList, 2)
- curPlayerPlusData = cPickle.dumps(__RemoveEmptyDataKey(curPlayerPlusDict), 2)
+ curPlayerPropData = json.dumps(curPlayerPropDict, ensure_ascii=False)
+ curPlayerItemData = json.dumps(curEquipItemList, ensure_ascii=False)
+ curPlayerPlusData = json.dumps(__RemoveEmptyDataKey(curPlayerPlusDict), ensure_ascii=False)
return (curPlayerPropData, curPlayerItemData, curPlayerPlusData)
def __RemoveEmptyDataKey(dataDict):
--
Gitblit v1.8.0