| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 18 限时抢购活动玩家预约信息 #tagMCFlashSaleAppointmentInfo
|
| | |
|
| | | class tagMCFlashSaleAppointmentInfo(Structure):
|
| | | Head = tagHead()
|
| | | GoodsCount = 0 #(WORD GoodsCount)// 商品数
|
| | | GoodsList = list() #(vector<DWORD> GoodsList)// 预约的商品
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x18
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.GoodsCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.GoodsCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.GoodsList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x18
|
| | | self.GoodsCount = 0
|
| | | self.GoodsList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 4 * self.GoodsCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.GoodsCount)
|
| | | for i in range(self.GoodsCount):
|
| | | data = CommFunc.WriteDWORD(data, self.GoodsList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | GoodsCount:%d,
|
| | | GoodsList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.GoodsCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFlashSaleAppointmentInfo=tagMCFlashSaleAppointmentInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFlashSaleAppointmentInfo.Head.Cmd,m_NAtagMCFlashSaleAppointmentInfo.Head.SubCmd))] = m_NAtagMCFlashSaleAppointmentInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 17 限时抢购活动信息 #tagMCFlashSaleInfo
|
| | |
|
| | | class tagMCFlashSaleGiftbag(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GiftID", c_int), #商城表的物品ID
|
| | | ("BuyCountLimit", c_ubyte), #限购数
|
| | | ("ServerBuyCountLimit", c_ushort), #全服限购数
|
| | | ("MoneyType", c_ubyte), #消耗货币类型
|
| | | ("MoneyNumber", c_int), #消耗货币数量
|
| | | ("MoneyOriginal", c_int), #原价
|
| | | ("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.GiftID = 0
|
| | | self.BuyCountLimit = 0
|
| | | self.ServerBuyCountLimit = 0
|
| | | self.MoneyType = 0
|
| | | self.MoneyNumber = 0
|
| | | self.MoneyOriginal = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFlashSaleGiftbag)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 17 限时抢购活动信息 //tagMCFlashSaleInfo:
|
| | | GiftID:%d,
|
| | | BuyCountLimit:%d,
|
| | | ServerBuyCountLimit:%d,
|
| | | MoneyType:%d,
|
| | | MoneyNumber:%d,
|
| | | MoneyOriginal:%d,
|
| | | ItemID:%d,
|
| | | ItemCount:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.GiftID,
|
| | | self.BuyCountLimit,
|
| | | self.ServerBuyCountLimit,
|
| | | self.MoneyType,
|
| | | self.MoneyNumber,
|
| | | self.MoneyOriginal,
|
| | | self.ItemID,
|
| | | self.ItemCount,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFlashSaleShop(Structure):
|
| | | DayIndex = 0 #(BYTE DayIndex)// 活动第几天
|
| | | TimeIndex = 0 #(BYTE TimeIndex)// 第几个时间段
|
| | | GiftbagCount = 0 #(BYTE GiftbagCount)// 商店礼包数
|
| | | GiftbagInfo = list() #(vector<tagMCFlashSaleGiftbag> GiftbagInfo)// 礼包信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.DayIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.TimeIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.GiftbagCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GiftbagCount):
|
| | | temGiftbagInfo = tagMCFlashSaleGiftbag()
|
| | | _pos = temGiftbagInfo.ReadData(_lpData, _pos)
|
| | | self.GiftbagInfo.append(temGiftbagInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.DayIndex = 0
|
| | | self.TimeIndex = 0
|
| | | self.GiftbagCount = 0
|
| | | self.GiftbagInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.GiftbagCount):
|
| | | length += self.GiftbagInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.DayIndex)
|
| | | data = CommFunc.WriteBYTE(data, self.TimeIndex)
|
| | | data = CommFunc.WriteBYTE(data, self.GiftbagCount)
|
| | | for i in range(self.GiftbagCount):
|
| | | data = CommFunc.WriteString(data, self.GiftbagInfo[i].GetLength(), self.GiftbagInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | DayIndex:%d,
|
| | | TimeIndex:%d,
|
| | | GiftbagCount:%d,
|
| | | GiftbagInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.DayIndex,
|
| | | self.TimeIndex,
|
| | | self.GiftbagCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFlashSaleTime(Structure):
|
| | | StartTime = "" #(char StartTime[5])// 开始时间 H:M
|
| | | EndtTime = "" #(char EndtTime[5])// 结束时间 H:M
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.StartTime,_pos = CommFunc.ReadString(_lpData, _pos,5)
|
| | | self.EndtTime,_pos = CommFunc.ReadString(_lpData, _pos,5)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.StartTime = ""
|
| | | self.EndtTime = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 5
|
| | | length += 5
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, 5, self.StartTime)
|
| | | data = CommFunc.WriteString(data, 5, self.EndtTime)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | StartTime:%s,
|
| | | EndtTime:%s
|
| | | '''\
|
| | | %(
|
| | | self.StartTime,
|
| | | self.EndtTime
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFlashSaleInfo(Structure):
|
| | | Head = tagHead()
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | AdvanceMinutes = 0 #(WORD AdvanceMinutes)// 提前显示分钟
|
| | | ActivityTimeCount = 0 #(BYTE ActivityTimeCount)
|
| | | ActivityTime = list() #(vector<tagMCFlashSaleTime> ActivityTime)//活动时间
|
| | | IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | ShopCount = 0 #(BYTE ShopCount)// 商店数
|
| | | ShopInfo = list() #(vector<tagMCFlashSaleShop> ShopInfo)// 商店信息, 当有多个商店且有多个活动时间段时则每个时间段对应一个商店;
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x17
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.AdvanceMinutes,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.ActivityTimeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ActivityTimeCount):
|
| | | temActivityTime = tagMCFlashSaleTime()
|
| | | _pos = temActivityTime.ReadData(_lpData, _pos)
|
| | | self.ActivityTime.append(temActivityTime)
|
| | | self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.ShopCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ShopCount):
|
| | | temShopInfo = tagMCFlashSaleShop()
|
| | | _pos = temShopInfo.ReadData(_lpData, _pos)
|
| | | self.ShopInfo.append(temShopInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x17
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.AdvanceMinutes = 0
|
| | | self.ActivityTimeCount = 0
|
| | | self.ActivityTime = list()
|
| | | self.IsDayReset = 0
|
| | | self.LimitLV = 0
|
| | | self.ShopCount = 0
|
| | | self.ShopInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 10
|
| | | length += 10
|
| | | length += 2
|
| | | length += 1
|
| | | for i in range(self.ActivityTimeCount):
|
| | | length += self.ActivityTime[i].GetLength()
|
| | | length += 1
|
| | | length += 2
|
| | | length += 1
|
| | | for i in range(self.ShopCount):
|
| | | length += self.ShopInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteWORD(data, self.AdvanceMinutes)
|
| | | data = CommFunc.WriteBYTE(data, self.ActivityTimeCount)
|
| | | for i in range(self.ActivityTimeCount):
|
| | | data = CommFunc.WriteString(data, self.ActivityTime[i].GetLength(), self.ActivityTime[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.IsDayReset)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteBYTE(data, self.ShopCount)
|
| | | for i in range(self.ShopCount):
|
| | | data = CommFunc.WriteString(data, self.ShopInfo[i].GetLength(), self.ShopInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | AdvanceMinutes:%d,
|
| | | ActivityTimeCount:%d,
|
| | | ActivityTime:%s,
|
| | | IsDayReset:%d,
|
| | | LimitLV:%d,
|
| | | ShopCount:%d,
|
| | | ShopInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.AdvanceMinutes,
|
| | | self.ActivityTimeCount,
|
| | | "...",
|
| | | self.IsDayReset,
|
| | | self.LimitLV,
|
| | | self.ShopCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFlashSaleInfo=tagMCFlashSaleInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFlashSaleInfo.Head.Cmd,m_NAtagMCFlashSaleInfo.Head.SubCmd))] = m_NAtagMCFlashSaleInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 05 充值排行特惠信息 #tagMCRechargeRankTeHuiInfo
|
| | |
|
| | | class tagMCRechargeRankTeHuiInfo(Structure):
|