From b6f0e3ac8333003e9796fba713f5bfa5b5ceb90c Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 25 九月 2018 15:41:06 +0800
Subject: [PATCH] 3818【后端】击杀怪物任务条目怪物只数从玩家每日凌晨5点后第一次上线后开始计数
---
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 96 +++++++++++++++++++++++++++--------------------
1 files changed, 55 insertions(+), 41 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index a8171fe..437b971 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -311,78 +311,92 @@
#A0 05 同步开服天数 #tagOpenServerDay
class tagOpenServerDay(Structure):
- 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
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("Day", c_ushort), # 已开服天数,从0开始
+ ("IsMixServer", c_ubyte), #是否是合服服务器
+ ("MixDay", c_ushort), # 已合服天数,从0开始
+ ("OpenWeekday", c_ubyte), #开服是周几,1代表周一
+ ("NowYear", c_ushort), #服务器当前时间 - 年
+ ("NowMonth", c_ubyte),
+ ("NowDay", c_ubyte),
+ ("NowHour", c_ubyte),
+ ("NowMinute", c_ubyte),
+ ("NowSecond", c_ubyte),
+ ("NowMicSecond", c_int),
+ ]
def __init__(self):
self.Clear()
- self.Head.Cmd = 0xA0
- self.Head.SubCmd = 0x05
+ self.Cmd = 0xA0
+ self.SubCmd = 0x05
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.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
+ memmove(addressof(self), stringData[_pos:], self.GetLength())
+ return _pos + self.GetLength()
def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA0
- self.Head.SubCmd = 0x05
+ self.Cmd = 0xA0
+ self.SubCmd = 0x05
self.Day = 0
self.IsMixServer = 0
self.MixDay = 0
- self.OpenServerTime = ""
+ self.OpenWeekday = 0
+ self.NowYear = 0
+ self.NowMonth = 0
+ self.NowDay = 0
+ self.NowHour = 0
+ self.NowMinute = 0
+ self.NowSecond = 0
+ self.NowMicSecond = 0
return
def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 2
- length += 1
- length += 2
- length += 19
-
- return length
+ return sizeof(tagOpenServerDay)
def GetBuffer(self):
- 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
+ return string_at(addressof(self), self.GetLength())
def OutputString(self):
- DumpString = '''
- Head:%s,
+ DumpString = '''//A0 05 同步开服天数 //tagOpenServerDay:
+ Cmd:%s,
+ SubCmd:%s,
Day:%d,
IsMixServer:%d,
MixDay:%d,
- OpenServerTime:%s
+ OpenWeekday:%d,
+ NowYear:%d,
+ NowMonth:%d,
+ NowDay:%d,
+ NowHour:%d,
+ NowMinute:%d,
+ NowSecond:%d,
+ NowMicSecond:%d
'''\
%(
- self.Head.OutputString(),
+ self.Cmd,
+ self.SubCmd,
self.Day,
self.IsMixServer,
self.MixDay,
- self.OpenServerTime
+ self.OpenWeekday,
+ self.NowYear,
+ self.NowMonth,
+ self.NowDay,
+ self.NowHour,
+ self.NowMinute,
+ self.NowSecond,
+ self.NowMicSecond
)
return DumpString
m_NAtagOpenServerDay=tagOpenServerDay()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagOpenServerDay.Head.Cmd,m_NAtagOpenServerDay.Head.SubCmd))] = m_NAtagOpenServerDay
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagOpenServerDay.Cmd,m_NAtagOpenServerDay.SubCmd))] = m_NAtagOpenServerDay
#------------------------------------------------------
--
Gitblit v1.8.0