hxp
2024-08-31 44bcd51874e364012946b5f34dd7bb166d86edfb
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
def Sync_CrossZoneInfo(curPlayer):
    clientPack = ChPyNetSendPack.tagGCCrossZoneInfo()
    clientPack.CommZoneID = GetServerCommCrossZoneID(GameWorld.GetServerGroupID())
    NetPackCommon.SendFakePack(curPlayer, clientPack)
    return