10311 【bt】聊天限制(A110增加同步真实充值信息)
| | |
| | |
|
| | | 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,
|
| | | "..."
|
| | | )
|
| | |
| | |
|
| | | 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,
|
| | | "..."
|
| | | )
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGRealToday, ctgRealToday)
|
| | | ctgRealTotal = min(ctgRealTotal + orderCoin, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGRealTotal, ctgRealTotal)
|
| | | Sync_CoinToGoldCountInfo(curPlayer, [])
|
| | |
|
| | | notifyMark = ctgIpyData.GetNotifyMark() if ctgIpyData else ""
|
| | | goldBefore = curPlayer.GetGold()
|
| | |
| | | ipyData = ipyDataMgr.GetCTGByIndex(i)
|
| | | syncRecordIDList.append(ipyData.GetRecordID())
|
| | |
|
| | | if not syncRecordIDList:
|
| | | return
|
| | | #if not syncRecordIDList:
|
| | | # return
|
| | |
|
| | | countInfoPack = ChPyNetSendPack.tagMCCoinToGoldCountInfo()
|
| | | countInfoPack.Clear()
|
| | | countInfoPack.RealToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealToday)
|
| | | countInfoPack.RealTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealTotal)
|
| | | countInfoPack.RealFirstTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealFirstTime)
|
| | | countInfoPack.CTGCountInfoList = []
|
| | | for recordID in syncRecordIDList:
|
| | | countInfo = ChPyNetSendPack.tagMCCoinToGoldCount()
|