From e19b08127ac798154fab5f8f11f782e54aaa025b Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期日, 05 五月 2019 14:16:36 +0800 Subject: [PATCH] 6457 缥缈仙域事件设置结束暂不做限制,防止异常导致无法结束 --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 424 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 383 insertions(+), 41 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py index 8f1ac92..23ffbe5 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 #------------------------------------------------------ @@ -3382,6 +3396,7 @@ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), ("PlayerID", c_int), # 跨服玩家ID + ("EquipClassLV", c_ubyte), #大于0为查看指定境界阶装备信息, 0为查看默认信息 ] def __init__(self): @@ -3399,6 +3414,7 @@ self.Cmd = 0xC0 self.SubCmd = 0x02 self.PlayerID = 0 + self.EquipClassLV = 0 return def GetLength(self): @@ -3411,12 +3427,14 @@ DumpString = '''// C0 02 查看跨服玩家信息 //tagCGViewCrossPlayerInfo: Cmd:%s, SubCmd:%s, - PlayerID:%d + PlayerID:%d, + EquipClassLV:%d '''\ %( self.Cmd, self.SubCmd, - self.PlayerID + self.PlayerID, + self.EquipClassLV ) return DumpString @@ -4152,6 +4170,58 @@ m_NAtagCMTouchNPC=tagCMTouchNPC() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTouchNPC.Cmd,m_NAtagCMTouchNPC.SubCmd))] = m_NAtagCMTouchNPC + + +#------------------------------------------------------ +# A2 34 自定义场景中获取采集奖励 #tagCMGetCustomSceneCollectAward + +class tagCMGetCustomSceneCollectAward(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("NPCID", c_int), #采集的NPCID + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA2 + self.SubCmd = 0x34 + 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 = 0xA2 + self.SubCmd = 0x34 + self.NPCID = 0 + return + + def GetLength(self): + return sizeof(tagCMGetCustomSceneCollectAward) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A2 34 自定义场景中获取采集奖励 //tagCMGetCustomSceneCollectAward: + Cmd:%s, + SubCmd:%s, + NPCID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.NPCID + ) + return DumpString + + +m_NAtagCMGetCustomSceneCollectAward=tagCMGetCustomSceneCollectAward() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetCustomSceneCollectAward.Cmd,m_NAtagCMGetCustomSceneCollectAward.SubCmd))] = m_NAtagCMGetCustomSceneCollectAward #------------------------------------------------------ @@ -5540,6 +5610,7 @@ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), ("PlayerID", c_int), + ("EquipClassLV", c_ubyte), #大于0为查看指定境界阶装备信息, 0为查看默认信息 ] def __init__(self): @@ -5557,6 +5628,7 @@ self.Cmd = 0xA2 self.SubCmd = 0x12 self.PlayerID = 0 + self.EquipClassLV = 0 return def GetLength(self): @@ -5569,18 +5641,72 @@ DumpString = '''//A2 12 查看玩家详细信息//tagCMViewPlayerInfo: Cmd:%s, SubCmd:%s, - PlayerID:%d + PlayerID:%d, + EquipClassLV:%d '''\ %( self.Cmd, self.SubCmd, - self.PlayerID + self.PlayerID, + self.EquipClassLV ) return DumpString m_NAtagCMViewPlayerInfo=tagCMViewPlayerInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMViewPlayerInfo.Cmd,m_NAtagCMViewPlayerInfo.SubCmd))] = m_NAtagCMViewPlayerInfo + + +#------------------------------------------------------ +# A3 17 增加果实使用上限 #tagCMAddFruitUseLimit + +class tagCMAddFruitUseLimit(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ItemID", c_int), #果实物品ID + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA3 + self.SubCmd = 0x17 + 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 = 0xA3 + self.SubCmd = 0x17 + self.ItemID = 0 + return + + def GetLength(self): + return sizeof(tagCMAddFruitUseLimit) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A3 17 增加果实使用上限 //tagCMAddFruitUseLimit: + Cmd:%s, + SubCmd:%s, + ItemID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ItemID + ) + return DumpString + + +m_NAtagCMAddFruitUseLimit=tagCMAddFruitUseLimit() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMAddFruitUseLimit.Cmd,m_NAtagCMAddFruitUseLimit.SubCmd))] = m_NAtagCMAddFruitUseLimit #------------------------------------------------------ @@ -10120,8 +10246,8 @@ _fields_ = [ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), - ("RefineNum", c_ushort), # 配方编号 - ("UseRateItem", c_int), # 附加材料ID + ("AlchemyID", c_int), # 丹药ID + ("DoType", c_ubyte), # 0-学习 1-开始炼丹 2-停止炼丹 3-开炉取丹 ] def __init__(self): @@ -10138,8 +10264,8 @@ def Clear(self): self.Cmd = 0xA5 self.SubCmd = 0x76 - self.RefineNum = 0 - self.UseRateItem = 0 + self.AlchemyID = 0 + self.DoType = 0 return def GetLength(self): @@ -10152,14 +10278,14 @@ DumpString = '''// A5 76 玩家炼丹 //tagCMPlayerRefine: Cmd:%s, SubCmd:%s, - RefineNum:%d, - UseRateItem:%d + AlchemyID:%d, + DoType:%d '''\ %( self.Cmd, self.SubCmd, - self.RefineNum, - self.UseRateItem + self.AlchemyID, + self.DoType ) return DumpString @@ -10874,6 +11000,58 @@ #------------------------------------------------------ +# A5 16 选择技能五行专精 #tagCMSelectSkillElement + +class tagCMSelectSkillElement(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("SkillTypeID", c_int), # 专精技能ID + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA5 + self.SubCmd = 0x16 + 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 = 0xA5 + self.SubCmd = 0x16 + self.SkillTypeID = 0 + return + + def GetLength(self): + return sizeof(tagCMSelectSkillElement) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A5 16 选择技能五行专精 //tagCMSelectSkillElement: + Cmd:%s, + SubCmd:%s, + SkillTypeID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.SkillTypeID + ) + return DumpString + + +m_NAtagCMSelectSkillElement=tagCMSelectSkillElement() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSelectSkillElement.Cmd,m_NAtagCMSelectSkillElement.SubCmd))] = m_NAtagCMSelectSkillElement + + +#------------------------------------------------------ # A5 17 绑玉转盘开始 #tagCMStartBindJadeWheel class tagCMStartBindJadeWheel(Structure): @@ -10967,6 +11145,58 @@ m_NAtagCMTakeOutRealmExp=tagCMTakeOutRealmExp() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTakeOutRealmExp.Cmd,m_NAtagCMTakeOutRealmExp.SubCmd))] = m_NAtagCMTakeOutRealmExp + + +#------------------------------------------------------ +# A5 12 感应法宝 #tagCMThinkMagicWeapon + +class tagCMThinkMagicWeapon(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("MWID", c_int), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xA5 + self.SubCmd = 0x12 + 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 = 0xA5 + self.SubCmd = 0x12 + self.MWID = 0 + return + + def GetLength(self): + return sizeof(tagCMThinkMagicWeapon) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A5 12 感应法宝 //tagCMThinkMagicWeapon: + Cmd:%s, + SubCmd:%s, + MWID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.MWID + ) + return DumpString + + +m_NAtagCMThinkMagicWeapon=tagCMThinkMagicWeapon() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMThinkMagicWeapon.Cmd,m_NAtagCMThinkMagicWeapon.SubCmd))] = m_NAtagCMThinkMagicWeapon #------------------------------------------------------ @@ -13491,6 +13721,62 @@ #------------------------------------------------------ +# B1 0A 副本购买buff #tagCMFBBuyBuff + +class tagCMFBBuyBuff(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("MapID", c_int), + ("MoneyCnt", c_ushort), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB1 + self.SubCmd = 0x0A + 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 = 0xB1 + self.SubCmd = 0x0A + self.MapID = 0 + self.MoneyCnt = 0 + return + + def GetLength(self): + return sizeof(tagCMFBBuyBuff) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 0A 副本购买buff //tagCMFBBuyBuff: + Cmd:%s, + SubCmd:%s, + MapID:%d, + MoneyCnt:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.MapID, + self.MoneyCnt + ) + return DumpString + + +m_NAtagCMFBBuyBuff=tagCMFBBuyBuff() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFBBuyBuff.Cmd,m_NAtagCMFBBuyBuff.SubCmd))] = m_NAtagCMFBBuyBuff + + +#------------------------------------------------------ # B1 09 结算自定义副本奖励 #tagCMGiveCustomFBPrize class tagCMGiveCustomFBPrize(Structure): @@ -14231,6 +14517,62 @@ #------------------------------------------------------ +# B4 0C 召唤私有专属木桩怪 #tagCMSummonPriWoodPile + +class tagCMSummonPriWoodPile(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("NPCID", c_int), + ("Count", c_ubyte), #默认1个,最多5个 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x0C + 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 = 0xB4 + self.SubCmd = 0x0C + self.NPCID = 0 + self.Count = 0 + return + + def GetLength(self): + return sizeof(tagCMSummonPriWoodPile) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 0C 召唤私有专属木桩怪 //tagCMSummonPriWoodPile: + Cmd:%s, + SubCmd:%s, + NPCID:%d, + Count:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.NPCID, + self.Count + ) + return DumpString + + +m_NAtagCMSummonPriWoodPile=tagCMSummonPriWoodPile() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSummonPriWoodPile.Cmd,m_NAtagCMSummonPriWoodPile.SubCmd))] = m_NAtagCMSummonPriWoodPile + + +#------------------------------------------------------ #B4 06 战斗移动 # tagCMFightMove class tagCMFightMove(Structure): -- Gitblit v1.8.0