| | |
| | |
|
| | | class tagMCCoinToGoldCountInfo(Structure):
|
| | | Head = tagHead()
|
| | | RealFirstTime = 0 #(DWORD RealFirstTime)// 首次真实充值时间戳
|
| | | RealToday = 0 #(DWORD RealToday)// 今日真实充值coin
|
| | | RealTotal = 0 #(DWORD RealTotal)// 累计真实充值coin
|
| | | RecordCount = 0 #(WORD RecordCount)
|
| | | CTGCountInfoList = list() #(vector<tagMCCoinToGoldCount> CTGCountInfoList)
|
| | | data = None
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.RealFirstTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RealToday,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RealTotal,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RecordCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.RecordCount):
|
| | | temCTGCountInfoList = tagMCCoinToGoldCount()
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA1
|
| | | self.Head.SubCmd = 0x10
|
| | | self.RealFirstTime = 0
|
| | | self.RealToday = 0
|
| | | self.RealTotal = 0
|
| | | self.RecordCount = 0
|
| | | self.CTGCountInfoList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 2
|
| | | for i in range(self.RecordCount):
|
| | | length += self.CTGCountInfoList[i].GetLength()
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.RealFirstTime)
|
| | | data = CommFunc.WriteDWORD(data, self.RealToday)
|
| | | data = CommFunc.WriteDWORD(data, self.RealTotal)
|
| | | data = CommFunc.WriteWORD(data, self.RecordCount)
|
| | | for i in range(self.RecordCount):
|
| | | data = CommFunc.WriteString(data, self.CTGCountInfoList[i].GetLength(), self.CTGCountInfoList[i].GetBuffer())
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | RealFirstTime:%d,
|
| | | RealToday:%d,
|
| | | RealTotal:%d,
|
| | | RecordCount:%d,
|
| | | CTGCountInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.RealFirstTime,
|
| | | self.RealToday,
|
| | | self.RealTotal,
|
| | | self.RecordCount,
|
| | | "..."
|
| | | )
|