| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 C5 装备部位升星 #tagCMEquipPartStarUp
|
| | |
|
| | | class tagCMEquipPartStarUp(Structure):
|
| | | Head = tagHead()
|
| | | EquipPackIndex = 0 #(WORD EquipPackIndex)// 部位格子索引
|
| | | CostEquipCnt = 0 #(BYTE CostEquipCnt)// 装备个数
|
| | | CostEquipIndex = list() #(vector<WORD> CostEquipIndex)// 装备索引
|
| | | CostEquipID = list() #(vector<DWORD> CostEquipID)// 装备物品ID
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0xC5
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.EquipPackIndex,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.CostEquipCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CostEquipCnt):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.CostEquipIndex.append(value)
|
| | | for i in range(self.CostEquipCnt):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.CostEquipID.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0xC5
|
| | | self.EquipPackIndex = 0
|
| | | self.CostEquipCnt = 0
|
| | | self.CostEquipIndex = list()
|
| | | self.CostEquipID = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 1
|
| | | length += 2 * self.CostEquipCnt
|
| | | length += 4 * self.CostEquipCnt
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.EquipPackIndex)
|
| | | data = CommFunc.WriteBYTE(data, self.CostEquipCnt)
|
| | | for i in range(self.CostEquipCnt):
|
| | | data = CommFunc.WriteWORD(data, self.CostEquipIndex[i])
|
| | | for i in range(self.CostEquipCnt):
|
| | | data = CommFunc.WriteDWORD(data, self.CostEquipID[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | EquipPackIndex:%d,
|
| | | CostEquipCnt:%d,
|
| | | CostEquipIndex:%s,
|
| | | CostEquipID:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.EquipPackIndex,
|
| | | self.CostEquipCnt,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMEquipPartStarUp=tagCMEquipPartStarUp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipPartStarUp.Head.Cmd,m_NAtagCMEquipPartStarUp.Head.SubCmd))] = m_NAtagCMEquipPartStarUp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 48 兑换大师等级经验 #tagCMExchangeMasterEXP
|
| | |
|
| | | class tagCMExchangeMasterEXP(Structure):
|