From 33542be4f0fc94d625546a860460e8da8a308f79 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 06 十二月 2018 10:20:43 +0800
Subject: [PATCH] 2582 【1.3】【1.3.100】提供个boss状态查询包,由前端自行判断异常情况进行查询同步boss状态
---
ServerPython/CoreServerGroup/GameServer/PyNetPack.ini | 6 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 67 ++++++++++++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 67 ++++++++++++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py | 14 ++++
4 files changed, 153 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini b/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
index 3a5b702..6317eef 100644
--- a/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
+++ b/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
@@ -327,7 +327,7 @@
Writer = xdh
Releaser = xdh
RegType = 0
-RegisterPackCount = 3
+RegisterPackCount = 4
PacketCMD_1=0xA9
PacketSubCMD_1=0x03
@@ -341,6 +341,10 @@
PacketSubCMD_3=0x05
PacketCallFunc_3=OnCallupFamilyMemberToBoss
+PacketCMD_4=0xA9
+PacketSubCMD_4=0x04
+PacketCallFunc_4=OnQueryBossInfo
+
[PlayerXMZZ]
ScriptName = Player\PlayerXMZZ.py
Writer = xdh
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index e48c4cf..358af9c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -1234,6 +1234,73 @@
#------------------------------------------------------
+# A9 04 查询boss信息 #tagCGQueryBossInfo
+
+class tagCGQueryBossInfo(Structure):
+ Head = tagHead()
+ Count = 0 #(BYTE Count)//数量
+ BossIDList = list() #(vector<DWORD> BossIDList)//boosid
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x04
+ 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.ReadDWORD(_lpData,_pos)
+ self.BossIDList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x04
+ self.Count = 0
+ self.BossIDList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ 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.WriteDWORD(data, self.BossIDList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ BossIDList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagCGQueryBossInfo=tagCGQueryBossInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryBossInfo.Head.Cmd,m_NAtagCGQueryBossInfo.Head.SubCmd))] = m_NAtagCGQueryBossInfo
+
+
+#------------------------------------------------------
#A9 A1 查询玩家补偿#tagCGQueryCompensation
class tagCGQueryCompensation(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index a0734dc..733998b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -306,6 +306,20 @@
#
# return
+#// A9 04 查询boss信息 #tagCGQueryBossInfo
+#
+#
+#struct tagCGQueryBossInfo
+#{
+# tagHead Head;
+# BYTE Count; //数量
+# DWORD BossIDList[Count]; //boosid
+#};
+def OnQueryBossInfo(index, clientData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ bossIDList = clientData.BossIDList
+ Sync_BossInfo(curPlayer, bossIDList)
+ return
## 同步boss相关信息
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index e48c4cf..358af9c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -1234,6 +1234,73 @@
#------------------------------------------------------
+# A9 04 查询boss信息 #tagCGQueryBossInfo
+
+class tagCGQueryBossInfo(Structure):
+ Head = tagHead()
+ Count = 0 #(BYTE Count)//数量
+ BossIDList = list() #(vector<DWORD> BossIDList)//boosid
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x04
+ 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.ReadDWORD(_lpData,_pos)
+ self.BossIDList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x04
+ self.Count = 0
+ self.BossIDList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ 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.WriteDWORD(data, self.BossIDList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ BossIDList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagCGQueryBossInfo=tagCGQueryBossInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryBossInfo.Head.Cmd,m_NAtagCGQueryBossInfo.Head.SubCmd))] = m_NAtagCGQueryBossInfo
+
+
+#------------------------------------------------------
#A9 A1 查询玩家补偿#tagCGQueryCompensation
class tagCGQueryCompensation(Structure):
--
Gitblit v1.8.0