| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 74 购买次数礼包活动信息 #tagMCActBuyCountGiftInfo
|
| | |
|
| | | class tagMCActBuyCountGiftItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("ItemCount", c_ushort), |
| | | ("IsBind", 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.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActBuyCountGiftItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 74 购买次数礼包活动信息 //tagMCActBuyCountGiftInfo:
|
| | | ItemID:%d,
|
| | | ItemCount:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCount,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountGift(Structure):
|
| | | NeedBuyCount = 0 #(BYTE NeedBuyCount)// 所需总购买次数
|
| | | Count = 0 #(BYTE Count)// 奖励物品数
|
| | | AwardItemList = list() #(vector<tagMCActBuyCountGiftItem> AwardItemList)// 奖励物品列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.NeedBuyCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temAwardItemList = tagMCActBuyCountGiftItem()
|
| | | _pos = temAwardItemList.ReadData(_lpData, _pos)
|
| | | self.AwardItemList.append(temAwardItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.NeedBuyCount = 0
|
| | | self.Count = 0
|
| | | self.AwardItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.AwardItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.NeedBuyCount)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | NeedBuyCount:%d,
|
| | | Count:%d,
|
| | | AwardItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.NeedBuyCount,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountGiftInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)// 活动编号
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | IsDayReset = 0 #(BYTE IsDayReset)// 是否每天重置
|
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | CTGIDCount = 0 #(BYTE CTGIDCount)
|
| | | CTGIDList = list() #(vector<DWORD> CTGIDList)// CTGID列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | GiftCount = 0 #(BYTE GiftCount)
|
| | | BuyCountGiftList = list() #(vector<tagMCActBuyCountGift> BuyCountGiftList)// 购买次数礼包列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x74
|
| | | 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.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.CTGIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CTGIDCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.CTGIDList.append(value)
|
| | | self.GiftCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GiftCount):
|
| | | temBuyCountGiftList = tagMCActBuyCountGift()
|
| | | _pos = temBuyCountGiftList.ReadData(_lpData, _pos)
|
| | | self.BuyCountGiftList.append(temBuyCountGiftList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x74
|
| | | self.ActNum = 0
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.CTGIDCount = 0
|
| | | self.CTGIDList = list()
|
| | | self.GiftCount = 0
|
| | | self.BuyCountGiftList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 10
|
| | | length += 10
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | length += 1
|
| | | length += 4 * self.CTGIDCount
|
| | | length += 1
|
| | | for i in range(self.GiftCount):
|
| | | length += self.BuyCountGiftList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ActNum)
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteBYTE(data, self.IsDayReset)
|
| | | data = CommFunc.WriteBYTE(data, self.ResetType)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteBYTE(data, self.CTGIDCount)
|
| | | for i in range(self.CTGIDCount):
|
| | | data = CommFunc.WriteDWORD(data, self.CTGIDList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.GiftCount)
|
| | | for i in range(self.GiftCount):
|
| | | data = CommFunc.WriteString(data, self.BuyCountGiftList[i].GetLength(), self.BuyCountGiftList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | IsDayReset:%d,
|
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | CTGIDCount:%d,
|
| | | CTGIDList:%s,
|
| | | GiftCount:%d,
|
| | | BuyCountGiftList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.IsDayReset,
|
| | | self.ResetType,
|
| | | self.LimitLV,
|
| | | self.CTGIDCount,
|
| | | "...",
|
| | | self.GiftCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActBuyCountGiftInfo=tagMCActBuyCountGiftInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActBuyCountGiftInfo.Head.Cmd,m_NAtagMCActBuyCountGiftInfo.Head.SubCmd))] = m_NAtagMCActBuyCountGiftInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 75 购买次数礼包活动玩家信息 #tagMCActBuyCountGiftPlayerInfo
|
| | |
|
| | | class tagMCActBuyCountGiftPlayerInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ActNum", c_ubyte), # 活动编号
|
| | | ("GiftAwardRecord", c_int), # 购买次数礼包领奖记录,直接用购买次数做位运算判断是否已领取
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x75
|
| | | 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 = 0x75
|
| | | self.ActNum = 0
|
| | | self.GiftAwardRecord = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActBuyCountGiftPlayerInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 75 购买次数礼包活动玩家信息 //tagMCActBuyCountGiftPlayerInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ActNum:%d,
|
| | | GiftAwardRecord:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ActNum,
|
| | | self.GiftAwardRecord
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActBuyCountGiftPlayerInfo=tagMCActBuyCountGiftPlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActBuyCountGiftPlayerInfo.Cmd,m_NAtagMCActBuyCountGiftPlayerInfo.SubCmd))] = m_NAtagMCActBuyCountGiftPlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 65 买一送多活动信息 #tagMCActBuyOneInfo
|
| | |
|
| | | class tagMCActBuyOneInfoFreeItem(Structure):
|