| | |
| | |
|
| | | class tagGCLuckyCloudBuyLotteryRecInfo(Structure):
|
| | | Head = tagHead()
|
| | | ZoneID = 0 #(BYTE ZoneID)// 分区
|
| | | ZoneCount = 0 #(BYTE ZoneCount)// 分区数
|
| | | ZoneIDList = list() #(vector<BYTE> ZoneIDList)// 所有分区ID列表
|
| | | ZoneID = 0 #(BYTE ZoneID)// 返回记录分区ID
|
| | | Count = 0 #(WORD Count)
|
| | | LotteryRecList = list() #(vector<tagGCLuckyCloudBuyLotteryRec> LotteryRecList)
|
| | | data = None
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ZoneCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ZoneCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.ZoneIDList.append(value)
|
| | | self.ZoneID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xC0
|
| | | self.Head.SubCmd = 0x14
|
| | | self.ZoneCount = 0
|
| | | self.ZoneIDList = list()
|
| | | self.ZoneID = 0
|
| | | self.Count = 0
|
| | | self.LotteryRecList = list()
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.ZoneCount
|
| | | length += 1
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ZoneCount)
|
| | | for i in range(self.ZoneCount):
|
| | | data = CommFunc.WriteBYTE(data, self.ZoneIDList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.ZoneID)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ZoneCount:%d,
|
| | | ZoneIDList:%s,
|
| | | ZoneID:%d,
|
| | | Count:%d,
|
| | | LotteryRecList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ZoneCount,
|
| | | "...",
|
| | | self.ZoneID,
|
| | | self.Count,
|
| | | "..."
|
| | |
| | |
|
| | | class tagGCLuckyCloudBuyNumRecInfo(Structure):
|
| | | Head = tagHead()
|
| | | RemainCount = 0 #(WORD RemainCount)// 开奖剩余份数
|
| | | Count = 0 #(WORD Count)
|
| | | BuyNumRecList = list() #(vector<tagGCLuckyCloudBuyNumRec> BuyNumRecList)
|
| | | data = None
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.RemainCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temBuyNumRecList = tagGCLuckyCloudBuyNumRec()
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xC0
|
| | | self.Head.SubCmd = 0x13
|
| | | self.RemainCount = 0
|
| | | self.Count = 0
|
| | | self.BuyNumRecList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.BuyNumRecList[i].GetLength()
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.RemainCount)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.BuyNumRecList[i].GetLength(), self.BuyNumRecList[i].GetBuffer())
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | RemainCount:%d,
|
| | | Count:%d,
|
| | | BuyNumRecList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.RemainCount,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | |
| | | #------------------------------------------------------
|
| | | # C0 12 幸运云购轮次信息 #tagGCLuckyCloudBuyRoundInfo
|
| | |
|
| | | class tagGCLuckyCloudBuyRoundInfo(Structure):
|
| | | class tagGCLuckyCloudBuyRoundItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("RoundID", c_int), # 轮次唯一ID标识,当收到的轮次ID变更时,前端需清空购买号码记录缓存
|
| | | ("RoundNum", c_ubyte), # 今日第几轮
|
| | | ("SuperItemID", c_int), # 大奖物品ID
|
| | | ("SuperItemCount", c_ubyte), # 大奖物品个数
|
| | | ("SuperItemMoneyType", c_ubyte), # 大奖价值货币类型
|
| | | ("SuperItemMoneyValue", c_int), # 大奖价值
|
| | | ("RemainCount", c_ushort), # 开奖剩余份数
|
| | | ("ItemID", c_int), |
| | | ("ItemCount", c_ushort), |
| | | ("IsBind", c_ubyte), # 是否拍品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xC0
|
| | | self.SubCmd = 0x12
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | |
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xC0
|
| | | self.SubCmd = 0x12
|
| | | self.RoundID = 0
|
| | | self.RoundNum = 0
|
| | | self.SuperItemID = 0
|
| | | self.SuperItemCount = 0
|
| | | self.SuperItemMoneyType = 0
|
| | | self.SuperItemMoneyValue = 0
|
| | | self.RemainCount = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCLuckyCloudBuyRoundInfo)
|
| | | return sizeof(tagGCLuckyCloudBuyRoundItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// C0 12 幸运云购轮次信息 //tagGCLuckyCloudBuyRoundInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemID:%d,
|
| | | ItemCount:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCount,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagGCLuckyCloudBuyRoundInfo(Structure):
|
| | | Head = tagHead()
|
| | | ZoneID = 0 #(BYTE ZoneID)// 所属分区ID
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | RoundID = 0 #(DWORD RoundID)// 轮次唯一ID标识,当收到的轮次ID变更时,前端需清空购买号码记录缓存
|
| | | RoundNum = 0 #(BYTE RoundNum)// 今日第几轮
|
| | | SuperItemID = 0 #(DWORD SuperItemID)// 大奖物品ID
|
| | | SuperItemCount = 0 #(BYTE SuperItemCount)// 大奖物品个数
|
| | | SuperItemMoneyType = 0 #(BYTE SuperItemMoneyType)// 大奖价值货币类型
|
| | | SuperItemMoneyValue = 0 #(DWORD SuperItemMoneyValue)// 大奖价值
|
| | | BaseItemCount = 0 #(BYTE BaseItemCount)// 每次购买固定奖励物品数
|
| | | BaseItemList = list() #(vector<tagGCLuckyCloudBuyRoundItem> BaseItemList)// 每次购买固定奖励物品信息
|
| | | RandItemCount = 0 #(BYTE RandItemCount)// 每次购买随机奖励物品数
|
| | | RandItemList = list() #(vector<tagGCLuckyCloudBuyRoundItem> RandItemList)// 每次购买随机奖励物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xC0
|
| | | self.Head.SubCmd = 0x12
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ZoneID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.RoundID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RoundNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.SuperItemID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.SuperItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.SuperItemMoneyType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.SuperItemMoneyValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.BaseItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.BaseItemCount):
|
| | | temBaseItemList = tagGCLuckyCloudBuyRoundItem()
|
| | | _pos = temBaseItemList.ReadData(_lpData, _pos)
|
| | | self.BaseItemList.append(temBaseItemList)
|
| | | self.RandItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.RandItemCount):
|
| | | temRandItemList = tagGCLuckyCloudBuyRoundItem()
|
| | | _pos = temRandItemList.ReadData(_lpData, _pos)
|
| | | self.RandItemList.append(temRandItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xC0
|
| | | self.Head.SubCmd = 0x12
|
| | | self.ZoneID = 0
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.RoundID = 0
|
| | | self.RoundNum = 0
|
| | | self.SuperItemID = 0
|
| | | self.SuperItemCount = 0
|
| | | self.SuperItemMoneyType = 0
|
| | | self.SuperItemMoneyValue = 0
|
| | | self.BaseItemCount = 0
|
| | | self.BaseItemList = list()
|
| | | self.RandItemCount = 0
|
| | | self.RandItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 10
|
| | | length += 10
|
| | | length += 4
|
| | | length += 1
|
| | | length += 4
|
| | | length += 1
|
| | | length += 1
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.BaseItemCount):
|
| | | length += self.BaseItemList[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.RandItemCount):
|
| | | length += self.RandItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ZoneID)
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteDWORD(data, self.RoundID)
|
| | | data = CommFunc.WriteBYTE(data, self.RoundNum)
|
| | | data = CommFunc.WriteDWORD(data, self.SuperItemID)
|
| | | data = CommFunc.WriteBYTE(data, self.SuperItemCount)
|
| | | data = CommFunc.WriteBYTE(data, self.SuperItemMoneyType)
|
| | | data = CommFunc.WriteDWORD(data, self.SuperItemMoneyValue)
|
| | | data = CommFunc.WriteBYTE(data, self.BaseItemCount)
|
| | | for i in range(self.BaseItemCount):
|
| | | data = CommFunc.WriteString(data, self.BaseItemList[i].GetLength(), self.BaseItemList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.RandItemCount)
|
| | | for i in range(self.RandItemCount):
|
| | | data = CommFunc.WriteString(data, self.RandItemList[i].GetLength(), self.RandItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ZoneID:%d,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | RoundID:%d,
|
| | | RoundNum:%d,
|
| | | SuperItemID:%d,
|
| | | SuperItemCount:%d,
|
| | | SuperItemMoneyType:%d,
|
| | | SuperItemMoneyValue:%d,
|
| | | RemainCount:%d
|
| | | BaseItemCount:%d,
|
| | | BaseItemList:%s,
|
| | | RandItemCount:%d,
|
| | | RandItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Head.OutputString(),
|
| | | self.ZoneID,
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.RoundID,
|
| | | self.RoundNum,
|
| | | self.SuperItemID,
|
| | | self.SuperItemCount,
|
| | | self.SuperItemMoneyType,
|
| | | self.SuperItemMoneyValue,
|
| | | self.RemainCount
|
| | | self.BaseItemCount,
|
| | | "...",
|
| | | self.RandItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagGCLuckyCloudBuyRoundInfo=tagGCLuckyCloudBuyRoundInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCLuckyCloudBuyRoundInfo.Cmd,m_NAtagGCLuckyCloudBuyRoundInfo.SubCmd))] = m_NAtagGCLuckyCloudBuyRoundInfo
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCLuckyCloudBuyRoundInfo.Head.Cmd,m_NAtagGCLuckyCloudBuyRoundInfo.Head.SubCmd))] = m_NAtagGCLuckyCloudBuyRoundInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|