From 2e1b0969fb141b9677230a56f9c29020362a5eab Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 03 九月 2018 15:08:01 +0800
Subject: [PATCH] Fix: 1819 玩家切地图,家族等级数据同步会异常(修复仙盟心法切图后无法升级的bug);
---
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 58 +++++++++++++++++++++++++++++++++-------------------------
1 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index fabb438..908d399 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -20484,56 +20484,64 @@
# AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
class tagMCSuperGiftInfo(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("GiftID", c_int), #商品ID
- ("RemainDay", c_ubyte), #剩余天数
- ]
+ Head = tagHead()
+ GiftID = 0 #(DWORD GiftID)//商品ID
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ data = None
def __init__(self):
self.Clear()
- self.Cmd = 0xAA
- self.SubCmd = 0x16
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x16
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.GiftID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ return _pos
def Clear(self):
- self.Cmd = 0xAA
- self.SubCmd = 0x16
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x16
self.GiftID = 0
- self.RemainDay = 0
+ self.EndtDate = ""
return
def GetLength(self):
- return sizeof(tagMCSuperGiftInfo)
+ length = 0
+ length += self.Head.GetLength()
+ length += 4
+ length += 10
+
+ 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.GiftID)
+ data = CommFunc.WriteString(data, 10, self.EndtDate)
+ return data
def OutputString(self):
- DumpString = '''// AA 16 通知超值礼包信息 //tagMCSuperGiftInfo:
- Cmd:%s,
- SubCmd:%s,
+ DumpString = '''
+ Head:%s,
GiftID:%d,
- RemainDay:%d
+ EndtDate:%s
'''\
%(
- self.Cmd,
- self.SubCmd,
+ self.Head.OutputString(),
self.GiftID,
- self.RemainDay
+ self.EndtDate
)
return DumpString
m_NAtagMCSuperGiftInfo=tagMCSuperGiftInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Cmd,m_NAtagMCSuperGiftInfo.SubCmd))] = m_NAtagMCSuperGiftInfo
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Head.Cmd,m_NAtagMCSuperGiftInfo.Head.SubCmd))] = m_NAtagMCSuperGiftInfo
#------------------------------------------------------
--
Gitblit v1.8.0