From 474e64199863f5d5ef4832d6a325915efebe7c44 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 25 十月 2018 11:24:36 +0800 Subject: [PATCH] 4255 【后端】【1.3】小助手 --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 124 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index 0915012..cedf488 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -17189,6 +17189,130 @@ #------------------------------------------------------ +# A7 16 小助手设置 #tagMCLittleHelperSet + +class tagMCLittleHelperFuncSet(Structure): + _pack_ = 1 + _fields_ = [ + ("SetNum", c_ubyte), # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义 + ("Value1", c_int), # 自定义值1,如果存储的是勾选信息, 按二进制位存储代表是否勾选,支持31位,每位代表的含义前端自定义 + ("Value2", c_int), # 自定义值2 + ("Value3", c_int), # 自定义值3 + ("Value4", c_int), # 自定义值4 + ("Value5", c_int), # 自定义值5 + ] + + 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.SetNum = 0 + self.Value1 = 0 + self.Value2 = 0 + self.Value3 = 0 + self.Value4 = 0 + self.Value5 = 0 + return + + def GetLength(self): + return sizeof(tagMCLittleHelperFuncSet) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A7 16 小助手设置 //tagMCLittleHelperSet: + SetNum:%d, + Value1:%d, + Value2:%d, + Value3:%d, + Value4:%d, + Value5:%d + '''\ + %( + self.SetNum, + self.Value1, + self.Value2, + self.Value3, + self.Value4, + self.Value5 + ) + return DumpString + + +class tagMCLittleHelperSet(Structure): + Head = tagHead() + FuncSetCount = 0 #(BYTE FuncSetCount)// 托管功能设置数,暂支持20个 + FuncSetList = list() #(vector<tagMCLittleHelperFuncSet> FuncSetList)// 托管功能设置列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA7 + self.Head.SubCmd = 0x16 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.FuncSetCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.FuncSetCount): + temFuncSetList = tagMCLittleHelperFuncSet() + _pos = temFuncSetList.ReadData(_lpData, _pos) + self.FuncSetList.append(temFuncSetList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA7 + self.Head.SubCmd = 0x16 + self.FuncSetCount = 0 + self.FuncSetList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.FuncSetCount): + length += self.FuncSetList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.FuncSetCount) + for i in range(self.FuncSetCount): + data = CommFunc.WriteString(data, self.FuncSetList[i].GetLength(), self.FuncSetList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + FuncSetCount:%d, + FuncSetList:%s + '''\ + %( + self.Head.OutputString(), + self.FuncSetCount, + "..." + ) + return DumpString + + +m_NAtagMCLittleHelperSet=tagMCLittleHelperSet() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLittleHelperSet.Head.Cmd,m_NAtagMCLittleHelperSet.Head.SubCmd))] = m_NAtagMCLittleHelperSet + + +#------------------------------------------------------ # A7 14 通知查询的NPC数量 #tagMCNPCCntList class tagMCNPCCntInfo(Structure): -- Gitblit v1.8.0