From 32f92cf196d36588653093f9a27d3ce41df2b9ca Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 07 四月 2021 17:42:12 +0800 Subject: [PATCH] 8886 【BT2】【后端】线下活动支持(增加单笔累充系统) --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 271 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 271 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index a50930a..4eea8de 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -25962,6 +25962,277 @@ #------------------------------------------------------ +# AA 50 单笔累充活动信息 #tagMCActSingleRechargeInfo + +class tagMCActSingleRechargeAwardItem(Structure): + _pack_ = 1 + _fields_ = [ + ("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.ItemID = 0 + self.ItemCount = 0 + self.IsBind = 0 + return + + def GetLength(self): + return sizeof(tagMCActSingleRechargeAwardItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 50 单笔累充活动信息 //tagMCActSingleRechargeInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActSingleRechargeAward(Structure): + AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31 + SingleRechargeValue = 0 #(DWORD SingleRechargeValue)// 单笔所需充值额度 + AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数 + AwardItem = list() #(vector<tagMCActSingleRechargeAwardItem> AwardItem)// 奖励物品信息 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.AwardIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.SingleRechargeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardItemCount): + temAwardItem = tagMCActSingleRechargeAwardItem() + _pos = temAwardItem.ReadData(_lpData, _pos) + self.AwardItem.append(temAwardItem) + return _pos + + def Clear(self): + self.AwardIndex = 0 + self.SingleRechargeValue = 0 + self.AwardItemCount = 0 + self.AwardItem = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + for i in range(self.AwardItemCount): + length += self.AwardItem[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.AwardIndex) + data = CommFunc.WriteDWORD(data, self.SingleRechargeValue) + data = CommFunc.WriteBYTE(data, self.AwardItemCount) + for i in range(self.AwardItemCount): + data = CommFunc.WriteString(data, self.AwardItem[i].GetLength(), self.AwardItem[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + AwardIndex:%d, + SingleRechargeValue:%d, + AwardItemCount:%d, + AwardItem:%s + '''\ + %( + self.AwardIndex, + self.SingleRechargeValue, + self.AwardItemCount, + "..." + ) + return DumpString + + +class tagMCActSingleRechargeInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)//活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + AwardCount = 0 #(BYTE AwardCount)// 奖励档数 + AwardInfo = list() #(vector<tagMCActSingleRechargeAward> AwardInfo)// 奖励档信息 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x50 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10) + self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardInfo = tagMCActSingleRechargeAward() + _pos = temAwardInfo.ReadData(_lpData, _pos) + self.AwardInfo.append(temAwardInfo) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x50 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.IsDayReset = 0 + self.LimitLV = 0 + self.AwardCount = 0 + self.AwardInfo = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 10 + length += 10 + length += 1 + length += 2 + length += 1 + for i in range(self.AwardCount): + length += self.AwardInfo[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.ActNum) + data = CommFunc.WriteString(data, 10, self.StartDate) + data = CommFunc.WriteString(data, 10, self.EndtDate) + data = CommFunc.WriteBYTE(data, self.IsDayReset) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardInfo[i].GetLength(), self.AwardInfo[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + IsDayReset:%d, + LimitLV:%d, + AwardCount:%d, + AwardInfo:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.IsDayReset, + self.LimitLV, + self.AwardCount, + "..." + ) + return DumpString + + +m_NAtagMCActSingleRechargeInfo=tagMCActSingleRechargeInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargeInfo.Head.Cmd,m_NAtagMCActSingleRechargeInfo.Head.SubCmd))] = m_NAtagMCActSingleRechargeInfo + + +#------------------------------------------------------ +# AA 51 单笔累充活动玩家信息 #tagMCActSingleRechargePlayerInfo + +class tagMCActSingleRechargePlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), #活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2 + ("HightestSingleRecharge", c_int), # 最高单笔充值额度 + ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x51 + 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 = 0x51 + self.ActNum = 0 + self.HightestSingleRecharge = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActSingleRechargePlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 51 单笔累充活动玩家信息 //tagMCActSingleRechargePlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + HightestSingleRecharge:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.HightestSingleRecharge, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActSingleRechargePlayerInfo=tagMCActSingleRechargePlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Cmd,m_NAtagMCActSingleRechargePlayerInfo.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo + + +#------------------------------------------------------ # AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo class tagMCTotalRechargeAwardItem(Structure): -- Gitblit v1.8.0