From 614707fc640e731fe8b78351f0933371da5450bf Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 11 十月 2023 16:32:02 +0800 Subject: [PATCH] 9952 【BT0.1】【主干】仙盟修改(阵法) --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 119 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index becbb41..2ee07d9 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -26601,6 +26601,125 @@ #------------------------------------------------------ +# A5 09 仙盟阵法信息 #tagMCFamilyZhenfaInfo + +class tagMCFamilyZhenfa(Structure): + _pack_ = 1 + _fields_ = [ + ("ZhenfaType", c_ubyte), # 阵法类型 + ("ZhenfaLV", c_ushort), # 阵法等级 + ("ZhenfaExp", c_int), # 阵法经验 + ] + + 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.ZhenfaType = 0 + self.ZhenfaLV = 0 + self.ZhenfaExp = 0 + return + + def GetLength(self): + return sizeof(tagMCFamilyZhenfa) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A5 09 仙盟阵法信息 //tagMCFamilyZhenfaInfo: + ZhenfaType:%d, + ZhenfaLV:%d, + ZhenfaExp:%d + '''\ + %( + self.ZhenfaType, + self.ZhenfaLV, + self.ZhenfaExp + ) + return DumpString + + +class tagMCFamilyZhenfaInfo(Structure): + Head = tagHead() + PlayerID = 0 #(DWORD PlayerID)// 当前培养阵法的玩家ID,如果有做自动捐献,需等收到的玩家ID为自己的时候才发送下一个捐献包 + Count = 0 #(BYTE Count) + ZhenfaInfoList = list() #(vector<tagMCFamilyZhenfa> ZhenfaInfoList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA5 + self.Head.SubCmd = 0x09 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temZhenfaInfoList = tagMCFamilyZhenfa() + _pos = temZhenfaInfoList.ReadData(_lpData, _pos) + self.ZhenfaInfoList.append(temZhenfaInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA5 + self.Head.SubCmd = 0x09 + self.PlayerID = 0 + self.Count = 0 + self.ZhenfaInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 4 + length += 1 + for i in range(self.Count): + length += self.ZhenfaInfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.PlayerID) + data = CommFunc.WriteBYTE(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.ZhenfaInfoList[i].GetLength(), self.ZhenfaInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + PlayerID:%d, + Count:%d, + ZhenfaInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.PlayerID, + self.Count, + "..." + ) + return DumpString + + +m_NAtagMCFamilyZhenfaInfo=tagMCFamilyZhenfaInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyZhenfaInfo.Head.Cmd,m_NAtagMCFamilyZhenfaInfo.Head.SubCmd))] = m_NAtagMCFamilyZhenfaInfo + + +#------------------------------------------------------ #A5 01 查看已申请加入的家族信息 #tagMCNotifyRequestJoinFamilyInfo class tagRequestJoinFamily(Structure): -- Gitblit v1.8.0