| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 03 每日打包直购礼包 #tagMCDailyPackBuyGiftInfo
|
| | |
|
| | | class tagMCDailyPackBuyGiftInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("PackBuyTime", c_int), # 打包购买的时间戳,如果有该值,代表已经一次性打包购买了,可根据次时间戳算出当前是第几天
|
| | | ("BuyStateToday", c_int), # 今日礼包购买状态,按礼包索引二进制位计算代表是否已购买,仅非打包购买状态下有用
|
| | | ("AwardState", c_int), # 今日礼包领奖状态,按礼包索引二进制位计算代表是否已领取
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x03
|
| | | 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 = 0x03
|
| | | self.PackBuyTime = 0
|
| | | self.BuyStateToday = 0
|
| | | self.AwardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCDailyPackBuyGiftInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 03 每日打包直购礼包 //tagMCDailyPackBuyGiftInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | PackBuyTime:%d,
|
| | | BuyStateToday:%d,
|
| | | AwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.PackBuyTime,
|
| | | self.BuyStateToday,
|
| | | self.AwardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCDailyPackBuyGiftInfo=tagMCDailyPackBuyGiftInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCDailyPackBuyGiftInfo.Cmd,m_NAtagMCDailyPackBuyGiftInfo.SubCmd))] = m_NAtagMCDailyPackBuyGiftInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 24 每日免费直购礼包信息 #tagMCDayFreeGoldGiftState
|
| | |
|
| | | class tagMCDayFreeGoldGiftState(Structure):
|
| | |
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("AwardIndex", c_ubyte), #游历奖励索引
|
| | | ("GetAwardCount", c_ubyte), #已领取次数;前端判断是否可领取: 总游历值 >= (已领取次数 + 1) * 单次所需游历值
|
| | | ("GetAwardCount", c_int), #已领取次数;前端判断是否可领取: 总游历值 >= (已领取次数 + 1) * 单次所需游历值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 20 战令信息 #tagMCZhanlingInfo
|
| | |
|
| | | class tagMCZhanling(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("NeedValue", c_int), # 奖励所需值
|
| | | ("FreeRewardState", c_ubyte), # 免费奖励是否已领取
|
| | | ("ZLRewardState", 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.NeedValue = 0
|
| | | self.FreeRewardState = 0
|
| | | self.ZLRewardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCZhanling)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 20 战令信息 //tagMCZhanlingInfo:
|
| | | NeedValue:%d,
|
| | | FreeRewardState:%d,
|
| | | ZLRewardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.NeedValue,
|
| | | self.FreeRewardState,
|
| | | self.ZLRewardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCZhanlingInfo(Structure):
|
| | | Head = tagHead()
|
| | | ZhanlingType = 0 #(BYTE ZhanlingType)// 战令类型
|
| | | IsActivite = 0 #(BYTE IsActivite)// 是否已激活
|
| | | RewardCount = 0 #(WORD RewardCount)
|
| | | RewardList = list() #(vector<tagMCZhanling> RewardList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x20
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ZhanlingType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.IsActivite,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.RewardCount):
|
| | | temRewardList = tagMCZhanling()
|
| | | _pos = temRewardList.ReadData(_lpData, _pos)
|
| | | self.RewardList.append(temRewardList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x20
|
| | | self.ZhanlingType = 0
|
| | | self.IsActivite = 0
|
| | | self.RewardCount = 0
|
| | | self.RewardList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | for i in range(self.RewardCount):
|
| | | length += self.RewardList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ZhanlingType)
|
| | | data = CommFunc.WriteBYTE(data, self.IsActivite)
|
| | | data = CommFunc.WriteWORD(data, self.RewardCount)
|
| | | for i in range(self.RewardCount):
|
| | | data = CommFunc.WriteString(data, self.RewardList[i].GetLength(), self.RewardList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ZhanlingType:%d,
|
| | | IsActivite:%d,
|
| | | RewardCount:%d,
|
| | | RewardList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ZhanlingType,
|
| | | self.IsActivite,
|
| | | self.RewardCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCZhanlingInfo=tagMCZhanlingInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhanlingInfo.Head.Cmd,m_NAtagMCZhanlingInfo.Head.SubCmd))] = m_NAtagMCZhanlingInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 08 获得仙缘币信息 #tagMCAddXianyuanCoinMsg
|
| | |
|
| | | class tagMCAddXianyuanCoinMsg(Structure):
|