| | |
| | | import ChPyNetSendPack
|
| | | import IpyGameDataPY
|
| | | import IPY_GameWorld
|
| | | import PlayerOnline
|
| | | import PlayerPreset
|
| | | import PlayerBeauty
|
| | | import PlayerGubao
|
| | | import ShareDefine
|
| | | import TurnAttack
|
| | | import DBDataMgr
|
| | |
| | |
|
| | | return curCache
|
| | |
|
| | | #def ResetCacheUpdTickByPresetSwitch(curPlayer, batPresetID):
|
| | | # for batPresetType in ChConfig.MapDefBatPresetTypeDict.values():
|
| | | # if batPresetID == PlayerPreset.GetBatPresetID(curPlayer, batPresetType):
|
| | | # curPlayer.SetDict(Key_UpdViewCacheTick, 0)
|
| | | # GameWorld.DebugLogEx("功能战斗缓存用到该流派预设,重置缓存刷新CD! batPresetType=%s,batPresetID=%s", batPresetType, batPresetID)
|
| | | # break
|
| | | # return
|
| | |
|
| | | def __CheckUpdViewCache(playerID):
|
| | | if playerID < ShareDefine.RealPlayerIDStart:
|
| | | return
|
| | |
| | | continue
|
| | | equipDict["%s" % equipIndex] = {"ItemID":curEquip.GetItemTypeID(), "UserData":curEquip.GetUserData()}
|
| | |
|
| | | # 阵容
|
| | | lineupDict = {}
|
| | | for lineupID in ShareDefine.LineupList:
|
| | | lineupInfo = TurnAttack.GetPlayerLineupInfo(curPlayer, lineupID)
|
| | | if not lineupInfo:
|
| | | continue
|
| | | lineupDict["%s" % lineupID] = lineupInfo
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | |
|
| | | # 其他
|
| | | # 预设、阵容
|
| | | batPresetDict = {} # 战斗预设方案组合 {"战斗功能预设":{"功能方案预设":功能预设ID, ...}, ...}
|
| | | lineupDict, mgPresetDict = {}, {}
|
| | | for batPresetType in ShareDefine.NeedCacheBatPresetList:
|
| | | batPresetID = PlayerPreset.GetBatPresetID(curPlayer, batPresetType)
|
| | | #武将方案包含在 lineupInfo 里了,所以不用再取武将预设方案
|
| | | #heroPresetID = PlayerPreset.GetFuncPresetID(curPlayer, batPresetID, ShareDefine.FuncPreset_Hero)
|
| | | mgPresetID = PlayerPreset.GetFuncPresetID(curPlayer, batPresetID, ShareDefine.FuncPreset_Mingge)
|
| | | |
| | | # 战斗预设方案组合 {"战斗功能预设":{"功能方案预设":功能预设ID, ...}, ...}
|
| | | batPresetDict["%s" % batPresetType] = {str(ShareDefine.FuncPreset_Battle):batPresetID,
|
| | | str(ShareDefine.FuncPreset_Mingge):mgPresetID,
|
| | | }
|
| | | |
| | | lineupInfo = TurnAttack.GetPlayerLineupInfo(curPlayer, batPresetType)
|
| | | if lineupInfo:
|
| | | batPresetID = lineupInfo.get("BatPresetID", batPresetID)
|
| | | if str(batPresetID) not in lineupDict:
|
| | | lineupDict["%s" % batPresetID] = lineupInfo
|
| | | |
| | | # 命格方案
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
|
| | | skillLVDict = olPlayer.GetCalcSpecInfo(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
|
| | | mgPresetDict["%s" % mgPresetID] = {"Attr":{str(k):v for k, v in attrDict.items()}, "Skill":skillLVDict}
|
| | | |
| | | # 命格:感悟境界等级、属性、已激活意象效果和层数
|
| | | minggeDict = {"GWLV":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MGGanwuLV), "Preset":mgPresetDict}
|
| | |
|
| | | plusDict = {"Equip":equipDict, "Lineup":lineupDict}
|
| | | # 古宝:数量、属性
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Gubao)
|
| | | actCnt = PlayerGubao.GetGubaoTotalCnt(curPlayer)
|
| | | gubaoDict = {"Cnt":actCnt, "Attr":{str(k):v for k, v in attrDict.items()}}
|
| | | |
| | | # 红颜
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
|
| | | actCnt = PlayerBeauty.GetBeautyActCnt(curPlayer)
|
| | | beautyDict = {"Cnt":actCnt, "Attr":{str(k):v for k, v in attrDict.items()}}
|
| | | |
| | | # 坐骑
|
| | | attrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
|
| | | horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseLV)
|
| | | classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | horseDict = {"LV":horseLV, "ClassLV":classLV, "Attr":{str(k):v for k, v in attrDict.items()}}
|
| | | |
| | | plusDict = {"Equip":equipDict, "BatPreset":batPresetDict, "Lineup":lineupDict, "Mingge":minggeDict, |
| | | "Beauty":beautyDict, "Horse":horseDict, "Gubao":gubaoDict}
|
| | | curCache.SetPlusDict(plusDict)
|
| | |
|
| | | return curCache
|