| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 10 购买商城物品 #tagCMBuyItem
|
| | |
|
| | | class tagCMBuyItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("BuyItemIndex", c_ushort), #购买的物品索引
|
| | | ("BuyCount", c_int), #购买数量
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x10
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x10
|
| | | self.BuyItemIndex = 0
|
| | | self.BuyCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMBuyItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 10 购买商城物品 //tagCMBuyItem:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | BuyItemIndex:%d,
|
| | | BuyCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.BuyItemIndex,
|
| | | self.BuyCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMBuyItem=tagCMBuyItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMBuyItem.Cmd,m_NAtagCMBuyItem.SubCmd))] = m_NAtagCMBuyItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 07 过期物品续费 #tagCMItemRenew
|
| | |
|
| | | class tagCMItemRenew(Structure):
|