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 |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/CrossRealmPlayer.py
index 76ded9f..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:
@@ -196,6 +211,8 @@
 
 def SendCrossRealmReg(curPlayer, registerMap, mapID=0, dataMapID=0, copyMapID=0, posX=0, posY=0, lineID=0):
     # 发送跨服账号注册上传数据
+    # @param mapID: 真实场景地图ID
+    # @param dataMapID: 真实场景地图ID对应场景数据地图ID
     
     # 设置上传数据的活动类型
     curPlayer.SetDict(ChConfig.Def_PlayerKey_CrossRegisterMap, registerMap)
@@ -432,16 +449,18 @@
     if not IsCrossServerOpen():
         return
     
+    Sync_CrossZoneInfo(curPlayer)
     LoginDoUnNotifyCrossMsg(curPlayer)
     return
     
-def MapServer_QueryCrossPlayerResult(playerID, callName, msgInfo):
+def MapServer_QueryCrossPlayerResult(playerID, callName, msgInfo, offlineExitCross=False):
     ## 同步地图跨服玩家处理信息,玩家可能不在线,缓存后等玩家上线处理,暂不考虑存档问题,服务器维护后未处理的命令将失效
     
     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:
@@ -449,7 +468,8 @@
         msgList = PyGameData.g_unNotifyPlayerCrossMsgDict[playerID]
         msgList.append([callName, msgInfo])
         GameWorld.Log("玩家不在线,添加未通知的跨服命令: %s, msgInfo=%s" % (callName, msgInfo), playerID)
-        
+        if offlineExitCross:
+            DoOfflinePlayerExitCrossServer(playerID)
     return
 
 def LoginDoUnNotifyCrossMsg(curPlayer):
@@ -463,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