From a9b193b0135c6630edaed8e1bb9770d16bba0e9b Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 02 七月 2021 18:50:06 +0800 Subject: [PATCH] 9046 【主干】【BT2】【BT3】【后端】培养功能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 249 ++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 224 insertions(+), 25 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 8f401d7..24a5c17 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -20104,60 +20104,98 @@ #A3 01 坐骑培养信息 #tagTrainHorseData class tagTrainHorseData(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("LV", c_ubyte), #等阶 - ("EatItemCount", c_int), #当前阶已吃丹个数 - ("SkinPlusState", c_int), #幻化激活状态,按位存储是否激活,幻化编号ID对应位 - ] + Head = tagHead() + LV = 0 #(BYTE LV)//等阶 + EatItemCount = 0 #(DWORD EatItemCount)//当前阶已吃丹个数 + SkinPlusState = 0 #(DWORD SkinPlusState)//幻化激活状态,按位存储是否激活,幻化编号ID对应位 + TrainTypes = 0 #(BYTE TrainTypes)//培养类型数 + TrainLVList = list() #(vector<DWORD> TrainLVList)//培养等阶列表,索引为培养类型减1 + TrainItemCountList = list() #(vector<DWORD> TrainItemCountList)//培养当前阶已吃培养丹个数列表,索引为培养类型减1 + data = None def __init__(self): self.Clear() - self.Cmd = 0xA3 - self.SubCmd = 0x01 + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0x01 return - def ReadData(self, stringData, _pos=0, _len=0): + def ReadData(self, _lpData, _pos=0, _Len=0): self.Clear() - memmove(addressof(self), stringData[_pos:], self.GetLength()) - return _pos + self.GetLength() + _pos = self.Head.ReadData(_lpData, _pos) + self.LV,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.EatItemCount,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.SkinPlusState,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.TrainTypes,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainLVList.append(value) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainItemCountList.append(value) + return _pos def Clear(self): - self.Cmd = 0xA3 - self.SubCmd = 0x01 + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0x01 self.LV = 0 self.EatItemCount = 0 self.SkinPlusState = 0 + self.TrainTypes = 0 + self.TrainLVList = list() + self.TrainItemCountList = list() return def GetLength(self): - return sizeof(tagTrainHorseData) + length = 0 + length += self.Head.GetLength() + length += 1 + length += 4 + length += 4 + length += 1 + length += 4 * self.TrainTypes + length += 4 * self.TrainTypes + + return length def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.LV) + data = CommFunc.WriteDWORD(data, self.EatItemCount) + data = CommFunc.WriteDWORD(data, self.SkinPlusState) + data = CommFunc.WriteBYTE(data, self.TrainTypes) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainLVList[i]) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainItemCountList[i]) + return data def OutputString(self): - DumpString = '''//A3 01 坐骑培养信息 //tagTrainHorseData: - Cmd:%s, - SubCmd:%s, + DumpString = ''' + Head:%s, LV:%d, EatItemCount:%d, - SkinPlusState:%d + SkinPlusState:%d, + TrainTypes:%d, + TrainLVList:%s, + TrainItemCountList:%s '''\ %( - self.Cmd, - self.SubCmd, + self.Head.OutputString(), self.LV, self.EatItemCount, - self.SkinPlusState + self.SkinPlusState, + self.TrainTypes, + "...", + "..." ) return DumpString m_NAtagTrainHorseData=tagTrainHorseData() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Cmd,m_NAtagTrainHorseData.SubCmd))] = m_NAtagTrainHorseData +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Head.Cmd,m_NAtagTrainHorseData.Head.SubCmd))] = m_NAtagTrainHorseData #------------------------------------------------------ @@ -23748,6 +23786,90 @@ #------------------------------------------------------ +# A8 18 灵器培养信息 #tagMCLingQiTrainInfo + +class tagMCLingQiTrainInfo(Structure): + Head = tagHead() + EquipPlace = 0 #(BYTE EquipPlace)//灵器装备位 + TrainTypes = 0 #(BYTE TrainTypes)//培养类型数 + TrainLVList = list() #(vector<DWORD> TrainLVList)//培养等阶列表,索引为培养类型减1 + TrainItemCountList = list() #(vector<DWORD> TrainItemCountList)//培养当前阶已吃培养丹个数列表,索引为培养类型减1 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA8 + self.Head.SubCmd = 0x18 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.EquipPlace,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.TrainTypes,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainLVList.append(value) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainItemCountList.append(value) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA8 + self.Head.SubCmd = 0x18 + self.EquipPlace = 0 + self.TrainTypes = 0 + self.TrainLVList = list() + self.TrainItemCountList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 1 + length += 4 * self.TrainTypes + length += 4 * self.TrainTypes + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.EquipPlace) + data = CommFunc.WriteBYTE(data, self.TrainTypes) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainLVList[i]) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainItemCountList[i]) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + EquipPlace:%d, + TrainTypes:%d, + TrainLVList:%s, + TrainItemCountList:%s + '''\ + %( + self.Head.OutputString(), + self.EquipPlace, + self.TrainTypes, + "...", + "..." + ) + return DumpString + + +m_NAtagMCLingQiTrainInfo=tagMCLingQiTrainInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLingQiTrainInfo.Head.Cmd,m_NAtagMCLingQiTrainInfo.Head.SubCmd))] = m_NAtagMCLingQiTrainInfo + + +#------------------------------------------------------ # A8 14 合成结果通知 #tagMCMakeItemAnswer class tagMCMakeItemAnswer(Structure): @@ -24175,6 +24297,83 @@ #------------------------------------------------------ +# A8 17 宠物培养信息 #tagMCPetTrainInfo + +class tagMCPetTrainInfo(Structure): + Head = tagHead() + TrainTypes = 0 #(BYTE TrainTypes)//培养类型数 + TrainLVList = list() #(vector<DWORD> TrainLVList)//培养等阶列表,索引为培养类型减1 + TrainItemCountList = list() #(vector<DWORD> TrainItemCountList)//培养当前阶已吃培养丹个数列表,索引为培养类型减1 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA8 + self.Head.SubCmd = 0x17 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.TrainTypes,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainLVList.append(value) + for i in range(self.TrainTypes): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.TrainItemCountList.append(value) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA8 + self.Head.SubCmd = 0x17 + self.TrainTypes = 0 + self.TrainLVList = list() + self.TrainItemCountList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 4 * self.TrainTypes + length += 4 * self.TrainTypes + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.TrainTypes) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainLVList[i]) + for i in range(self.TrainTypes): + data = CommFunc.WriteDWORD(data, self.TrainItemCountList[i]) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + TrainTypes:%d, + TrainLVList:%s, + TrainItemCountList:%s + '''\ + %( + self.Head.OutputString(), + self.TrainTypes, + "...", + "..." + ) + return DumpString + + +m_NAtagMCPetTrainInfo=tagMCPetTrainInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPetTrainInfo.Head.Cmd,m_NAtagMCPetTrainInfo.Head.SubCmd))] = m_NAtagMCPetTrainInfo + + +#------------------------------------------------------ # A8 02 通知NPC商店物品今日已购买次数 #tagMCShopItemDayBuyCntInfo class tagMCShopItemDayBuyCnt(Structure): -- Gitblit v1.8.0