From 9f30bc4785beb84ff4ab1504a2279b4a82f9ebd1 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 11 十一月 2024 17:56:03 +0800 Subject: [PATCH] 10297 【越南】【英语】【砍树】【tqxbqy】轮回殿-服务端 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 357 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 357 insertions(+), 0 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 5709403..2c3f608 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -38322,6 +38322,363 @@ #------------------------------------------------------ +# AA 88 轮回殿活动信息 #tagMCActLunhuidianInfo + +class tagMCActLunhuidianItem(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(tagMCActLunhuidianItem) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 88 轮回殿活动信息 //tagMCActLunhuidianInfo: + ItemID:%d, + ItemCount:%d, + IsBind:%d + '''\ + %( + self.ItemID, + self.ItemCount, + self.IsBind + ) + return DumpString + + +class tagMCActLunhuidianAward(Structure): + AwardIndex = 0 #(BYTE AwardIndex)// 奖励记录索引 0~30 + NeedValue = 0 #(DWORD NeedValue)// 奖励所需值 + Count = 0 #(BYTE Count)// 奖励物品数 + AwardItemList = list() #(vector<tagMCActLunhuidianItem> AwardItemList)// 奖励物品列表 + 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.NeedValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temAwardItemList = tagMCActLunhuidianItem() + _pos = temAwardItemList.ReadData(_lpData, _pos) + self.AwardItemList.append(temAwardItemList) + return _pos + + def Clear(self): + self.AwardIndex = 0 + self.NeedValue = 0 + self.Count = 0 + self.AwardItemList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + for i in range(self.Count): + length += self.AwardItemList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.AwardIndex) + data = CommFunc.WriteDWORD(data, self.NeedValue) + data = CommFunc.WriteBYTE(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + AwardIndex:%d, + NeedValue:%d, + Count:%d, + AwardItemList:%s + '''\ + %( + self.AwardIndex, + self.NeedValue, + self.Count, + "..." + ) + return DumpString + + +class tagMCActLunhuidianRound(Structure): + RoundType = 0 #(BYTE RoundType)// 轮回类型 + AwardType = 0 #(BYTE AwardType)// 奖励类型 1-消耗货币;2-寻宝次数 + AwardTypeValue = 0 #(DWORD AwardTypeValue)// 奖励类型对应值,消耗货币时为对应的货币类型,寻宝时为对应的寻宝类型 + RoundMax = 0 #(BYTE RoundMax)// 最大可循环轮次 + AwardCount = 0 #(BYTE AwardCount) + AwardList = list() #(vector<tagMCActLunhuidianAward> AwardList)// 每轮奖励列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.RoundType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardTypeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.RoundMax,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.AwardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.AwardCount): + temAwardList = tagMCActLunhuidianAward() + _pos = temAwardList.ReadData(_lpData, _pos) + self.AwardList.append(temAwardList) + return _pos + + def Clear(self): + self.RoundType = 0 + self.AwardType = 0 + self.AwardTypeValue = 0 + self.RoundMax = 0 + self.AwardCount = 0 + self.AwardList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 4 + length += 1 + length += 1 + for i in range(self.AwardCount): + length += self.AwardList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.RoundType) + data = CommFunc.WriteBYTE(data, self.AwardType) + data = CommFunc.WriteDWORD(data, self.AwardTypeValue) + data = CommFunc.WriteBYTE(data, self.RoundMax) + data = CommFunc.WriteBYTE(data, self.AwardCount) + for i in range(self.AwardCount): + data = CommFunc.WriteString(data, self.AwardList[i].GetLength(), self.AwardList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + RoundType:%d, + AwardType:%d, + AwardTypeValue:%d, + RoundMax:%d, + AwardCount:%d, + AwardList:%s + '''\ + %( + self.RoundType, + self.AwardType, + self.AwardTypeValue, + self.RoundMax, + self.AwardCount, + "..." + ) + return DumpString + + +class tagMCActLunhuidianInfo(Structure): + Head = tagHead() + ActNum = 0 #(BYTE ActNum)// 活动编号 + StartDate = "" #(char StartDate[10])// 开始日期 y-m-d + EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d + ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置 + LimitLV = 0 #(WORD LimitLV)// 限制等级 + RoundCount = 0 #(BYTE RoundCount) + RoundList = list() #(vector<tagMCActLunhuidianRound> RoundList)// 轮回列表,支持多个不同类型轮回同时开启 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + 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.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.RoundCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.RoundCount): + temRoundList = tagMCActLunhuidianRound() + _pos = temRoundList.ReadData(_lpData, _pos) + self.RoundList.append(temRoundList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xAA + self.Head.SubCmd = 0x88 + self.ActNum = 0 + self.StartDate = "" + self.EndtDate = "" + self.ResetType = 0 + self.LimitLV = 0 + self.RoundCount = 0 + self.RoundList = 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.RoundCount): + length += self.RoundList[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.ResetType) + data = CommFunc.WriteWORD(data, self.LimitLV) + data = CommFunc.WriteBYTE(data, self.RoundCount) + for i in range(self.RoundCount): + data = CommFunc.WriteString(data, self.RoundList[i].GetLength(), self.RoundList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ActNum:%d, + StartDate:%s, + EndtDate:%s, + ResetType:%d, + LimitLV:%d, + RoundCount:%d, + RoundList:%s + '''\ + %( + self.Head.OutputString(), + self.ActNum, + self.StartDate, + self.EndtDate, + self.ResetType, + self.LimitLV, + self.RoundCount, + "..." + ) + return DumpString + + +m_NAtagMCActLunhuidianInfo=tagMCActLunhuidianInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianInfo.Head.Cmd,m_NAtagMCActLunhuidianInfo.Head.SubCmd))] = m_NAtagMCActLunhuidianInfo + + +#------------------------------------------------------ +# AA 89 轮回殿活动玩家信息 #tagMCActLunhuidianPlayerInfo + +class tagMCActLunhuidianPlayerInfo(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ActNum", c_ubyte), # 活动编号 + ("RoundType", c_ubyte), # 轮回类型 + ("CurRound", c_ubyte), # 当前轮次 + ("CurValue", c_int), # 累计值 + ("AwardRecord", c_int), # 当前轮次奖励领奖记录,按奖励索引二进制位存储是否已领取,所有奖励已领取后自动进入下一轮,且重置该奖励状态 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xAA + self.SubCmd = 0x89 + 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 = 0x89 + self.ActNum = 0 + self.RoundType = 0 + self.CurRound = 0 + self.CurValue = 0 + self.AwardRecord = 0 + return + + def GetLength(self): + return sizeof(tagMCActLunhuidianPlayerInfo) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// AA 89 轮回殿活动玩家信息 //tagMCActLunhuidianPlayerInfo: + Cmd:%s, + SubCmd:%s, + ActNum:%d, + RoundType:%d, + CurRound:%d, + CurValue:%d, + AwardRecord:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ActNum, + self.RoundType, + self.CurRound, + self.CurValue, + self.AwardRecord + ) + return DumpString + + +m_NAtagMCActLunhuidianPlayerInfo=tagMCActLunhuidianPlayerInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActLunhuidianPlayerInfo.Cmd,m_NAtagMCActLunhuidianPlayerInfo.SubCmd))] = m_NAtagMCActLunhuidianPlayerInfo + + +#------------------------------------------------------ # AA 48 多日连充活动信息 #tagMCActManyDayRechargeInfo class tagMCActManyDayRechargeItem(Structure): -- Gitblit v1.8.0