From bc433db8262081f0400bcb9c2c3476000662daf3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 10 七月 2024 14:24:53 +0800
Subject: [PATCH] 10205 【越南】【主干】【港台】【砍树】自选礼包(支持一次性放入超65535个数叠加物品;邮件同步支持一次性领取超65535个数叠加物品)

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

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
index d25d85e..a59b095 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
@@ -92,6 +92,21 @@
         ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition(zoneTypeName, {"CrossZoneName":crossZoneName}, True)
     return ipyDataList
 
+def GetServerCommCrossZoneID(serverGroupID):
+    ## 获取跨服常规分区
+    zoneTypeName = "CrossZoneComm"
+    crossZoneName = GameWorld.GetCrossZoneName()
+    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition(zoneTypeName, {"CrossZoneName":crossZoneName}, True)
+    if not ipyDataList:
+        return 0
+    for ipyData in ipyDataList:
+        serverGroupIDList = ipyData.GetServerGroupIDList()
+        for serverGroupIDInfo in serverGroupIDList:
+            if (isinstance(serverGroupIDInfo, tuple) and serverGroupIDInfo[0] <= serverGroupID <= serverGroupIDInfo[1]) \
+                or (isinstance(serverGroupIDInfo, int) and serverGroupIDInfo == serverGroupID):
+                return ipyData.GetZoneID()
+    return 0
+
 def GetServerCrossZoneMapIpyData(zoneID, mapID):
     ## 获取本服对应跨服玩法分区地图信息 - 仅适用于固定地图及虚拟分线的跨服玩法
     if mapID not in ChConfig.Def_CrossZoneMapTableName:
@@ -434,6 +449,7 @@
     if not IsCrossServerOpen():
         return
     
+    Sync_CrossZoneInfo(curPlayer)
     LoginDoUnNotifyCrossMsg(curPlayer)
     return
     
@@ -441,9 +457,10 @@
     ## 同步地图跨服玩家处理信息,玩家可能不在线,缓存后等玩家上线处理,暂不考虑存档问题,服务器维护后未处理的命令将失效
     
     curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
-    if curPlayer:
+    if curPlayer and curPlayer.GetInitOK():
         msgInfo = str(msgInfo)
         curPlayer.MapServer_QueryPlayerResult(0, 0, callName, msgInfo, len(msgInfo))
+        return curPlayer
     else:
         # 缓存起来,等上线后处理
         if playerID not in PyGameData.g_unNotifyPlayerCrossMsgDict:
@@ -466,5 +483,8 @@
         curPlayer.MapServer_QueryPlayerResult(0, 0, callName, msgInfo, len(msgInfo))
     return
 
-
-    
\ No newline at end of file
+def Sync_CrossZoneInfo(curPlayer):
+    clientPack = ChPyNetSendPack.tagGCCrossZoneInfo()
+    clientPack.CommZoneID = GetServerCommCrossZoneID(GameWorld.GetServerGroupID())
+    NetPackCommon.SendFakePack(curPlayer, clientPack)
+    return

--
Gitblit v1.8.0