From 4d48597d9f5f710edd989161d85bfdf0e3c7cb80 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 29 十月 2018 19:20:14 +0800
Subject: [PATCH] 4396 【后端】【1.2.0】仙界盛典新增广播提示

---
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py |  184 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 148 insertions(+), 36 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 0915012..1e6813d 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -17189,6 +17189,130 @@
 
 
 #------------------------------------------------------
+# A7 16 小助手设置 #tagMCLittleHelperSet
+
+class  tagMCLittleHelperFuncSet(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("SetNum", c_ubyte),    # 托管功能设置编号1~20,每个编号对应的托管功能前端自定义
+                  ("Value1", c_int),    # 自定义值1,如果存储的是勾选信息, 按二进制位存储代表是否勾选,支持31位,每位代表的含义前端自定义
+                  ("Value2", c_int),    # 自定义值2
+                  ("Value3", c_int),    # 自定义值3
+                  ("Value4", c_int),    # 自定义值4
+                  ("Value5", c_int),    # 自定义值5
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        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.SetNum = 0
+        self.Value1 = 0
+        self.Value2 = 0
+        self.Value3 = 0
+        self.Value4 = 0
+        self.Value5 = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCLittleHelperFuncSet)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A7 16 小助手设置 //tagMCLittleHelperSet:
+                                SetNum:%d,
+                                Value1:%d,
+                                Value2:%d,
+                                Value3:%d,
+                                Value4:%d,
+                                Value5:%d
+                                '''\
+                                %(
+                                self.SetNum,
+                                self.Value1,
+                                self.Value2,
+                                self.Value3,
+                                self.Value4,
+                                self.Value5
+                                )
+        return DumpString
+
+
+class  tagMCLittleHelperSet(Structure):
+    Head = tagHead()
+    FuncSetCount = 0    #(BYTE FuncSetCount)// 托管功能设置数,暂支持20个
+    FuncSetList = list()    #(vector<tagMCLittleHelperFuncSet> FuncSetList)// 托管功能设置列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA7
+        self.Head.SubCmd = 0x16
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.FuncSetCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.FuncSetCount):
+            temFuncSetList = tagMCLittleHelperFuncSet()
+            _pos = temFuncSetList.ReadData(_lpData, _pos)
+            self.FuncSetList.append(temFuncSetList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA7
+        self.Head.SubCmd = 0x16
+        self.FuncSetCount = 0
+        self.FuncSetList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        for i in range(self.FuncSetCount):
+            length += self.FuncSetList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.FuncSetCount)
+        for i in range(self.FuncSetCount):
+            data = CommFunc.WriteString(data, self.FuncSetList[i].GetLength(), self.FuncSetList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                FuncSetCount:%d,
+                                FuncSetList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.FuncSetCount,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagMCLittleHelperSet=tagMCLittleHelperSet()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLittleHelperSet.Head.Cmd,m_NAtagMCLittleHelperSet.Head.SubCmd))] = m_NAtagMCLittleHelperSet
+
+
+#------------------------------------------------------
 # A7 14 通知查询的NPC数量 #tagMCNPCCntList
 
 class  tagMCNPCCntInfo(Structure):
@@ -21687,64 +21811,52 @@
 # AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
 
 class  tagMCSuperGiftInfo(Structure):
-    Head = tagHead()
-    GiftID = 0    #(DWORD GiftID)//商品ID
-    EndtDate = ""    #(char EndtDate[10])// 结束日期 y-m-d
-    data = None
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("StartTime", c_int),    
+                  ]
 
     def __init__(self):
         self.Clear()
-        self.Head.Cmd = 0xAA
-        self.Head.SubCmd = 0x16
+        self.Cmd = 0xAA
+        self.SubCmd = 0x16
         return
 
-    def ReadData(self, _lpData, _pos=0, _Len=0):
+    def ReadData(self, stringData, _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
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
 
     def Clear(self):
-        self.Head = tagHead()
-        self.Head.Clear()
-        self.Head.Cmd = 0xAA
-        self.Head.SubCmd = 0x16
-        self.GiftID = 0
-        self.EndtDate = ""
+        self.Cmd = 0xAA
+        self.SubCmd = 0x16
+        self.StartTime = 0
         return
 
     def GetLength(self):
-        length = 0
-        length += self.Head.GetLength()
-        length += 4
-        length += 10
-
-        return length
+        return sizeof(tagMCSuperGiftInfo)
 
     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
+        return string_at(addressof(self), self.GetLength())
 
     def OutputString(self):
-        DumpString = '''
-                                Head:%s,
-                                GiftID:%d,
-                                EndtDate:%s
+        DumpString = '''// AA 16 通知超值礼包信息 //tagMCSuperGiftInfo:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                StartTime:%d
                                 '''\
                                 %(
-                                self.Head.OutputString(),
-                                self.GiftID,
-                                self.EndtDate
+                                self.Cmd,
+                                self.SubCmd,
+                                self.StartTime
                                 )
         return DumpString
 
 
 m_NAtagMCSuperGiftInfo=tagMCSuperGiftInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Head.Cmd,m_NAtagMCSuperGiftInfo.Head.SubCmd))] = m_NAtagMCSuperGiftInfo
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Cmd,m_NAtagMCSuperGiftInfo.SubCmd))] = m_NAtagMCSuperGiftInfo
 
 
 #------------------------------------------------------

--
Gitblit v1.8.0