| | |
| | | import IpyGameDataPY
|
| | | import PyDataManager
|
| | | import CrossRealmMsg
|
| | | import CrossRealmPK
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ChPlayer
|
| | |
| | | if billboardObj.FindByID(playerID):
|
| | | return True
|
| | |
|
| | | if CrossRealmPK.IsCrossRealmPKPlayer(playerID, checkPreSeason=True):
|
| | | return True
|
| | | else:
|
| | | NeedCheckBillBoardType = IpyGameDataPY.GetFuncEvalCfg("PlayerViewCache", 2)
|
| | | #校验玩家是否上排行榜
|
| | |
| | |
|
| | | PlayerPackData.DelOutofTimePackData()
|
| | |
|
| | | onlineMgr = ChPlayer.GetOnlinePlayerMgr()
|
| | | pyViewCacheMgr = PyDataManager.GetPlayerViewCachePyManager()
|
| | | playerViewCachePyDict = pyViewCacheMgr.playerViewCachePyDict
|
| | | for playerID, viewCache in playerViewCachePyDict.items():
|
| | | if IsSaveDBViewCache(viewCache):
|
| | | continue
|
| | | if onlineMgr.IsOnline(playerID):
|
| | | #在线的先不删除
|
| | | continue
|
| | | playerViewCachePyDict.pop(playerID)
|
| | |
|
| | |
| | |
|
| | | def GetSyncCrossCacheBase(curPlayer):
|
| | | ## 获取同步跨服基础查看缓存,主要用于个别功能需要提前先同步玩家基础缓存到跨服,因为跨服不一定有玩家缓存,需要提前同步
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if isinstance(curPlayer, int):
|
| | | playerID = curPlayer
|
| | | curPlayer = None
|
| | | else:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | cacheDict = GetCachePropDataDict(FindViewCache(playerID))
|
| | | cacheBase = {
|
| | | "AccID":curPlayer.GetAccID(),
|
| | | "LV":curPlayer.GetLV(),
|
| | | "RealmLV":curPlayer.GetOfficialRank(),
|
| | | "Job":curPlayer.GetJob(),
|
| | | "VIPLV":curPlayer.GetVIPLv(),
|
| | | "Name":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
|
| | | "Face":curPlayer.GetFace(),
|
| | | "FacePic":curPlayer.GetFacePic(),
|
| | | "FamilyID":curPlayer.GetFamilyID(),
|
| | | "AccID":curPlayer.GetAccID() if curPlayer else cacheDict.get("AccID", ""),
|
| | | "LV":curPlayer.GetLV() if curPlayer else cacheDict.get("LV", 1),
|
| | | "RealmLV":curPlayer.GetOfficialRank() if curPlayer else cacheDict.get("RealmLV", 1),
|
| | | "Job":curPlayer.GetJob() if curPlayer else cacheDict.get("Job", 1),
|
| | | "VIPLV":curPlayer.GetVIPLv() if curPlayer else cacheDict.get("VIPLV", 0),
|
| | | "Name":curPlayer.GetName() if curPlayer else cacheDict.get("Name", ""), # 此处不用跨服名称,如前端需要展示跨服名称,可通过ServerID或AccID取得ServerID展示
|
| | | "Face":curPlayer.GetFace() if curPlayer else cacheDict.get("Face", 0),
|
| | | "FacePic":curPlayer.GetFacePic() if curPlayer else cacheDict.get("FacePic", 0),
|
| | | "FamilyID":curPlayer.GetFamilyID() if curPlayer else cacheDict.get("FacmilyID", 0),
|
| | | "FamilyName":cacheDict.get("FamilyName", ""),
|
| | | "TitleID":cacheDict.get("TitleID", 0),
|
| | | "FightPower":PlayerControl.GetFightPower(curPlayer),
|
| | | "FightPower":PlayerControl.GetFightPower(curPlayer) if curPlayer else cacheDict.get("FightPower", 0),
|
| | | "EquipShowSwitch":cacheDict.get("EquipShowSwitch", 0),
|
| | | "EquipShowID":cacheDict.get("EquipShowID", []),
|
| | | "ServerGroupID":PlayerControl.GetPlayerServerGroupID(curPlayer),
|
| | | "ServerGroupID":PlayerControl.GetPlayerServerGroupID(curPlayer) if curPlayer else cacheDict.get("ServerGroupID", GameWorld.GetServerGroupID()),
|
| | | }
|
| | | return cacheBase
|
| | |
|
| | |
| | | @param equipClassLV: 指定查看某一阶装备信息
|
| | | @param isShort: 是否查看简短信息
|
| | | '''
|
| | | if not curPlayer:
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.DebugLog("查看玩家: tagPlayerID=%s,equipClassLV=%s,isShort=%s" % (tagPlayerID, equipClassLV, isShort), playerID)
|
| | | # 在跨服服务器查询
|
| | |
| | | return
|
| | |
|
| | | def Sync_PlayerShortInfo(curPlayer, curCache):
|
| | | if not curCache:
|
| | | PlayerControl.NotifyCode(curPlayer, "ViewPlayer_OffLine")
|
| | | return
|
| | | answerPack = ChPyNetSendPack.tagGCAnswerPlayerShortInfo()
|
| | | answerPack.Clear()
|
| | | if not curCache:
|
| | | # 实在找不到设置为初始化数据
|
| | | answerPack.PlayerID = curCache.PlayerID
|
| | | answerPack.PlayerName = ""
|
| | | answerPack.Job = 1
|
| | | answerPack.LV = 1
|
| | | answerPack.RealmLV = 1
|
| | | answerPack.OnlineType = ChConfig.Def_Offline
|
| | | answerPack.ServerGroupID = 0
|
| | | answerPack.Face = 0
|
| | | answerPack.FacePic = 0
|
| | | cacheDict = GetCachePropDataDict(curCache)
|
| | | answerPack.PlayerID = curCache.PlayerID
|
| | | answerPack.PlayerName = cacheDict["Name"]
|
| | | answerPack.Job = cacheDict["Job"]
|
| | | answerPack.LV = cacheDict["LV"]
|
| | | answerPack.RealmLV = cacheDict["RealmLV"]
|
| | | answerPack.OnlineType = ChConfig.Def_Offline
|
| | | answerPack.Face = cacheDict.get("Face", 0)
|
| | | answerPack.FacePic = cacheDict.get("FacePic", 0)
|
| | | |
| | | if GameWorld.IsCrossServer():
|
| | | answerPack.ServerGroupID = cacheDict.get("ServerGroupID", 0)
|
| | | else:
|
| | | cacheDict = GetCachePropDataDict(curCache)
|
| | | answerPack.PlayerID = curCache.PlayerID
|
| | | answerPack.PlayerName = cacheDict["Name"]
|
| | | answerPack.Job = cacheDict["Job"]
|
| | | answerPack.LV = cacheDict["LV"]
|
| | | answerPack.RealmLV = cacheDict["RealmLV"]
|
| | | answerPack.OnlineType = ChConfig.Def_Offline
|
| | | answerPack.Face = cacheDict.get("Face", 0)
|
| | | answerPack.FacePic = cacheDict.get("FacePic", 0)
|
| | | |
| | | if GameWorld.IsCrossServer():
|
| | | answerPack.ServerGroupID = cacheDict.get("ServerGroupID", 0)
|
| | | else:
|
| | | answerPack.ServerGroupID = GameWorld.GetServerGroupID()
|
| | | answerPack.ServerGroupID = GameWorld.GetServerGroupID()
|
| | | NetPackCommon.SendFakePack(curPlayer, answerPack)
|
| | | return
|
| | |
|