From 0f297a5b66b91751d8342624db871efeca7ed94e Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期六, 02 三月 2019 10:20:48 +0800 Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(穿脱、升星) --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 108 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index 0110c0b..f1d2171 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -13782,6 +13782,114 @@ #------------------------------------------------------ +# A3 B1 装备部位星数信息 #tagMCEquipPartStarInfo + +class tagMCEquipPartStar(Structure): + _pack_ = 1 + _fields_ = [ + ("EquipPackIndex", c_ushort), + ("Star", 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.EquipPackIndex = 0 + self.Star = 0 + return + + def GetLength(self): + return sizeof(tagMCEquipPartStar) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A3 B1 装备部位星数信息 //tagMCEquipPartStarInfo: + EquipPackIndex:%d, + Star:%d + '''\ + %( + self.EquipPackIndex, + self.Star + ) + return DumpString + + +class tagMCEquipPartStarInfo(Structure): + Head = tagHead() + Count = 0 #(BYTE Count)// 信息个数 + InfoList = list() #(vector<tagMCEquipPartStar> InfoList)// 信息列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0xB1 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.Count): + temInfoList = tagMCEquipPartStar() + _pos = temInfoList.ReadData(_lpData, _pos) + self.InfoList.append(temInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA3 + self.Head.SubCmd = 0xB1 + self.Count = 0 + self.InfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Count): + length += self.InfoList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + InfoList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagMCEquipPartStarInfo=tagMCEquipPartStarInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCEquipPartStarInfo.Head.Cmd,m_NAtagMCEquipPartStarInfo.Head.SubCmd))] = m_NAtagMCEquipPartStarInfo + + +#------------------------------------------------------ # A3 09 通知玩家部位套装等级 #tagMCEquipPartSuiteLVInfo class tagMCEquipPartSuiteLV(Structure): -- Gitblit v1.8.0