From b1bb52bb7c6e5c36471140bf383be02d35fe92d4 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期五, 11 一月 2019 22:34:21 +0800 Subject: [PATCH] 2857 【BUG】【1.5】采集被打断问题 --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 127 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 126 insertions(+), 1 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py index 990f186..e5ced2e 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py @@ -3259,6 +3259,54 @@ #------------------------------------------------------ +# A1 08 刷新主服角色信息 #tagCMRefreshMainServerRole + +class tagCMRefreshMainServerRole(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA1 + self.SubCmd = 0x08 + 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 = 0xA1 + self.SubCmd = 0x08 + return + + def GetLength(self): + return sizeof(tagCMRefreshMainServerRole) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A1 08 刷新主服角色信息 //tagCMRefreshMainServerRole: + Cmd:%s, + SubCmd:%s + '''\ + %( + self.Cmd, + self.SubCmd + ) + return DumpString + + +m_NAtagCMRefreshMainServerRole=tagCMRefreshMainServerRole() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRefreshMainServerRole.Cmd,m_NAtagCMRefreshMainServerRole.SubCmd))] = m_NAtagCMRefreshMainServerRole + + +#------------------------------------------------------ #A1 03 设置是否成年 #tagCMAdult class tagCMAdult(Structure): @@ -8176,6 +8224,83 @@ #------------------------------------------------------ +# A5 20 时装分解 #tagCMCoatDecompose + +class tagCMCoatDecompose(Structure): + Head = tagHead() + Count = 0 #(BYTE Count)//材料所在背包索引的数量 + IndexList = list() #(vector<WORD> IndexList)//材料所在背包索引列表 + ItemIDList = list() #(vector<DWORD> ItemIDList)//材料所在背包物品ID列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA5 + self.Head.SubCmd = 0x20 + 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): + value,_pos=CommFunc.ReadWORD(_lpData,_pos) + self.IndexList.append(value) + for i in range(self.Count): + value,_pos=CommFunc.ReadDWORD(_lpData,_pos) + self.ItemIDList.append(value) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA5 + self.Head.SubCmd = 0x20 + self.Count = 0 + self.IndexList = list() + self.ItemIDList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += 2 * self.Count + length += 4 * self.Count + + 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.WriteWORD(data, self.IndexList[i]) + for i in range(self.Count): + data = CommFunc.WriteDWORD(data, self.ItemIDList[i]) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + IndexList:%s, + ItemIDList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "...", + "..." + ) + return DumpString + + +m_NAtagCMCoatDecompose=tagCMCoatDecompose() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCoatDecompose.Head.Cmd,m_NAtagCMCoatDecompose.Head.SubCmd))] = m_NAtagCMCoatDecompose + + +#------------------------------------------------------ # A5 0B 玩家时装升级 #tagCMCoatUp class tagCMCoatUp(Structure): @@ -8183,7 +8308,7 @@ _fields_ = [ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), - ("CoatIndex", c_ubyte), # 时装索引 + ("CoatIndex", c_int), # 时装索引 ] def __init__(self): -- Gitblit v1.8.0