From 73f586a3147b956b81e56aa6c6ffdfefa4cff1cc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 12 九月 2018 11:52:56 +0800
Subject: [PATCH] 3414 【后端】骑宠争夺boss血量成长

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py |  529 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 502 insertions(+), 27 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 610934e..9ba4a46 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -311,60 +311,78 @@
 #A0 05 同步开服天数 #tagOpenServerDay
 
 class  tagOpenServerDay(Structure):
-    _pack_ = 1
-    _fields_ = [
-                  ("Cmd", c_ubyte),
-                  ("SubCmd", c_ubyte),
-                  ("Day", c_ushort),    # 已开服天数,从0开始
-                  ("IsMixServer", c_ubyte),    #是否是合服服务器
-                  ("MixDay", c_ushort),    # 已合服天数,从0开始
-                  ]
+    Head = tagHead()
+    Day = 0    #(WORD Day)// 已开服天数,从0开始
+    IsMixServer = 0    #(BYTE IsMixServer)//是否是合服服务器
+    MixDay = 0    #(WORD MixDay)// 已合服天数,从0开始
+    OpenServerTime = ""    #(char OpenServerTime[19])//开服时间yyyy-MM-dd HH:mm:ss
+    data = None
 
     def __init__(self):
         self.Clear()
-        self.Cmd = 0xA0
-        self.SubCmd = 0x05
+        self.Head.Cmd = 0xA0
+        self.Head.SubCmd = 0x05
         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.Day,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.IsMixServer,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.MixDay,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.OpenServerTime,_pos = CommFunc.ReadString(_lpData, _pos,19)
+        return _pos
 
     def Clear(self):
-        self.Cmd = 0xA0
-        self.SubCmd = 0x05
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA0
+        self.Head.SubCmd = 0x05
         self.Day = 0
         self.IsMixServer = 0
         self.MixDay = 0
+        self.OpenServerTime = ""
         return
 
     def GetLength(self):
-        return sizeof(tagOpenServerDay)
+        length = 0
+        length += self.Head.GetLength()
+        length += 2
+        length += 1
+        length += 2
+        length += 19
+
+        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.WriteWORD(data, self.Day)
+        data = CommFunc.WriteBYTE(data, self.IsMixServer)
+        data = CommFunc.WriteWORD(data, self.MixDay)
+        data = CommFunc.WriteString(data, 19, self.OpenServerTime)
+        return data
 
     def OutputString(self):
-        DumpString = '''//A0 05 同步开服天数 //tagOpenServerDay:
-                                Cmd:%s,
-                                SubCmd:%s,
+        DumpString = '''
+                                Head:%s,
                                 Day:%d,
                                 IsMixServer:%d,
