ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameXiangong.py
@@ -25,11 +25,9 @@
import IpyGameDataPY
import PyGameData
import GameWorld
import ChConfig
import time
Def_UserDataKey_ServerIDList = "ServerIDList"
Def_UserDataKey_PlayerInfo = "PlayerInfo"
# 仙宫玩家记录
def GetXGPlayerID(recData): return recData.GetValue1() # 仙宫玩家ID
@@ -67,15 +65,15 @@
    
    gameRecMgr = PyDataManager.GetDBGameRecDataManager()
    recData = gameRecMgr.AddGameRecData(ShareDefine.Def_GameRecType_Xiangong, xiangongID, [playerID])
    playerInfo = PlayerViewCache.GetShotCacheDict(playerID, "ServerID")
    playerInfo = PlayerViewCache.GetShotCacheDict(playerID, "ServerID", "Face", "FacePic")
    
    serverID = playerInfo.get("ServerID", 0)
    saveServerIDList = [] + serverIDList # 重新创建一份存储,不改变传入值
    # 确保玩家自身一定能看到自己,跨服排位赛历史分区问题
    if saveServerIDList and serverID and not GameWorld.CheckServerIDInList(serverID, saveServerIDList):
        saveServerIDList.append(serverID)
    recData.SetUserDataByKey(Def_UserDataKey_ServerIDList, saveServerIDList) # 保存当下的区服ID范围
    recData.SetUserDataByKey(Def_UserDataKey_PlayerInfo, playerInfo) # 保存当下的玩家基本信息
    recData.SetUserDataByKey(ChConfig.Def_RecDataKey_ServerIDList, saveServerIDList) # 保存当下的区服ID范围
    recData.SetUserDataByKey(ChConfig.Def_RecDataKey_PlayerInfo, playerInfo) # 保存当下的玩家基本信息
    GameWorld.Log("新晋仙官玩家: xiangongID=%s,playerID=%s,rank=%s,serverID=%s,saveServerIDList=%s,%s" 
                  % (xiangongID, playerID, rank, serverID, saveServerIDList, playerInfo))
    
@@ -133,7 +131,7 @@
        if passDays > showDays:
            GameWorld.DebugLog("    xgPlayerID=%s,addTime=%s,passDays=%s > %s" % (xgPlayerID, addTime, passDays, showDays))
            break
        serverIDList = recData.GetUserDataByKey(Def_UserDataKey_ServerIDList)
        serverIDList = recData.GetUserDataByKey(ChConfig.Def_RecDataKey_ServerIDList)
        if playerServerID:
            if serverIDList == None:
                GameWorld.DebugLog("    xgPlayerID=%s,serverIDList is None" % (xgPlayerID))
@@ -142,7 +140,7 @@
                GameWorld.DebugLog("    xgPlayerID=%s,playerServerID=%s not in %s" % (xgPlayerID, playerServerID, serverIDList))
                continue
            
        playerInfo = PlayerViewCache.GetShotCacheDict(xgPlayerID, "PlayerID", "ServerID", "Model")
        playerInfo = PlayerViewCache.GetShotCacheDict(xgPlayerID, "PlayerID", "ServerID", "Model", "Face", "FacePic")
        if not playerInfo:
            GameWorld.Log("找不到玩家缓存的暂不同步仙宫新晋仙官! xgPlayerID=%s" % xgPlayerID)
            continue
@@ -173,8 +171,8 @@
    recDataList = gameRecMgr.GetGameRecDataList(ShareDefine.Def_GameRecType_Xiangong, xiangongID)
    
    for recData in recDataList[::-1]:
        serverIDList = recData.GetUserDataByKey(Def_UserDataKey_ServerIDList)
        playerInfo = recData.GetUserDataByKey(Def_UserDataKey_PlayerInfo)
        serverIDList = recData.GetUserDataByKey(ChConfig.Def_RecDataKey_ServerIDList)
        playerInfo = recData.GetUserDataByKey(ChConfig.Def_RecDataKey_PlayerInfo)
        if not playerInfo or not GameWorld.CheckServerIDInList(serverID, serverIDList):
            continue
        playerInfo["AddTime"] = recData.GetTime()
@@ -277,6 +275,8 @@
        newP.LV = playerInfo["LV"]
        newP.Job = playerInfo["Job"]
        newP.RealmLV = playerInfo["RealmLV"]
        newP.Face = playerInfo.get("Face", 0)
        newP.FacePic = playerInfo.get("FacePic", 0)
        newP.EquipShowSwitch = playerInfo["EquipShowSwitch"]
        newP.EquipShowID = playerInfo["EquipShowID"]
        newP.EquipShowIDCount = len(newP.EquipShowID)
@@ -356,6 +356,8 @@
        recP.LV = playerInfo["LV"]
        recP.Job = playerInfo["Job"]
        recP.RealmLV = playerInfo["RealmLV"]
        recP.Face = playerInfo.get("Face", 0)
        recP.FacePic = playerInfo.get("FacePic", 0)
        recPlayerList.append(recP)
        
    clientPack = ChPyNetSendPack.tagGCXiangongRecPlayerInfo()