From 0faf0cd221e7aa589b5d085c05b84ce9ebf8631c Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 30 十月 2018 19:58:16 +0800
Subject: [PATCH] 4449 【1.2】【后端】仙盟宴会传功经验
---
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 68 +++++++++++++++-------------------
1 files changed, 30 insertions(+), 38 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index cedf488..6832b79 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -17200,6 +17200,7 @@
("Value3", c_int), # 自定义值3
("Value4", c_int), # 自定义值4
("Value5", c_int), # 自定义值5
+ ("Value6", c_int), # 自定义值6
]
def __init__(self):
@@ -17218,6 +17219,7 @@
self.Value3 = 0
self.Value4 = 0
self.Value5 = 0
+ self.Value6 = 0
return
def GetLength(self):
@@ -17233,7 +17235,8 @@
Value2:%d,
Value3:%d,
Value4:%d,
- Value5:%d
+ Value5:%d,
+ Value6:%d
'''\
%(
self.SetNum,
@@ -17241,7 +17244,8 @@
self.Value2,
self.Value3,
self.Value4,
- self.Value5
+ self.Value5,
+ self.Value6
)
return DumpString
@@ -21811,64 +21815,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