From c939b30761259159d62bdc92320375310b3bb010 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 22 四月 2019 21:11:16 +0800 Subject: [PATCH] 6459 【后端】【2.0】缥缈仙域开发单(查询副本功能线路人数信息逻辑修改,支持查询妖王地图) --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 128 ++++++++++++++---------------------------- 1 files changed, 43 insertions(+), 85 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py index faa9c62..d77fb5f 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py @@ -104,60 +104,74 @@ # A0 04 查询副本功能线路人数 #tagCGGetFBLinePlayerCnt class tagCGGetFBLinePlayerCnt(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("MapID", c_int), - ("FBLineID", c_ubyte), - ("IsAllLine", c_ubyte), - ] + Head = tagHead() + MapID = 0 #(DWORD MapID) + LineCount = 0 #(BYTE LineCount) + LineIDList = list() #(vector<BYTE> LineIDList)//个数为0时代表查全部 + data = None def __init__(self): self.Clear() - self.Cmd = 0xA0 - self.SubCmd = 0x04 + self.Head.Cmd = 0xA0 + self.Head.SubCmd = 0x04 return - def ReadData(self, stringData, _pos=0, _len=0): + def ReadData(self, _lpData, _pos=0, _Len=0): self.Clear() - memmove(addressof(self), stringData[_pos:], self.GetLength()) - return _pos + self.GetLength() + _pos = self.Head.ReadData(_lpData, _pos) + self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.LineCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.LineCount): + value,_pos=CommFunc.ReadBYTE(_lpData,_pos) + self.LineIDList.append(value) + return _pos def Clear(self): - self.Cmd = 0xA0 - self.SubCmd = 0x04 + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA0 + self.Head.SubCmd = 0x04 self.MapID = 0 - self.FBLineID = 0 - self.IsAllLine = 0 + self.LineCount = 0 + self.LineIDList = list() return def GetLength(self): - return sizeof(tagCGGetFBLinePlayerCnt) + length = 0 + length += self.Head.GetLength() + length += 4 + length += 1 + length += 1 * self.LineCount + + return length def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.MapID) + data = CommFunc.WriteBYTE(data, self.LineCount) + for i in range(self.LineCount): + data = CommFunc.WriteBYTE(data, self.LineIDList[i]) + return data def OutputString(self): - DumpString = '''// A0 04 查询副本功能线路人数 //tagCGGetFBLinePlayerCnt: - Cmd:%s, - SubCmd:%s, + DumpString = ''' + Head:%s, MapID:%d, - FBLineID:%d, - IsAllLine:%d + LineCount:%d, + LineIDList:%s '''\ %( - self.Cmd, - self.SubCmd, + self.Head.OutputString(), self.MapID, - self.FBLineID, - self.IsAllLine + self.LineCount, + "..." ) return DumpString m_NAtagCGGetFBLinePlayerCnt=tagCGGetFBLinePlayerCnt() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Cmd,m_NAtagCGGetFBLinePlayerCnt.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGGetFBLinePlayerCnt.Head.Cmd,m_NAtagCGGetFBLinePlayerCnt.Head.SubCmd))] = m_NAtagCGGetFBLinePlayerCnt #------------------------------------------------------ @@ -1346,62 +1360,6 @@ m_NAtagCGQueryCompensation=tagCGQueryCompensation() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryCompensation.Cmd,m_NAtagCGQueryCompensation.SubCmd))] = m_NAtagCGQueryCompensation - - -#------------------------------------------------------ -# A9 05 查询副本功能线路当前玩家数 #tagCGQueryFBFuncLinePlayerCount - -class tagCGQueryFBFuncLinePlayerCount(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("MapID", c_int), - ("FuncLineID", c_ubyte), - ] - - def __init__(self): - self.Clear() - self.Cmd = 0xA9 - self.SubCmd = 0x05 - 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 = 0xA9 - self.SubCmd = 0x05 - self.MapID = 0 - self.FuncLineID = 0 - return - - def GetLength(self): - return sizeof(tagCGQueryFBFuncLinePlayerCount) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// A9 05 查询副本功能线路当前玩家数 //tagCGQueryFBFuncLinePlayerCount: - Cmd:%s, - SubCmd:%s, - MapID:%d, - FuncLineID:%d - '''\ - %( - self.Cmd, - self.SubCmd, - self.MapID, - self.FuncLineID - ) - return DumpString - - -m_NAtagCGQueryFBFuncLinePlayerCount=tagCGQueryFBFuncLinePlayerCount() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryFBFuncLinePlayerCount.Cmd,m_NAtagCGQueryFBFuncLinePlayerCount.SubCmd))] = m_NAtagCGQueryFBFuncLinePlayerCount #------------------------------------------------------ -- Gitblit v1.8.0