From 164b1a9e2eb3f9908e95e0050de828f0e35cb74b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 23 五月 2022 16:38:31 +0800
Subject: [PATCH] 9415 【BT5】【后端】古神战场(初版:包含战场副本外的所有功能;副本中暂仅支持击杀玩家玩法)

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
index f700782..76ded9f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
@@ -428,6 +428,40 @@
     PyGameData.g_crossSetPlayerAttr = {}
     return
 
+def OnPlayerLogin(curPlayer):
+    if not IsCrossServerOpen():
+        return
+    
+    LoginDoUnNotifyCrossMsg(curPlayer)
+    return
+    
+def MapServer_QueryCrossPlayerResult(playerID, callName, msgInfo):
+    ## 同步地图跨服玩家处理信息,玩家可能不在线,缓存后等玩家上线处理,暂不考虑存档问题,服务器维护后未处理的命令将失效
+    
+    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+    if curPlayer:
+        msgInfo = str(msgInfo)
+        curPlayer.MapServer_QueryPlayerResult(0, 0, callName, msgInfo, len(msgInfo))
+    else:
+        # 缓存起来,等上线后处理
+        if playerID not in PyGameData.g_unNotifyPlayerCrossMsgDict:
+            PyGameData.g_unNotifyPlayerCrossMsgDict[playerID] = []
+        msgList = PyGameData.g_unNotifyPlayerCrossMsgDict[playerID]
+        msgList.append([callName, msgInfo])
+        GameWorld.Log("玩家不在线,添加未通知的跨服命令: %s, msgInfo=%s" % (callName, msgInfo), playerID)
+        
+    return
+
+def LoginDoUnNotifyCrossMsg(curPlayer):
+    playerID = curPlayer.GetPlayerID()
+    msgList = PyGameData.g_unNotifyPlayerCrossMsgDict.pop(playerID, [])
+    if not msgList:
+        return
+    for callName, msgInfo in msgList:
+        GameWorld.Log("上线处理未通知的跨服命令: %s, msgInfo=%s" % (callName, msgInfo), playerID)
+        msgInfo = str(msgInfo)
+        curPlayer.MapServer_QueryPlayerResult(0, 0, callName, msgInfo, len(msgInfo))
+    return
 
 
     
\ No newline at end of file

--
Gitblit v1.8.0