|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #------------------------------------------------------ | 
|---|
|  |  |  | # AA 12 选择转盘活动物品 #tagCMActTurntableChooseItem | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagCMActTurntableChooseItem(Structure): | 
|---|
|  |  |  | Head = tagHead() | 
|---|
|  |  |  | ActNum = 0    #(BYTE ActNum)// 活动编号 | 
|---|
|  |  |  | GoodItemNumCount = 0    #(BYTE GoodItemNumCount) | 
|---|
|  |  |  | GoodItemNumList = list()    #(vector<BYTE> GoodItemNumList)// 选择的极品物品编号列表 | 
|---|
|  |  |  | SuperItemNumCount = 0    #(BYTE SuperItemNumCount) | 
|---|
|  |  |  | SuperItemNumList = list()    #(vector<BYTE> SuperItemNumList)// 选择的终极物品编号列表 | 
|---|
|  |  |  | data = None | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def __init__(self): | 
|---|
|  |  |  | self.Clear() | 
|---|
|  |  |  | self.Head.Cmd = 0xAA | 
|---|
|  |  |  | self.Head.SubCmd = 0x12 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def ReadData(self, _lpData, _pos=0, _Len=0): | 
|---|
|  |  |  | self.Clear() | 
|---|
|  |  |  | _pos = self.Head.ReadData(_lpData, _pos) | 
|---|
|  |  |  | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) | 
|---|
|  |  |  | self.GoodItemNumCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) | 
|---|
|  |  |  | for i in range(self.GoodItemNumCount): | 
|---|
|  |  |  | value,_pos=CommFunc.ReadBYTE(_lpData,_pos) | 
|---|
|  |  |  | self.GoodItemNumList.append(value) | 
|---|
|  |  |  | self.SuperItemNumCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) | 
|---|
|  |  |  | for i in range(self.SuperItemNumCount): | 
|---|
|  |  |  | value,_pos=CommFunc.ReadBYTE(_lpData,_pos) | 
|---|
|  |  |  | self.SuperItemNumList.append(value) | 
|---|
|  |  |  | return _pos | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def Clear(self): | 
|---|
|  |  |  | self.Head = tagHead() | 
|---|
|  |  |  | self.Head.Clear() | 
|---|
|  |  |  | self.Head.Cmd = 0xAA | 
|---|
|  |  |  | self.Head.SubCmd = 0x12 | 
|---|
|  |  |  | self.ActNum = 0 | 
|---|
|  |  |  | self.GoodItemNumCount = 0 | 
|---|
|  |  |  | self.GoodItemNumList = list() | 
|---|
|  |  |  | self.SuperItemNumCount = 0 | 
|---|
|  |  |  | self.SuperItemNumList = list() | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetLength(self): | 
|---|
|  |  |  | length = 0 | 
|---|
|  |  |  | length += self.Head.GetLength() | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 1 * self.GoodItemNumCount | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 1 * self.SuperItemNumCount | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return length | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetBuffer(self): | 
|---|
|  |  |  | data = '' | 
|---|
|  |  |  | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.ActNum) | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.GoodItemNumCount) | 
|---|
|  |  |  | for i in range(self.GoodItemNumCount): | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.GoodItemNumList[i]) | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.SuperItemNumCount) | 
|---|
|  |  |  | for i in range(self.SuperItemNumCount): | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.SuperItemNumList[i]) | 
|---|
|  |  |  | return data | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OutputString(self): | 
|---|
|  |  |  | DumpString = ''' | 
|---|
|  |  |  | Head:%s, | 
|---|
|  |  |  | ActNum:%d, | 
|---|
|  |  |  | GoodItemNumCount:%d, | 
|---|
|  |  |  | GoodItemNumList:%s, | 
|---|
|  |  |  | SuperItemNumCount:%d, | 
|---|
|  |  |  | SuperItemNumList:%s | 
|---|
|  |  |  | '''\ | 
|---|
|  |  |  | %( | 
|---|
|  |  |  | self.Head.OutputString(), | 
|---|
|  |  |  | self.ActNum, | 
|---|
|  |  |  | self.GoodItemNumCount, | 
|---|
|  |  |  | "...", | 
|---|
|  |  |  | self.SuperItemNumCount, | 
|---|
|  |  |  | "..." | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | return DumpString | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | m_NAtagCMActTurntableChooseItem=tagCMActTurntableChooseItem() | 
|---|
|  |  |  | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActTurntableChooseItem.Head.Cmd,m_NAtagCMActTurntableChooseItem.Head.SubCmd))] = m_NAtagCMActTurntableChooseItem | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #------------------------------------------------------ | 
|---|
|  |  |  | # AA 13 启动转盘 #tagCMActTurntableStart | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagCMActTurntableStart(Structure): | 
|---|
|  |  |  | _pack_ = 1 | 
|---|
|  |  |  | _fields_ = [ | 
|---|
|  |  |  | ("Cmd", c_ubyte), | 
|---|
|  |  |  | ("SubCmd", c_ubyte), | 
|---|
|  |  |  | ("ActNum", c_ubyte),    # 活动编号 | 
|---|
|  |  |  | ] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def __init__(self): | 
|---|
|  |  |  | self.Clear() | 
|---|
|  |  |  | self.Cmd = 0xAA | 
|---|
|  |  |  | self.SubCmd = 0x13 | 
|---|
|  |  |  | 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 = 0xAA | 
|---|
|  |  |  | self.SubCmd = 0x13 | 
|---|
|  |  |  | self.ActNum = 0 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetLength(self): | 
|---|
|  |  |  | return sizeof(tagCMActTurntableStart) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetBuffer(self): | 
|---|
|  |  |  | return string_at(addressof(self), self.GetLength()) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OutputString(self): | 
|---|
|  |  |  | DumpString = '''// AA 13 启动转盘 //tagCMActTurntableStart: | 
|---|
|  |  |  | Cmd:%s, | 
|---|
|  |  |  | SubCmd:%s, | 
|---|
|  |  |  | ActNum:%d | 
|---|
|  |  |  | '''\ | 
|---|
|  |  |  | %( | 
|---|
|  |  |  | self.Cmd, | 
|---|
|  |  |  | self.SubCmd, | 
|---|
|  |  |  | self.ActNum | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | return DumpString | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | m_NAtagCMActTurntableStart=tagCMActTurntableStart() | 
|---|
|  |  |  | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActTurntableStart.Cmd,m_NAtagCMActTurntableStart.SubCmd))] = m_NAtagCMActTurntableStart | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #------------------------------------------------------ | 
|---|
|  |  |  | # AA 07 许愿池活动刷新奖池 #tagCMActWishingRefresh | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagCMActWishingRefresh(Structure): | 
|---|