-                                MixDay:%d
+                                MixDay:%d,
+                                OpenServerTime:%s
                                 '''\
                                 %(
-                                self.Cmd,
-                                self.SubCmd,
+                                self.Head.OutputString(),
                                 self.Day,
                                 self.IsMixServer,
-                                self.MixDay
+                                self.MixDay,
+                                self.OpenServerTime
                                 )
         return DumpString
 
 
 m_NAtagOpenServerDay=tagOpenServerDay()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagOpenServerDay.Cmd,m_NAtagOpenServerDay.SubCmd))] = m_NAtagOpenServerDay
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagOpenServerDay.Head.Cmd,m_NAtagOpenServerDay.Head.SubCmd))] = m_NAtagOpenServerDay
 
 
 #------------------------------------------------------
@@ -4237,6 +4255,162 @@
 
 
 #------------------------------------------------------
+# AC 10 仙盟抢Boss所有Boss伤血进度信息 #tagGCAllFamilyBossHurtInfoList
+
+class  tagGCFamilyBossHurtInfo(Structure):
+    NPCID = 0    #(DWORD NPCID)
+    CurHP = 0    #(DWORD CurHP)
+    CurHPEx = 0    #(DWORD CurHPEx)
+    MaxHP = 0    #(DWORD MaxHP)
+    MaxHPEx = 0    #(DWORD MaxHPEx)
+    FamilyID = 0    #(DWORD FamilyID)// 最大实时伤血仙盟
+    NameLen = 0    #(BYTE NameLen)
+    FamilyName = ""    #(String FamilyName)
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        self.NPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CurHP,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CurHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.MaxHP,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.MaxHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.FamilyID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.NameLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.FamilyName,_pos = CommFunc.ReadString(_lpData, _pos,self.NameLen)
+        return _pos
+
+    def Clear(self):
+        self.NPCID = 0
+        self.CurHP = 0
+        self.CurHPEx = 0
+        self.MaxHP = 0
+        self.MaxHPEx = 0
+        self.FamilyID = 0
+        self.NameLen = 0
+        self.FamilyName = ""
+        return
+
+    def GetLength(self):
+        length = 0
+        length += 4
+        length += 4
+        length += 4
+        length += 4
+        length += 4
+        length += 4
+        length += 1
+        length += len(self.FamilyName)
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteDWORD(data, self.NPCID)
+        data = CommFunc.WriteDWORD(data, self.CurHP)
+        data = CommFunc.WriteDWORD(data, self.CurHPEx)
+        data = CommFunc.WriteDWORD(data, self.MaxHP)
+        data = CommFunc.WriteDWORD(data, self.MaxHPEx)
+        data = CommFunc.WriteDWORD(data, self.FamilyID)
+        data = CommFunc.WriteBYTE(data, self.NameLen)
+        data = CommFunc.WriteString(data, self.NameLen, self.FamilyName)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                NPCID:%d,
+                                CurHP:%d,
+                                CurHPEx:%d,
+                                MaxHP:%d,
+                                MaxHPEx:%d,
+                                FamilyID:%d,
+                                NameLen:%d,
+                                FamilyName:%s
+                                '''\
+                                %(
+                                self.NPCID,
+                                self.CurHP,
+                                self.CurHPEx,
+                                self.MaxHP,
+                                self.MaxHPEx,
+                                self.FamilyID,
+                                self.NameLen,
+                                self.FamilyName
+                                )
+        return DumpString
+
+
+class  tagGCAllFamilyBossHurtInfoList(Structure):
+    Head = tagHead()
+    NPCCount = 0    #(BYTE NPCCount)// 个数
+    NPCHurtInfo = list()    #(vector<tagGCFamilyBossHurtInfo> NPCHurtInfo)// NPC伤血信息列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xAC
+        self.Head.SubCmd = 0x10
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.NPCCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.NPCCount):
+            temNPCHurtInfo = tagGCFamilyBossHurtInfo()
+            _pos = temNPCHurtInfo.ReadData(_lpData, _pos)
+            self.NPCHurtInfo.append(temNPCHurtInfo)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xAC
+        self.Head.SubCmd = 0x10
+        self.NPCCount = 0
+        self.NPCHurtInfo = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        for i in range(self.NPCCount):
+            length += self.NPCHurtInfo[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.NPCCount)
+        for i in range(self.NPCCount):
+            data = CommFunc.WriteString(data, self.NPCHurtInfo[i].GetLength(), self.NPCHurtInfo[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                NPCCount:%d,
+                                NPCHurtInfo:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.NPCCount,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagGCAllFamilyBossHurtInfoList=tagGCAllFamilyBossHurtInfoList()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCAllFamilyBossHurtInfoList.Head.Cmd,m_NAtagGCAllFamilyBossHurtInfoList.Head.SubCmd))] = m_NAtagGCAllFamilyBossHurtInfoList
+
+
+#------------------------------------------------------
 # AC 08 boss复活点数通知 #tagGCBossRebornPoint
 
 class  tagGCBossRebornPoint(Structure):
@@ -4246,6 +4420,7 @@
                   ("SubCmd", c_ubyte),
                   ("Point", c_int),    # 复活点数
                   ("TotalPoint", c_int),    # 复活总点数
+                  ("RebornCnt", c_ushort),    # 复活次数
                   ]
 
     def __init__(self):
@@ -4264,6 +4439,7 @@
         self.SubCmd = 0x08
         self.Point = 0
         self.TotalPoint = 0
