From e67b6768b97dd18a398334f210c3056fc233e146 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 08 八月 2025 17:24:37 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(修复武将皮肤同步错误问题;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 127 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 123 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py index 050417a..83efc50 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py @@ -4407,7 +4407,7 @@ class tagCMUseItems(Structure): Head = tagHead() ItemIndex = 0 #(BYTE ItemIndex)//物品在背包中索引 - UseCnt = 0 #(WORD UseCnt)//使用个数,0表示全部使用 + UseCnt = 0 #(DWORD UseCnt)//使用个数,0表示全部使用 ExData = 0 #(DWORD ExData)//使用扩展值, 默认0, 选择物品宝箱时发送选择的物品ID SelectCount = 0 #(BYTE SelectCount)//指定选择项,当批量使用单个箱子需要同时选中多种选项时使用该值 SelectList = list() #(vector<tagCMUseItemsSelect> SelectList) @@ -4423,7 +4423,7 @@ self.Clear() _pos = self.Head.ReadData(_lpData, _pos) self.ItemIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.UseCnt,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.UseCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos) self.ExData,_pos = CommFunc.ReadDWORD(_lpData, _pos) self.SelectCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) for i in range(self.SelectCount): @@ -4448,7 +4448,7 @@ length = 0 length += self.Head.GetLength() length += 1 - length += 2 + length += 4 length += 4 length += 1 for i in range(self.SelectCount): @@ -4460,7 +4460,7 @@ data = '' data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) data = CommFunc.WriteBYTE(data, self.ItemIndex) - data = CommFunc.WriteWORD(data, self.UseCnt) + data = CommFunc.WriteDWORD(data, self.UseCnt) data = CommFunc.WriteDWORD(data, self.ExData) data = CommFunc.WriteBYTE(data, self.SelectCount) for i in range(self.SelectCount): @@ -17251,6 +17251,73 @@ #------------------------------------------------------ +# B2 40 武将遣散 #tagCSHeroDismiss + +class tagCSHeroDismiss(Structure): + Head = tagHead() + Count = 0 #(WORD Count) + ItemIndexList = list() #(vector<WORD> ItemIndexList)// 武将物品所在武将背包位置索引列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB2 + self.Head.SubCmd = 0x40 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos) + for i in range(self.Count): + value,_pos=CommFunc.ReadWORD(_lpData,_pos) + self.ItemIndexList.append(value) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB2 + self.Head.SubCmd = 0x40 + self.Count = 0 + self.ItemIndexList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 2 + length += 2 * self.Count + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteWORD(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteWORD(data, self.ItemIndexList[i]) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + ItemIndexList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagCSHeroDismiss=tagCSHeroDismiss() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroDismiss.Head.Cmd,m_NAtagCSHeroDismiss.Head.SubCmd))] = m_NAtagCSHeroDismiss + + +#------------------------------------------------------ # B2 38 武将锁定 #tagCSHeroLock class tagCSHeroLock(Structure): @@ -17359,6 +17426,58 @@ #------------------------------------------------------ +# B2 39 武将重生 #tagCSHeroRebirth + +class tagCSHeroRebirth(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ItemIndex", c_ushort), #武将物品所在武将背包位置索引 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB2 + self.SubCmd = 0x39 + 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 = 0xB2 + self.SubCmd = 0x39 + self.ItemIndex = 0 + return + + def GetLength(self): + return sizeof(tagCSHeroRebirth) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B2 39 武将重生 //tagCSHeroRebirth: + Cmd:%s, + SubCmd:%s, + ItemIndex:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ItemIndex + ) + return DumpString + + +m_NAtagCSHeroRebirth=tagCSHeroRebirth() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroRebirth.Cmd,m_NAtagCSHeroRebirth.SubCmd))] = m_NAtagCSHeroRebirth + + +#------------------------------------------------------ # B2 31 武将升星 #tagCSHeroStarUP class tagCSHeroStarUP(Structure): -- Gitblit v1.8.0