| | |
| | | #------------------------------------------------------
|
| | | # A3 51 寻宝功能信息 #tagMCTreasureInfo
|
| | |
|
| | | class tagMCTreasureWish(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("WishID", c_ushort), # 寻宝物品库中的数据ID,注意不是库ID
|
| | | ("OutCnt", c_ubyte), # 做为心愿物品时已产出次数,有产出过的无法重新选择,未产出的可任意修改选择
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.WishID = 0
|
| | | self.OutCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCTreasureWish)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 51 寻宝功能信息 //tagMCTreasureInfo:
|
| | | WishID:%d,
|
| | | OutCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.WishID,
|
| | | self.OutCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCTreasureGridLimit(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | |
| | | TreasureCntAward = 0 #(DWORD TreasureCntAward)//累计寻宝次数对应奖励领奖状态,按奖励记录索引二进制记录是否已领取
|
| | | GridLimitCnt = 0 #(BYTE GridLimitCnt)
|
| | | GridLimitCntList = list() #(vector<tagMCTreasureGridLimit> GridLimitCntList)//有限制抽取次数的格子次数信息
|
| | | WishCnt = 0 #(BYTE WishCnt)
|
| | | WishList = list() #(vector<tagMCTreasureWish> WishList)//心愿物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temGridLimitCntList = tagMCTreasureGridLimit()
|
| | | _pos = temGridLimitCntList.ReadData(_lpData, _pos)
|
| | | self.GridLimitCntList.append(temGridLimitCntList)
|
| | | self.WishCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.WishCnt):
|
| | | temWishList = tagMCTreasureWish()
|
| | | _pos = temWishList.ReadData(_lpData, _pos)
|
| | | self.WishList.append(temWishList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.TreasureCntAward = 0
|
| | | self.GridLimitCnt = 0
|
| | | self.GridLimitCntList = list()
|
| | | self.WishCnt = 0
|
| | | self.WishList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.GridLimitCnt):
|
| | | length += self.GridLimitCntList[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.WishCnt):
|
| | | length += self.WishList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.GridLimitCnt)
|
| | | for i in range(self.GridLimitCnt):
|
| | | data = CommFunc.WriteString(data, self.GridLimitCntList[i].GetLength(), self.GridLimitCntList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.WishCnt)
|
| | | for i in range(self.WishCnt):
|
| | | data = CommFunc.WriteString(data, self.WishList[i].GetLength(), self.WishList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | FreeCountToday:%d,
|
| | | TreasureCntAward:%d,
|
| | | GridLimitCnt:%d,
|
| | | GridLimitCntList:%s
|
| | | GridLimitCntList:%s,
|
| | | WishCnt:%d,
|
| | | WishList:%s
|
| | | '''\
|
| | | %(
|
| | | self.TreasureType,
|
| | |
| | | self.FreeCountToday,
|
| | | self.TreasureCntAward,
|
| | | self.GridLimitCnt,
|
| | | "...",
|
| | | self.WishCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 31 宿缘信息 #tagSCHeroFatesInfo
|
| | |
|
| | | class tagSCHeroFates(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("FatesID", c_ubyte), # 宿缘ID
|
| | | ("State", c_ubyte), # 宿缘状态:0-未激活;1-已激活已领奖
|
| | | ("FatesLV", c_ubyte), # 宿缘等级,激活时为0级,升级后有升级属性
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.FatesID = 0
|
| | | self.State = 0
|
| | | self.FatesLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCHeroFates)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 31 宿缘信息 //tagSCHeroFatesInfo:
|
| | | FatesID:%d,
|
| | | State:%d,
|
| | | FatesLV:%d
|
| | | '''\
|
| | | %(
|
| | | self.FatesID,
|
| | | self.State,
|
| | | self.FatesLV
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagSCHeroFatesInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | FatesList = list() #(vector<tagSCHeroFates> FatesList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x31
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temFatesList = tagSCHeroFates()
|
| | | _pos = temFatesList.ReadData(_lpData, _pos)
|
| | | self.FatesList.append(temFatesList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x31
|
| | | self.Count = 0
|
| | | self.FatesList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.FatesList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.FatesList[i].GetLength(), self.FatesList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | FatesList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCHeroFatesInfo=tagSCHeroFatesInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCHeroFatesInfo.Head.Cmd,m_NAtagSCHeroFatesInfo.Head.SubCmd))] = m_NAtagSCHeroFatesInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 22 武将信息 #tagSCHeroInfo
|
| | |
|
| | | class tagSCHero(Structure):
|