From 6834282d0466dc61064a0a08296b239dc266cf71 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 17 三月 2021 18:14:53 +0800
Subject: [PATCH] 4742 【BT】在跨服购买跨服boss次数后没有生效(购买boss次数立马同步;onday时立马同步)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py    |   20 ++++++++++++++------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py |    3 +++
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
index cfb419d..db1c271 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
@@ -320,18 +320,26 @@
     #GameWorld.DebugLog("标记需要同步跨服玩家战力变更相关数据! tick=%s" % tick, curPlayer.GetPlayerID())
     return
 
+def SendMergePlayerDataNow(curPlayer):
+    ## 马上同步一次玩家数据到跨服 MergeData_Player
+    GameWorld.DebugLog("SendMergePlayerDataNow")
+    ProcessCrossPlayer(curPlayer, 0)
+    return
+
 def ProcessCrossPlayer(curPlayer, tick):
     ## 跨服状态的本服玩家处理
     if not IsNeedProcessCrossPlayer(curPlayer):
         return
     
     playerID = curPlayer.GetPlayerID()
-    if playerID not in PyGameData.g_crossSyncTickDict:
-        return
-    setTick = PyGameData.g_crossSyncTickDict[playerID]
-    if tick - setTick < IpyGameDataPY.GetFuncCfg("CrossSyncPlayerData", 1) * 1000:
-        return
-    PyGameData.g_crossSyncTickDict.pop(playerID)
+    # tick 传0时不检查CD,立即同步
+    if tick:
+        if playerID not in PyGameData.g_crossSyncTickDict:
+            return
+        setTick = PyGameData.g_crossSyncTickDict[playerID]
+        if tick - setTick < IpyGameDataPY.GetFuncCfg("CrossSyncPlayerData", 1) * 1000:
+            return
+    PyGameData.g_crossSyncTickDict.pop(playerID, None)
     GameWorld.DebugLog("开始同步本服变更的属性...", playerID)
     
     try:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index ba67337..34a5fa9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -100,6 +100,7 @@
 import PlayerFlashSale
 import PlayerWishingWell
 import PlayerFairyDomain
+import CrossPlayerData
 import PlayerVip
 import PlayerDiceEx
 import IpyGameDataPY
@@ -568,6 +569,8 @@
         PlayerArena.OnDayEx(curPlayer)
         #协助
         PlayerAssist.DoPlayerOnDay(curPlayer)
+        #特殊时间点过天的,一般是游戏功能,此时立即同步一次跨服玩家数据
+        CrossPlayerData.SendMergePlayerDataNow(curPlayer)
         
     PlayerTJG.TJGOnDay(curPlayer, onEventType)
     # 以下为支持两种重置模式切换配置的

--
Gitblit v1.8.0