From 01e033a79a5ce63e298015d0783560a77ccffea9 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 14 九月 2018 11:46:46 +0800
Subject: [PATCH] fix:3543 【后端】【主干】【1.0.15】开服红包优化 每天赠送次数

---
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py |  196 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 169 insertions(+), 27 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index d989dba..9ba4a46 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/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
 
 
 #------------------------------------------------------
@@ -4402,6 +4420,7 @@
                   ("SubCmd", c_ubyte),
                   ("Point", c_int),    # 复活点数
                   ("TotalPoint", c_int),    # 复活总点数
+                  ("RebornCnt", c_ushort),    # 复活次数
                   ]
 
     def __init__(self):
@@ -4420,6 +4439,7 @@
         self.SubCmd = 0x08
         self.Point = 0
         self.TotalPoint = 0
+        self.RebornCnt = 0
         return
 
     def GetLength(self):
@@ -4433,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
 
@@ -13805,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):
@@ -20481,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