|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #------------------------------------------------------ | 
|---|
|  |  |  | # A2 30 设置聊天气泡框 #tagCMSetChatBubbleBox | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagCMSetChatBubbleBox(Structure): | 
|---|
|  |  |  | _pack_ = 1 | 
|---|
|  |  |  | _fields_ = [ | 
|---|
|  |  |  | ("Cmd", c_ubyte), | 
|---|
|  |  |  | ("SubCmd", c_ubyte), | 
|---|
|  |  |  | ("BubbleBoxType", c_ubyte),    #气泡框类型 | 
|---|
|  |  |  | ] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def __init__(self): | 
|---|
|  |  |  | self.Clear() | 
|---|
|  |  |  | self.Cmd = 0xA2 | 
|---|
|  |  |  | self.SubCmd = 0x30 | 
|---|
|  |  |  | 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 = 0xA2 | 
|---|
|  |  |  | self.SubCmd = 0x30 | 
|---|
|  |  |  | self.BubbleBoxType = 0 | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetLength(self): | 
|---|
|  |  |  | return sizeof(tagCMSetChatBubbleBox) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetBuffer(self): | 
|---|
|  |  |  | return string_at(addressof(self), self.GetLength()) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OutputString(self): | 
|---|
|  |  |  | DumpString = '''// A2 30 设置聊天气泡框 //tagCMSetChatBubbleBox: | 
|---|
|  |  |  | Cmd:%s, | 
|---|
|  |  |  | SubCmd:%s, | 
|---|
|  |  |  | BubbleBoxType:%d | 
|---|
|  |  |  | '''\ | 
|---|
|  |  |  | %( | 
|---|
|  |  |  | self.Cmd, | 
|---|
|  |  |  | self.SubCmd, | 
|---|
|  |  |  | self.BubbleBoxType | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | return DumpString | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | m_NAtagCMSetChatBubbleBox=tagCMSetChatBubbleBox() | 
|---|
|  |  |  | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSetChatBubbleBox.Cmd,m_NAtagCMSetChatBubbleBox.SubCmd))] = m_NAtagCMSetChatBubbleBox | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #------------------------------------------------------ | 
|---|
|  |  |  | # A2 22 设置引导成功 #tagCMSetGuideOK | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagCMSetGuideOK(Structure): | 
|---|
|  |  |  | 
|---|
|  |  |  | AddonsItemIndexCnt = 0    #(BYTE AddonsItemIndexCnt)// 附加物品在背包中索引个数 | 
|---|
|  |  |  | AddonsItemIndex = list()    #(vector<BYTE> AddonsItemIndex)// 附加物品在背包的索引列表 | 
|---|
|  |  |  | AddonsItemCount = list()    #(vector<BYTE> AddonsItemCount)// 附加物品在背包的索引对应扣除数量列表 | 
|---|
|  |  |  | RateIncreaseItemIndexCnt = 0    #(BYTE RateIncreaseItemIndexCnt)// 提升概率物品在背包中索引个数 | 
|---|
|  |  |  | RateIncreaseItemIndex = list()    #(vector<BYTE> RateIncreaseItemIndex)// 提升概率物品在背包的索引列表 | 
|---|
|  |  |  | data = None | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def __init__(self): | 
|---|
|  |  |  | 
|---|
|  |  |  | for i in range(self.AddonsItemIndexCnt): | 
|---|
|  |  |  | value,_pos=CommFunc.ReadBYTE(_lpData,_pos) | 
|---|
|  |  |  | self.AddonsItemCount.append(value) | 
|---|
|  |  |  | self.RateIncreaseItemIndexCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) | 
|---|
|  |  |  | for i in range(self.RateIncreaseItemIndexCnt): | 
|---|
|  |  |  | value,_pos=CommFunc.ReadBYTE(_lpData,_pos) | 
|---|
|  |  |  | self.RateIncreaseItemIndex.append(value) | 
|---|
|  |  |  | return _pos | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def Clear(self): | 
|---|
|  |  |  | 
|---|
|  |  |  | self.AddonsItemIndexCnt = 0 | 
|---|
|  |  |  | self.AddonsItemIndex = list() | 
|---|
|  |  |  | self.AddonsItemCount = list() | 
|---|
|  |  |  | self.RateIncreaseItemIndexCnt = 0 | 
|---|
|  |  |  | self.RateIncreaseItemIndex = list() | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GetLength(self): | 
|---|
|  |  |  | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 1 * self.AddonsItemIndexCnt | 
|---|
|  |  |  | length += 1 * self.AddonsItemIndexCnt | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 1 * self.RateIncreaseItemIndexCnt | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return length | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.AddonsItemIndex[i]) | 
|---|
|  |  |  | for i in range(self.AddonsItemIndexCnt): | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.AddonsItemCount[i]) | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.RateIncreaseItemIndexCnt) | 
|---|
|  |  |  | for i in range(self.RateIncreaseItemIndexCnt): | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.RateIncreaseItemIndex[i]) | 
|---|
|  |  |  | return data | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OutputString(self): | 
|---|
|  |  |  | 
|---|
|  |  |  | FixedItemIndex:%s, | 
|---|
|  |  |  | AddonsItemIndexCnt:%d, | 
|---|
|  |  |  | AddonsItemIndex:%s, | 
|---|
|  |  |  | AddonsItemCount:%s | 
|---|
|  |  |  | AddonsItemCount:%s, | 
|---|
|  |  |  | RateIncreaseItemIndexCnt:%d, | 
|---|
|  |  |  | RateIncreaseItemIndex:%s | 
|---|
|  |  |  | '''\ | 
|---|
|  |  |  | %( | 
|---|
|  |  |  | self.Head.OutputString(), | 
|---|
|  |  |  | 
|---|
|  |  |  | "...", | 
|---|
|  |  |  | self.AddonsItemIndexCnt, | 
|---|
|  |  |  | "...", | 
|---|
|  |  |  | "...", | 
|---|
|  |  |  | self.RateIncreaseItemIndexCnt, | 
|---|
|  |  |  | "..." | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | return DumpString | 
|---|