+        self.RebornCnt = 0
         return
 
     def GetLength(self):
@@ -4277,13 +4453,15 @@
                                 Cmd:%s,
                                 SubCmd:%s,
                                 Point:%d,
-                                TotalPoint:%d
+                                TotalPoint:%d,
+                                RebornCnt:%d
                                 '''\
                                 %(
                                 self.Cmd,
                                 self.SubCmd,
                                 self.Point,
-                                self.TotalPoint
+                                self.TotalPoint,
+                                self.RebornCnt
                                 )
         return DumpString
 
@@ -13649,6 +13827,62 @@
 
 
 #------------------------------------------------------
+# A3 21 祈福丹药结果 #tagMCPrayElixirResult
+
+class  tagMCPrayElixirResult(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemID", c_int),    # 物品ID
+                  ("PrayCnt", c_ubyte),    # 今日祈福次数
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xA3
+        self.SubCmd = 0x21
+        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 = 0x21
+        self.ItemID = 0
+        self.PrayCnt = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCPrayElixirResult)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A3 21 祈福丹药结果 //tagMCPrayElixirResult:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemID:%d,
+                                PrayCnt:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemID,
+                                self.PrayCnt
+                                )
+        return DumpString
+
+
+m_NAtagMCPrayElixirResult=tagMCPrayElixirResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPrayElixirResult.Cmd,m_NAtagMCPrayElixirResult.SubCmd))] = m_NAtagMCPrayElixirResult
+
+
+#------------------------------------------------------
 # A3 49 资源找回次数 #tagMCRecoverNum
 
 class  tagMCRecoverNumInfo(Structure):
@@ -16346,6 +16580,183 @@
 
 m_NAtagMCDynamicBarrierState=tagMCDynamicBarrierState()
 ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCDynamicBarrierState.Head.Cmd,m_NAtagMCDynamicBarrierState.Head.SubCmd))] = m_NAtagMCDynamicBarrierState
+
+
+#------------------------------------------------------
+# A7 15 通知仙盟抢Boss伤血信息 #tagMCFamilyBossHurtList
+
+class  tagMCFamilyBossHurt(Structure):
+    FamilyID = 0    #(DWORD FamilyID)// 所属仙盟ID
+    HurtID = 0    #(DWORD HurtID)// 伤血的ID, 根据伤血类型表示不同的ID, 如仙盟ID或玩家ID
+    NameLen = 0    #(BYTE NameLen)
+    HurtName = ""    #(String HurtName)
+    HurtValue = 0    #(DWORD HurtValue)// 累计伤血,求余1亿的值
+    HurtValueEx = 0    #(DWORD HurtValueEx)// 累计伤血,整除1亿的值
+    InitTick = 0    #(DWORD InitTick)// 伤血初始tick,用于排序,先按伤血倒序排,再按tick正序排
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        self.FamilyID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.HurtID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.NameLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.HurtName,_pos = CommFunc.ReadString(_lpData, _pos,self.NameLen)
+        self.HurtValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.HurtValueEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.InitTick,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        return _pos
+
+    def Clear(self):
+        self.FamilyID = 0
+        self.HurtID = 0
+        self.NameLen = 0
+        self.HurtName = ""
+        self.HurtValue = 0
+        self.HurtValueEx = 0
+        self.InitTick = 0
+        return
+
+    def GetLength(self):
+        length = 0
+        length += 4
+        length += 4
+        length += 1
+        length += len(self.HurtName)
+        length += 4
+        length += 4
+        length += 4
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteDWORD(data, self.FamilyID)
+        data = CommFunc.WriteDWORD(data, self.HurtID)
+        data = CommFunc.WriteBYTE(data, self.NameLen)
+        data = CommFunc.WriteString(data, self.NameLen, self.HurtName)
+        data = CommFunc.WriteDWORD(data, self.HurtValue)
+        data = CommFunc.WriteDWORD(data, self.HurtValueEx)
+        data = CommFunc.WriteDWORD(data, self.InitTick)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                FamilyID:%d,
+                                HurtID:%d,
+                                NameLen:%d,
+                                HurtName:%s,
+                                HurtValue:%d,
+                                HurtValueEx:%d,
+                                InitTick:%d
+                                '''\
+                                %(
+                                self.FamilyID,
+                                self.HurtID,
+                                self.NameLen,
+                                self.HurtName,
+                                self.HurtValue,
+                                self.HurtValueEx,
+                                self.InitTick
+                                )
+        return DumpString
+
+
+class  tagMCFamilyBossHurtList(Structure):
+    Head = tagHead()
+    ObjID = 0    #(DWORD ObjID)
+    NPCID = 0    #(DWORD NPCID)
+    HurtType = 0    #(BYTE HurtType)// 0-实时仙盟伤血,1-历史仙盟伤血,2-实时玩家伤血,3-历史玩家伤血
+    IsSort = 0    #(BYTE IsSort)// 是否排序过的,一般boss被击杀后会统一同步一次排序过的最终结果,其他情况下客户端自己排序
+    HurtCount = 0    #(WORD HurtCount)// 伤血个数
+    HurtList = list()    #(vector<tagMCFamilyBossHurt> HurtList)// 伤血列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA7
+        self.Head.SubCmd = 0x15
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.ObjID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.NPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.HurtType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.IsSort,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.HurtCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        for i in range(self.HurtCount):
+            temHurtList = tagMCFamilyBossHurt()
+            _pos = temHurtList.ReadData(_lpData, _pos)
+            self.HurtList.append(temHurtList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA7
+        self.Head.SubCmd = 0x15
+        self.ObjID = 0
+        self.NPCID = 0
+        self.HurtType = 0
+        self.IsSort = 0
+        self.HurtCount = 0
+        self.HurtList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 4
+        length += 4
+        length += 1
+        length += 1
+        length += 2
+        for i in range(self.HurtCount):
+            length += self.HurtList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteDWORD(data, self.ObjID)
+        data = CommFunc.WriteDWORD(data, self.NPCID)
+        data = CommFunc.WriteBYTE(data, self.HurtType)
+        data = CommFunc.WriteBYTE(data, self.IsSort)
+        data = CommFunc.WriteWORD(data, self.HurtCount)
+        for i in range(self.HurtCount):
+            data = CommFunc.WriteString(data, self.HurtList[i].GetLength(), self.HurtList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                ObjID:%d,
+                                NPCID:%d,
+                                HurtType:%d,
+                                IsSort:%d,
+                                HurtCount:%d,
+                                HurtList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.ObjID,
+                                self.NPCID,
+                                self.HurtType,
+                                self.IsSort,
+                                self.HurtCount,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagMCFamilyBossHurtList=tagMCFamilyBossHurtList()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyBossHurtList.Head.Cmd,m_NAtagMCFamilyBossHurtList.Head.SubCmd))] = m_NAtagMCFamilyBossHurtList
 
 
 #------------------------------------------------------
@@ -20148,6 +20559,70 @@
 
 
 #------------------------------------------------------
+# AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
+
+class  tagMCSuperGiftInfo(Structure):
+    Head = tagHead()
+    GiftID = 0    #(DWORD GiftID)//商品ID
+    EndtDate = ""    #(char EndtDate[10])// 结束日期 y-m-d
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xAA
+        self.Head.SubCmd = 0x16
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.GiftID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xAA
+        self.Head.SubCmd = 0x16
+        self.GiftID = 0
+        self.EndtDate = ""
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 4
+        length += 10
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteDWORD(data, self.GiftID)
+        data = CommFunc.WriteString(data, 10, self.EndtDate)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                GiftID:%d,
+                                EndtDate:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.GiftID,
+                                self.EndtDate
+                                )
+        return DumpString
+
+
+m_NAtagMCSuperGiftInfo=tagMCSuperGiftInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Head.Cmd,m_NAtagMCSuperGiftInfo.Head.SubCmd))] = m_NAtagMCSuperGiftInfo
+
+
+#------------------------------------------------------
 #AA 01 累计登陆天数信息 #tagMCTotalLoginDayCntInfo
 
 class  tagMCTotalLoginDayCntInfo(Structure):

--
Gitblit v1.8.0