| | |
| | |
|
| | | import GameWorld
|
| | | import GameWorship
|
| | | import GameXiangong
|
| | | import PlayerControl
|
| | | import NetPackCommon
|
| | | import GameWorldArena
|
| | |
| | | return True
|
| | |
|
| | | if PyDataManager.GetDBPyFuncTeamManager().IsTeamPlayer(playerID):
|
| | | return True
|
| | | |
| | | if GameXiangong.IsXiangongPlayer(playerID):
|
| | | return True
|
| | |
|
| | | if GameWorldSkyTower.IsSkyTowerPassPlayer(playerID):
|
| | |
| | | curCache.PropDataDict = eval(curCache.PropData)
|
| | | return curCache.PropDataDict
|
| | |
|
| | | def GetShotCahceDict(playerID, withEquip=False):
|
| | | def GetShotCacheDict(playerID, *exAttrs):
|
| | | ## 获取玩家简短的缓存信息字典
|
| | | viewCache = FindViewCache(playerID)
|
| | | cacheDict = GetCachePropDataDict(viewCache)
|
| | | if not cacheDict:
|
| | | return {}
|
| | | olMgr = ChPlayer.GetOnlinePlayerMgr()
|
| | | shotCacheDict = {
|
| | | "PlayerID":playerID, |
| | | "Name":cacheDict["Name"],
|
| | | "Job":cacheDict["Job"],
|
| | | "LV":cacheDict["LV"],
|
| | | "RealmLV":cacheDict["RealmLV"],
|
| | | "FightPower":cacheDict["FightPower"],
|
| | | "ServerID":GameWorld.GetAccIDServerID(cacheDict["AccID"]),
|
| | | "OfflineValue":olMgr.GetOfflineValue(playerID, viewCache)
|
| | | }
|
| | | if withEquip:
|
| | | shotCacheDict.update({
|
| | | "TitleID":cacheDict.get("TitleID", 0),
|
| | | "EquipShowSwitch":cacheDict.get("EquipShowSwitch", 0),
|
| | | "EquipShowID":cacheDict.get("EquipShowID", 0),
|
| | | })
|
| | | for attrName in exAttrs:
|
| | | if attrName == "PlayerID":
|
| | | shotCacheDict["PlayerID"] = playerID
|
| | | elif attrName == "ServerID":
|
| | | shotCacheDict["ServerID"] = GameWorld.GetAccIDServerID(cacheDict["AccID"])
|
| | | elif attrName == "OfflineValue":
|
| | | olMgr = ChPlayer.GetOnlinePlayerMgr()
|
| | | shotCacheDict["OfflineValue"] = olMgr.GetOfflineValue(playerID, viewCache)
|
| | | # 附带外观模型展示相关
|
| | | elif attrName == "Model":
|
| | | shotCacheDict.update({
|
| | | "TitleID":cacheDict.get("TitleID", 0),
|
| | | "EquipShowSwitch":cacheDict.get("EquipShowSwitch", 0),
|
| | | "EquipShowID":cacheDict.get("EquipShowID", []),
|
| | | })
|
| | | elif attrName in cacheDict:
|
| | | shotCacheDict[attrName] = cacheDict[attrName]
|
| | | return shotCacheDict
|
| | |
|
| | | def GetSyncCrossCacheBase(curPlayer):
|
| | |
| | | "Job":curPlayer.GetJob(),
|
| | | "VIPLV":curPlayer.GetVIPLv(),
|
| | | "Name":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
|
| | | "Face":curPlayer.GetFace(),
|
| | | "FacePic":curPlayer.GetFacePic(),
|
| | | "FamilyID":curPlayer.GetFamilyID(),
|
| | | "FamilyName":cacheDict.get("FamilyName", ""),
|
| | | "TitleID":cacheDict.get("TitleID", 0),
|
| | | "FightPower":PlayerControl.GetFightPower(curPlayer),
|
| | | "EquipShowSwitch":cacheDict.get("EquipShowSwitch", 0),
|
| | | "EquipShowID":cacheDict.get("EquipShowID", 0),
|
| | | "EquipShowID":cacheDict.get("EquipShowID", []),
|
| | | "ServerGroupID":PlayerControl.GetPlayerServerGroupID(curPlayer),
|
| | | }
|
| | | return cacheBase
|
| | |
| | | answerPack.OnlineType = ChConfig.Def_Offline
|
| | | answerPack.ServerGroupID = 0
|
| | | answerPack.Face = 0
|
| | | answerPack.FacePic = 0
|
| | | else:
|
| | | cacheDict = GetCachePropDataDict(curCache)
|
| | | answerPack.PlayerID = clientPack.PlayerID
|
| | |
| | | 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)
|
| | |
| | | answerPack.IsInTeam = tagPlayer.GetTeamID() > 0
|
| | | answerPack.ServerGroupID = PlayerControl.GetPlayerServerGroupID(tagPlayer)
|
| | | answerPack.Face = tagPlayer.GetFace()
|
| | | answerPack.FacePic = tagPlayer.GetFacePic()
|
| | |
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | NetPackCommon.SendFakePack(curPlayer, answerPack)
|