66 【公会】基础主体-服务端(增加称号同步:公会成员A520 A522,排行榜Value2,演武场匹配A922; 修复演武场战斗日志记录json格式错误bug;)
| | |
| | | RealmLV = 0 #(BYTE RealmLV)//境界
|
| | | Face = 0 #(DWORD Face)//基本脸型
|
| | | FacePic = 0 #(DWORD FacePic)//头像框
|
| | | TitleID = 0 #(DWORD TitleID)//称号
|
| | | FightPower = 0 #(DWORD FightPower)//战力,求余亿部分
|
| | | FightPowerEx = 0 #(DWORD FightPowerEx)//战力,整除亿部分
|
| | | ServerID = 0 #(DWORD ServerID)//所属区服ID
|
| | |
| | | self.RealmLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ServerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | |
| | | self.RealmLV = 0
|
| | | self.Face = 0
|
| | | self.FacePic = 0
|
| | | self.TitleID = 0
|
| | | self.FightPower = 0
|
| | | self.FightPowerEx = 0
|
| | | self.ServerID = 0
|
| | |
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | |
|
| | | return length
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.RealmLV)
|
| | | data = CommFunc.WriteDWORD(data, self.Face)
|
| | | data = CommFunc.WriteDWORD(data, self.FacePic)
|
| | | data = CommFunc.WriteDWORD(data, self.TitleID)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPowerEx)
|
| | | data = CommFunc.WriteDWORD(data, self.ServerID)
|
| | |
| | | RealmLV:%d,
|
| | | Face:%d,
|
| | | FacePic:%d,
|
| | | TitleID:%d,
|
| | | FightPower:%d,
|
| | | FightPowerEx:%d,
|
| | | ServerID:%d,
|
| | |
| | | self.RealmLV,
|
| | | self.Face,
|
| | | self.FacePic,
|
| | | self.TitleID,
|
| | | self.FightPower,
|
| | | self.FightPowerEx,
|
| | | self.ServerID,
|
| | |
| | | RealmLV = 0 #(BYTE RealmLV)//境界
|
| | | Face = 0 #(DWORD Face)//基本脸型
|
| | | FacePic = 0 #(DWORD FacePic)//头像框
|
| | | TitleID = 0 #(DWORD TitleID)//称号
|
| | | FightPower = 0 #(DWORD FightPower)//战力,求余亿部分
|
| | | FightPowerEx = 0 #(DWORD FightPowerEx)//战力,整除亿部分
|
| | | ServerID = 0 #(DWORD ServerID)//所属区服ID
|
| | |
| | | self.RealmLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ServerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | |
| | | self.RealmLV = 0
|
| | | self.Face = 0
|
| | | self.FacePic = 0
|
| | | self.TitleID = 0
|
| | | self.FightPower = 0
|
| | | self.FightPowerEx = 0
|
| | | self.ServerID = 0
|
| | |
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | length += 4
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.RealmLV)
|
| | | data = CommFunc.WriteDWORD(data, self.Face)
|
| | | data = CommFunc.WriteDWORD(data, self.FacePic)
|
| | | data = CommFunc.WriteDWORD(data, self.TitleID)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.FightPowerEx)
|
| | | data = CommFunc.WriteDWORD(data, self.ServerID)
|
| | |
| | | RealmLV:%d,
|
| | | Face:%d,
|
| | | FacePic:%d,
|
| | | TitleID:%d,
|
| | | FightPower:%d,
|
| | | FightPowerEx:%d,
|
| | | ServerID:%d,
|
| | |
| | | self.RealmLV,
|
| | | self.Face,
|
| | | self.FacePic,
|
| | | self.TitleID,
|
| | | self.FightPower,
|
| | | self.FightPowerEx,
|
| | | self.ServerID,
|
| | |
| | | FightPowerEx = 0 #(DWORD FightPowerEx)//战力整除亿部分
|
| | | Face = 0 #(DWORD Face)//基本脸型
|
| | | FacePic = 0 #(DWORD FacePic)//头像框
|
| | | TitleID = 0 #(DWORD TitleID)//称号
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.FightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.FacePic,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.TitleID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.FightPowerEx = 0
|
| | | self.Face = 0
|
| | | self.FacePic = 0
|
| | | self.TitleID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 4
|
| | | length += 33
|
| | | length += 2
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
| | | data = CommFunc.WriteDWORD(data, self.FightPowerEx)
|
| | | data = CommFunc.WriteDWORD(data, self.Face)
|
| | | data = CommFunc.WriteDWORD(data, self.FacePic)
|
| | | data = CommFunc.WriteDWORD(data, self.TitleID)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | FightPower:%d,
|
| | | FightPowerEx:%d,
|
| | | Face:%d,
|
| | | FacePic:%d
|
| | | FacePic:%d,
|
| | | TitleID:%d
|
| | | '''\
|
| | | %(
|
| | | self.PlayerID,
|
| | |
| | | self.FightPower,
|
| | | self.FightPowerEx,
|
| | | self.Face,
|
| | | self.FacePic
|
| | | self.FacePic,
|
| | | self.TitleID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | |
|
| | | m_NAtagMCStartEnterCrossServer=tagMCStartEnterCrossServer()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartEnterCrossServer.Cmd,m_NAtagMCStartEnterCrossServer.SubCmd))] = m_NAtagMCStartEnterCrossServer |
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartEnterCrossServer.Cmd,m_NAtagMCStartEnterCrossServer.SubCmd))] = m_NAtagMCStartEnterCrossServer
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # C2 01 跨服服务器间的测试包 #tagSSTest
|
| | |
|
| | | class tagSSTest(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("Data", c_int), #测试
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xC2
|
| | | self.SubCmd = 0x01
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xC2
|
| | | self.SubCmd = 0x01
|
| | | self.Data = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSSTest)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// C2 01 跨服服务器间的测试包 //tagSSTest:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | Data:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Data
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSSTest=tagSSTest()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSSTest.Cmd,m_NAtagSSTest.SubCmd))] = m_NAtagSSTest |
| | |
| | | ('ContribDay', ctypes.c_ulong),
|
| | | ('DonateCntTotal', ctypes.c_ulong),
|
| | | ('DonateCntDay', ctypes.c_ubyte),
|
| | | ('TitleID', ctypes.c_ulong),
|
| | | ('ADOResult', ctypes.c_ulong),
|
| | | ]
|
| | |
|
| | |
| | | self.ContribDay, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.DonateCntTotal, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.DonateCntDay, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.TitleID, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | return self.getLength()
|
| | |
|
| | |
|
| | |
| | | ContribDay = %s,
|
| | | DonateCntTotal = %s,
|
| | | DonateCntDay = %s,
|
| | | TitleID = %s,
|
| | | ADOResult = %s,
|
| | | '''%(
|
| | | self.PlayerID,
|
| | |
| | | self.ContribDay,
|
| | | self.DonateCntTotal,
|
| | | self.DonateCntDay,
|
| | | self.TitleID,
|
| | | self.ADOResult,
|
| | | )
|
| | | return output
|
| | |
| | | self.__dbData = DBStruct.tagDBFamilyMem() if not dbData else dbData
|
| | | return
|
| | |
|
| | | def GetFamily(self): return DBDataMgr.GetFamilyMgr().FindFamily(self.__dbData.FamilyID)
|
| | | def GetPlayerID(self): return self.__dbData.PlayerID
|
| | | def GetFamilyID(self): return self.__dbData.FamilyID
|
| | | def GetJoinTime(self): return self.__dbData.JoinTime
|
| | |
| | | def SetFace(self, face): self.__dbData.Face = face
|
| | | def GetFacePic(self): return self.__dbData.FacePic
|
| | | def SetFacePic(self, facePic): self.__dbData.FacePic = facePic
|
| | | def GetTitleID(self): return self.__dbData.TitleID
|
| | | def SetTitleID(self, titleID): self.__dbData.TitleID = titleID
|
| | | def GetFightPower(self): return self.__dbData.FightPower
|
| | | def GetFightPowerEx(self): return self.__dbData.FightPowerEx
|
| | | def GetFightPowerTotal(self): return self.__dbData.FightPowerEx * ChConfig.Def_PerPointValue + self.__dbData.FightPower
|
| | |
| | | self.SetRealmLV(viewCache.GetRealmLV())
|
| | | self.SetFace(viewCache.GetFace())
|
| | | self.SetFacePic(viewCache.GetFacePic())
|
| | | self.SetTitleID(viewCache.GetTitleID())
|
| | | self.SetServerID(viewCache.GetServerID())
|
| | | fpChange = False
|
| | | fightPowerTotal = viewCache.GetFightPowerTotal()
|
| | | if self.GetFightPowerTotal() < fightPowerTotal:
|
| | | self.SetFightPowerTotal(fightPowerTotal)
|
| | | fpChange = True
|
| | | family = self.GetFamily()
|
| | | if family:
|
| | | family.SetMemFightPowerChange()
|
| | | return fpChange
|
| | |
|
| | | def RefreshMember(self, curPlayer):
|
| | |
| | | self.SetRealmLV(curPlayer.GetOfficialRank())
|
| | | self.SetFace(curPlayer.GetFace())
|
| | | self.SetFacePic(curPlayer.GetFacePic())
|
| | | self.SetTitleID(PlayerControl.GetTitleID(curPlayer))
|
| | | self.SetServerID(GameWorld.GetPlayerServerID(curPlayer))
|
| | | fightPowerTotal = PlayerControl.GetFightPower(curPlayer)
|
| | | fpChange = self.GetFightPowerTotal() != fightPowerTotal
|
| | | self.SetFightPowerTotal(fightPowerTotal)
|
| | | if fpChange:
|
| | | family = self.GetFamily()
|
| | | if family:
|
| | | family.SetMemFightPowerChange()
|
| | | return fpChange
|
| | |
|
| | | class Family():
|
| | |
| | | mem = FamilyMem()
|
| | | return mem
|
| | |
|
| | | def RefreshFamilyMember(self, curPlayer):
|
| | | ## 刷新在线成员信息
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if self.GetID() != familyID:
|
| | | return
|
| | | member = self.FindMember(playerID)
|
| | | if not member:
|
| | | return
|
| | | if member.RefreshMember(curPlayer):
|
| | | self.__memFightPowerChange = True
|
| | | return
|
| | | |
| | | def SetMemFightPowerChange(self): self.__memFightPowerChange = True
|
| | | def RefrshFightPowerTotal(self, checkChange=False):
|
| | | ## 刷新总战力
|
| | | if checkChange and self.__memFightPowerChange == False: # 默认None,首次必刷新
|
| | |
| | | @param dbData: 实例对应绑定的dbData
|
| | | @return: 成功返回实例对象,失败返回None
|
| | | '''
|
| | | dataToJson = False
|
| | | # 如果需要 dataToJson,可根据 RecType 在这里处理
|
| | | dataToJson = True
|
| | | # 默认使用 dataToJson,如果不需要的可根据 RecType 在这里处理
|
| | | if dbData.RecType in []:
|
| | | dataToJson = True
|
| | | dataToJson = False
|
| | | recData = GameRecData(dbData, dataToJson)
|
| | | self.__dataList.append(recData)
|
| | |
|
| | |
| | |
|
| | | # 被击方
|
| | | if tagPlayerID < ShareDefine.RealPlayerIDStart:
|
| | | GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
|
| | | #GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
|
| | | return
|
| | |
|
| | | # 以战斗记录作为最新积分的更新记录,支持离线玩家上线后更新最新积分
|
| | |
| | | matchInfo.FacePic = viewCache.GetFacePic()
|
| | | matchInfo.FightPower = viewCache.GetFightPower()
|
| | | matchInfo.FightPowerEx = viewCache.GetFightPowerEx()
|
| | | matchInfo.TitleID = viewCache.GetTitleID()
|
| | | else:
|
| | | matchInfo.PlayerName = "p%s" % matchID
|
| | | clientPack.MatchList.append(matchInfo)
|
| | |
| | |
|
| | | import GameWorld
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | |
| | | #
|
| | | # return True
|
| | |
|
| | | def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, value1=None, value2=0, autoSort=False, **kwargs):
|
| | | def UpdatePlayerBillboard(curPlayer, bType, cmpValue, cmpValue2=0, cmpValue3=0, autoSort=False, **kwargs):
|
| | | ## 更新玩家排行榜
|
| | |
|
| | | #if not cmpValue and not cmpValue2 and not cmpValue3:
|
| | |
| | | playerID = curPlayer.GetID()
|
| | | playerName = curPlayer.GetPlayerName()
|
| | | playerOpInfo = GetBillboardOperateInfo(curPlayer)
|
| | | if value1 == None:
|
| | | value1 = curPlayer.GetOfficialRank()
|
| | | value1 = curPlayer.GetOfficialRank()
|
| | | value2 = PlayerControl.GetTitleID(curPlayer)
|
| | | kwargs["value3"] = curPlayer.GetFace()
|
| | | kwargs["value4"] = curPlayer.GetFacePic()
|
| | | kwargs["value5"] = curPlayer.GetModelMark()
|
| | |
| | |
|
| | | ## 获取佩戴的称号ID
|
| | | def GetTitleID(curPlayer): return curPlayer.GetExAttr3()
|
| | | def SetTitleID(curPlayer, titleID): curPlayer.SetExAttr3(titleID, False, False)
|
| | | def SetTitleID(curPlayer, titleID):
|
| | | curPlayer.SetExAttr3(titleID, False, False)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | ## 协助目标玩家ID
|
| | | def GetAssistTagPlayerID(curPlayer): return 0
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import PlayerFamily
|
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import ChPyNetSendPack
|
| | |
| | | randFace = random.choice(defaultFaceIDList) if defaultFaceIDList else 0
|
| | | curPlayer.SetFace(randFace)
|
| | | GameWorld.DebugLog("玩家佩戴的头像被删除,随机重置默认头像! randFace=%s" % randFace, playerID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | |
|
| | | if isRefreshAttr:
|
| | | RefreshFaceAttr(curPlayer)
|
| | |
| | | return
|
| | | GameWorld.DebugLog("头像幻化! faceID=%s" % (faceID), playerID)
|
| | | curPlayer.SetFace(faceID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | def OnFaceStarUP(curPlayer, faceID):
|
| | |
| | | randFacePic = random.choice(defaultFacePicIDList) if defaultFacePicIDList else 0
|
| | | curPlayer.SetFacePic(randFacePic)
|
| | | GameWorld.DebugLog("玩家佩戴的头像框过期,随机重置默认头像框! randFacePic=%s" % randFacePic, playerID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | |
|
| | | if isRefreshAttr:
|
| | | RefreshFacePicAttr(curPlayer)
|
| | |
| | | return
|
| | | GameWorld.DebugLog("头像框幻化! facePicID=%s" % (facePicID), playerID)
|
| | | curPlayer.SetFacePic(facePicID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | def OnFacePicStarUP(curPlayer, facePicID):
|
| | |
| | | PlayerFamilyEmblem.CheckExpireEmblem()
|
| | | return
|
| | |
|
| | | def RefreshFamilyMember(curPlayer):
|
| | | ## 玩家成员相关属性变更时同步更新家族成员信息
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if not familyID:
|
| | | return
|
| | | familyMgr = DBDataMgr.GetFamilyMgr()
|
| | | family = familyMgr.FindFamily(familyID)
|
| | | if not family:
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | member = family.FindMember(playerID)
|
| | | if not member:
|
| | | return
|
| | | member.RefreshMember(curPlayer)
|
| | | return
|
| | |
|
| | | #// A6 04 创建家族 #tagCMCreateFamily
|
| | | #
|
| | | #struct tagCMCreateFamily
|
| | |
| | | memInfo.RealmLV = member.GetRealmLV()
|
| | | memInfo.Face = member.GetFace()
|
| | | memInfo.FacePic = member.GetFacePic()
|
| | | memInfo.TitleID = member.GetTitleID()
|
| | | memInfo.FightPower = member.GetFightPower()
|
| | | memInfo.FightPowerEx = member.GetFightPowerEx()
|
| | | memInfo.FmLV = member.GetFmLV()
|
| | |
| | | reqInfo.RealmLV = viewCache.GetRealmLV()
|
| | | reqInfo.Face = viewCache.GetFace()
|
| | | reqInfo.FacePic = viewCache.GetFacePic()
|
| | | reqInfo.TitleID = viewCache.GetTitleID()
|
| | | reqInfo.FightPower = viewCache.GetFightPower()
|
| | | reqInfo.FightPowerEx = viewCache.GetFightPowerEx()
|
| | | reqInfo.ServerID = viewCache.GetServerID()
|
| | |
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerFamily
|
| | | import PlayerGubao
|
| | | import PlayerHero
|
| | | import PlayerHJG
|
| | |
| | | else:
|
| | | GameWorld.DebugLog("主阵容没有在战斗中,不需要处理", playerID)
|
| | |
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer) # 更新公会
|
| | | # 更新排行榜
|
| | |
|
| | | return
|
| | |
| | | curCache.SetFace(curPlayer.GetFace())
|
| | | curCache.SetFacePic(curPlayer.GetFacePic())
|
| | | curCache.SetModelMark(curPlayer.GetModelMark())
|
| | | curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
|
| | | curCache.SetFamilyID(familyID)
|
| | | curCache.SetFamilyName(family.GetName() if family else "")
|
| | | curCache.SetFamilyEmblemID(family.GetEmblemID() if family else 0)
|
| | | curCache.SetFamilyEmblemWord(family.GetEmblemWord() if family else "")
|
| | | curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
|
| | | curCache.SetFightPowerTotal(PlayerControl.GetFightPower(curPlayer))
|
| | | curCache.SetServerID(GameWorld.GetPlayerServerID(curPlayer))
|
| | | if isOffline:
|
| | |
| | |
|
| | | # 其他
|
| | |
|
| | | plusDict= {"Equip":equipDict, "Lineup":lineupDict}
|
| | | plusDict = {"Equip":equipDict, "Lineup":lineupDict}
|
| | | curCache.SetPlusDict(plusDict)
|
| | |
|
| | | return curCache
|
| | |
| | | curCache.SetFace(dbPlayer.Face)
|
| | | curCache.SetFacePic(dbPlayer.FacePic)
|
| | | curCache.SetModelMark(dbPlayer.ModelMark)
|
| | | curCache.SetTitleID(dbPlayer.ExAttr3)
|
| | | curCache.SetFamilyID(familyID)
|
| | | family = DBDataMgr.GetFamilyMgr().FindFamily(familyID) if familyID else None
|
| | | curCache.SetFamilyName(family.GetName() if family else "")
|
| | | curCache.SetFamilyEmblemID(family.GetEmblemID() if family else 0)
|
| | | curCache.SetFamilyEmblemWord(family.GetEmblemWord() if family else "")
|
| | | #curCache.SetTitleID(PlayerControl.GetTitleID(curPlayer))
|
| | | curCache.SetFightPowerTotal(dbPlayer.FightPowerEx * ChConfig.Def_PerPointValue + dbPlayer.FightPower)
|
| | | curCache.SetServerID(GameWorld.GetAccIDServerID(dbPlayer.AccID))
|
| | | curCache.SetOffTime(GameWorld.ChangeTimeStrToNum(dbPlayer.LogoffTime) if dbPlayer.LogoffTime else 0)
|
| | |
| | | "RealmLV" : curCache.GetRealmLV(),
|
| | | "Face" : curCache.GetFace(),
|
| | | "FacePic" : curCache.GetFacePic(),
|
| | | "TitleID" : curCache.GetTitleID(),
|
| | | "ModelMark" : curCache.GetModelMark(),
|
| | | "FightPower" : curCache.GetFightPowerTotal(),
|
| | | "PlusData" : curCache.GetPlusDict(),
|
| | |
| | | curCache.SetRealmLV(robotInfo.get("RealmLV", 0))
|
| | | curCache.SetFace(robotInfo.get("Face", 0))
|
| | | curCache.SetFacePic(robotInfo.get("FacePic", 0))
|
| | | curCache.SetTitleID(robotInfo.get("TitleID", 0))
|
| | | curCache.SetModelMark(robotInfo.get("ModelMark", 0))
|
| | | #机器人暂定没有仙盟、称号
|
| | | #curCache.SetFamilyID(familyID)
|
| | |
| | | ('ContribDay', ctypes.c_ulong),
|
| | | ('DonateCntTotal', ctypes.c_ulong),
|
| | | ('DonateCntDay', ctypes.c_ubyte),
|
| | | ('TitleID', ctypes.c_ulong),
|
| | | ('ADOResult', ctypes.c_ulong),
|
| | | ]
|
| | |
|
| | |
| | | self.ContribDay, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.DonateCntTotal, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.DonateCntDay, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.TitleID, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | return self.getLength()
|
| | |
|
| | |
|
| | |
| | | rec[u'ContribDay'] = self.ContribDay
|
| | | rec[u'DonateCntTotal'] = self.DonateCntTotal
|
| | | rec[u'DonateCntDay'] = self.DonateCntDay
|
| | | rec[u'TitleID'] = self.TitleID
|
| | | return rec
|
| | |
|
| | | def readRecord(self, rec):
|
| | |
| | | self.ContribDay = rec.get(u'ContribDay', 0)
|
| | | self.DonateCntTotal = rec.get(u'DonateCntTotal', 0)
|
| | | self.DonateCntDay = rec.get(u'DonateCntDay', 0)
|
| | | self.TitleID = rec.get(u'TitleID', 0)
|
| | |
|
| | | def adoLoad(self, collection):
|
| | | '''使用KEY查找并读取'''
|
| | |
| | | ContribDay = %s,
|
| | | DonateCntTotal = %s,
|
| | | DonateCntDay = %s,
|
| | | TitleID = %s,
|
| | | ADOResult = %s,
|
| | | '''%(
|
| | | self.PlayerID,
|
| | |
| | | self.ContribDay,
|
| | | self.DonateCntTotal,
|
| | | self.DonateCntDay,
|
| | | self.TitleID,
|
| | | self.ADOResult,
|
| | | )
|
| | | return output
|
| | |
|
| | | def dumpString(self):
|
| | | output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
|
| | | output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
|
| | | self.PlayerID,
|
| | | self.FamilyID,
|
| | | self.JoinTime,
|
| | |
| | | self.ContribDay,
|
| | | self.DonateCntTotal,
|
| | | self.DonateCntDay,
|
| | | self.TitleID,
|
| | | )
|
| | | return output
|
| | |
|
| | |
| | | for i in xrange(0, recCnt):
|
| | | rec.clear()
|
| | | readLen = rec.readData(data, pos, len(data))
|
| | | rec.dumpString()
|
| | | if -1 == readLen:
|
| | | mylog.error('%s.%s readData failed, index = %s'%(self.__class__.__name_, inspect.stack()[0][3], i) )
|
| | | raise CommonDefine.ShortBuf(collectionName) #如果读取出错,后面全错了
|