From f8c4038119f81caeb58f9d28ca73478bb6c9a0fe Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 26 九月 2018 21:19:22 +0800 Subject: [PATCH] 3878 【后端】神兽装备评分参数(增加真实伤害、真实抵抗参数) --- ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 205 +++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 148 insertions(+), 57 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index a8171fe..77a2b09 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 #------------------------------------------------------ @@ -2303,8 +2317,9 @@ class tagGCBossShuntLineState(Structure): BossID = 0 #(DWORD BossID)// bossID - DeadLineCount = 0 #(BYTE DeadLineCount) - DeadLineList = list() #(vector<BYTE> DeadLineList)// 已死亡的线路列表 + LineCount = 0 #(BYTE LineCount) + LineIDList = list() #(vector<BYTE> LineIDList)// 线路ID列表 + StateList = list() #(vector<BYTE> StateList)// 对应状态列表, 0-被击杀,1-活着 data = None def __init__(self): @@ -2314,43 +2329,52 @@ def ReadData(self, _lpData, _pos=0, _Len=0): self.Clear() self.BossID,_pos = CommFunc.ReadDWORD(_lpData, _pos) - self.DeadLineCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) - for i in range(self.DeadLineCount): + self.LineCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.LineCount): value,_pos=CommFunc.ReadBYTE(_lpData,_pos) - self.DeadLineList.append(value) + self.LineIDList.append(value) + for i in range(self.LineCount): + value,_pos=CommFunc.ReadBYTE(_lpData,_pos) + self.StateList.append(value) return _pos def Clear(self): self.BossID = 0 - self.DeadLineCount = 0 - self.DeadLineList = list() + self.LineCount = 0 + self.LineIDList = list() + self.StateList = list() return def GetLength(self): length = 0 length += 4 length += 1 - length += 1 * self.DeadLineCount + length += 1 * self.LineCount + length += 1 * self.LineCount return length def GetBuffer(self): data = '' data = CommFunc.WriteDWORD(data, self.BossID) - data = CommFunc.WriteBYTE(data, self.DeadLineCount) - for i in range(self.DeadLineCount): - data = CommFunc.WriteBYTE(data, self.DeadLineList[i]) + data = CommFunc.WriteBYTE(data, self.LineCount) + for i in range(self.LineCount): + data = CommFunc.WriteBYTE(data, self.LineIDList[i]) + for i in range(self.LineCount): + data = CommFunc.WriteBYTE(data, self.StateList[i]) return data def OutputString(self): DumpString = ''' BossID:%d, - DeadLineCount:%d, - DeadLineList:%s + LineCount:%d, + LineIDList:%s, + StateList:%s '''\ %( self.BossID, - self.DeadLineCount, + self.LineCount, + "...", "..." ) return DumpString @@ -2886,6 +2910,7 @@ RecordLen = 0 #(WORD RecordLen)// 长度 KillRecord = "" #(String KillRecord)// 最近击杀记录时间玩家名size = RecordLen RefreshSecond = 0 #(DWORD RefreshSecond)// 刷新倒计时, 秒 + RefreshCD = 0 #(DWORD RefreshCD)// 刷新总CD时, 秒 data = None def __init__(self): @@ -2899,6 +2924,7 @@ self.RecordLen,_pos = CommFunc.ReadWORD(_lpData, _pos) self.KillRecord,_pos = CommFunc.ReadString(_lpData, _pos,self.RecordLen) self.RefreshSecond,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.RefreshCD,_pos = CommFunc.ReadDWORD(_lpData, _pos) return _pos def Clear(self): @@ -2907,6 +2933,7 @@ self.RecordLen = 0 self.KillRecord = "" self.RefreshSecond = 0 + self.RefreshCD = 0 return def GetLength(self): @@ -2915,6 +2942,7 @@ length += 1 length += 2 length += len(self.KillRecord) + length += 4 length += 4 return length @@ -2926,6 +2954,7 @@ data = CommFunc.WriteWORD(data, self.RecordLen) data = CommFunc.WriteString(data, self.RecordLen, self.KillRecord) data = CommFunc.WriteDWORD(data, self.RefreshSecond) + data = CommFunc.WriteDWORD(data, self.RefreshCD) return data def OutputString(self): @@ -2934,14 +2963,16 @@ IsAlive:%d, RecordLen:%d, KillRecord:%s, - RefreshSecond:%d + RefreshSecond:%d, + RefreshCD:%d '''\ %( self.BossID, self.IsAlive, self.RecordLen, self.KillRecord, - self.RefreshSecond + self.RefreshSecond, + self.RefreshCD ) return DumpString @@ -22421,6 +22452,66 @@ #------------------------------------------------------ +# B1 06 通知玩家向目标点移动 #tagMCNotifyPlayerMove + +class tagMCNotifyPlayerMove(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("PosX", c_int), + ("PosY", c_int), + ("NPCID", c_int), #目标点寻路NPCID, 可能为0 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB1 + self.SubCmd = 0x06 + 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 = 0xB1 + self.SubCmd = 0x06 + self.PosX = 0 + self.PosY = 0 + self.NPCID = 0 + return + + def GetLength(self): + return sizeof(tagMCNotifyPlayerMove) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 06 通知玩家向目标点移动 //tagMCNotifyPlayerMove: + Cmd:%s, + SubCmd:%s, + PosX:%d, + PosY:%d, + NPCID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.PosX, + self.PosY, + self.NPCID + ) + return DumpString + + +m_NAtagMCNotifyPlayerMove=tagMCNotifyPlayerMove() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCNotifyPlayerMove.Cmd,m_NAtagMCNotifyPlayerMove.SubCmd))] = m_NAtagMCNotifyPlayerMove + + +#------------------------------------------------------ # B1 03 通知玩家死亡时间 #tagMCPlayerDeadTime class tagMCPlayerDeadTime(Structure): -- Gitblit v1.8.0