526 【挑战】PVP群英榜-后端(战斗日志Value1增加存储ServerID;群英榜单10的UserData增加Json格式存储FightPower;)
| | |
| | | import IpyGameDataPY
|
| | | import DBDataMgr
|
| | | import CommFunc
|
| | | import DBComm
|
| | |
|
| | | import json
|
| | | import time
|
| | |
| | |
|
| | | def __init__(self, dbData=None):
|
| | | self.__dbData = DBStruct.tagDBBillboard() if not dbData else dbData
|
| | | self.__dataDict = DBComm.UserDataDict(self.__dbData, "UserData", "DataLen", True)
|
| | | return
|
| | |
|
| | | def GetType(self): return self.__dbData.BillboardType
|
| | |
| | | def SetCmpValue3(self, cmpValue3): self.__dbData.CmpValue3 = cmpValue3
|
| | | def GetTime(self): return self.__dbData.Time
|
| | | def SetTime(self, updTime): self.__dbData.Time = updTime
|
| | | def GetUserData(self): return self.__dbData.UserData
|
| | | def SetUserData(self, userData):
|
| | | if not isinstance(userData, str):
|
| | | if isinstance(userData, dict) or isinstance(userData, list):
|
| | | userData = json.dumps(userData, ensure_ascii=False)
|
| | | else:
|
| | | userData = ""
|
| | | userData = userData.replace(" ", "")
|
| | | self.__dbData.UserData = userData
|
| | | self.__dbData.DataLen = len(self.__dbData.UserData)
|
| | | return
|
| | | def GetUserDict(self): return self.__dataDict.GetData()
|
| | | def GetUserData(self): return self.__dataDict.ToString()
|
| | | def SetUserData(self, value): self.__dataDict.SetData(value)
|
| | | def GetBuffer(self): return self.__dbData.getBuffer()
|
| | | def Clear(self): return self.__dbData.clear()
|
| | | def Copy(self, setType=None):
|
| | |
| | | RecAtkType_Atk = 1 # 发起攻击
|
| | | RecAtkType_Def = 2 # 被攻击的
|
| | |
|
| | | def GetRecServerID(recData): return recData.GetValue1() # 目标ServerID
|
| | | def SetRecServerID(recData, serverID): return recData.SetValue1(serverID)
|
| | | def GetRecAtkType(recData): return recData.GetValue2() # 攻击类型 1-发起攻击的,2-被攻击的
|
| | | def SetRecAtkType(recData, atkType): return recData.SetValue2(atkType)
|
| | | def GetRecTagPlayerID(recData): return recData.GetValue3() # 相对攻击类型的目标玩家ID
|
| | |
| | | SetRecAtkType(recData, RecAtkType_Atk)
|
| | | SetRecTagPlayerID(recData, tagPlayerID)
|
| | | SetRecIsWin(recData, isWin)
|
| | | SetRecServerID(recData, tagViewCache.GetServerID() if tagViewCache else 0)
|
| | | SetRecFace(recData, tagViewCache.GetFace() if tagViewCache else 0)
|
| | | SetRecFacePic(recData, tagViewCache.GetFacePic() if tagViewCache else 0)
|
| | | SetRecRealmLV(recData, tagViewCache.GetRealmLV() if tagViewCache else 1)
|
| | |
| | | SetRecAtkType(recData, RecAtkType_Def)
|
| | | SetRecTagPlayerID(recData, playerID)
|
| | | SetRecIsWin(recData, not isWin)
|
| | | SetRecServerID(recData, curPlayer.GetServerID())
|
| | | SetRecFace(recData, curPlayer.GetFace())
|
| | | SetRecFacePic(recData, curPlayer.GetFacePic())
|
| | | SetRecRealmLV(recData, curPlayer.GetOfficialRank())
|
| | |
| | | billData.SetValue4(curCache.GetFacePic())
|
| | | billData.SetValue5(curCache.GetModelMark())
|
| | | billData.SetValue6(curCache.GetEquipShowSwitch())
|
| | | userDict = billData.GetUserDict()
|
| | | userDict.update({"FightPower":curCache.GetFightPowerTotal()})
|
| | | return
|
| | |
|
| | | def UpdateBillboardLayer(dataID, billboardType, cmpValue, groupValue1=0, autoSort=True):
|