From acc7613a0305ad981b5f0018ec6e488180b6374a Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 13 二月 2019 17:54:51 +0800 Subject: [PATCH] 5940 【后端】【1.6】跨服PK奖励配置规则优化(增加跨服分区名同步) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 80 +++++++++++++++++++++++++++------------- 1 files changed, 54 insertions(+), 26 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 8ac8c37..66948d9 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -8983,64 +8983,92 @@ # C0 06 跨服PK本服赛季状态 #tagGCCrossRealmPKSeasonState class tagGCCrossRealmPKSeasonState(Structure): - _pack_ = 1 - _fields_ = [ - ("Cmd", c_ubyte), - ("SubCmd", c_ubyte), - ("ZoneID", c_ubyte), # 所属赛区ID - ("SeasonID", c_ushort), # 当前赛季ID - ("SeasonState", c_ubyte), # 赛季状态;0-未开启,1-开启中,2-已结束 - ("MatchState", c_ubyte), # 匹配状态;0-未开启;1-开启中 - ] + Head = tagHead() + ZoneID = 0 #(BYTE ZoneID)// 所属赛区ID + SeasonID = 0 #(WORD SeasonID)// 当前赛季ID + SeasonState = 0 #(BYTE SeasonState)// 赛季状态;0-未开启,1-开启中,2-已结束 + MatchState = 0 #(BYTE MatchState)// 匹配状态;0-未开启;1-开启中 + CrossZoneNameLen = 0 #(BYTE CrossZoneNameLen) + CrossZoneName = "" #(String CrossZoneName)// 跨服分区名 + data = None def __init__(self): self.Clear() - self.Cmd = 0xC0 - self.SubCmd = 0x06 + self.Head.Cmd = 0xC0 + self.Head.SubCmd = 0x06 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.ZoneID,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.SeasonID,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.SeasonState,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.MatchState,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.CrossZoneNameLen,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.CrossZoneName,_pos = CommFunc.ReadString(_lpData, _pos,self.CrossZoneNameLen) + return _pos def Clear(self): - self.Cmd = 0xC0 - self.SubCmd = 0x06 + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xC0 + self.Head.SubCmd = 0x06 self.ZoneID = 0 self.SeasonID = 0 self.SeasonState = 0 self.MatchState = 0 + self.CrossZoneNameLen = 0 + self.CrossZoneName = "" return def GetLength(self): - return sizeof(tagGCCrossRealmPKSeasonState) + length = 0 + length += self.Head.GetLength() + length += 1 + length += 2 + length += 1 + length += 1 + length += 1 + length += len(self.CrossZoneName) + + 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.WriteBYTE(data, self.ZoneID) + data = CommFunc.WriteWORD(data, self.SeasonID) + data = CommFunc.WriteBYTE(data, self.SeasonState) + data = CommFunc.WriteBYTE(data, self.MatchState) + data = CommFunc.WriteBYTE(data, self.CrossZoneNameLen) + data = CommFunc.WriteString(data, self.CrossZoneNameLen, self.CrossZoneName) + return data def OutputString(self): - DumpString = '''// C0 06 跨服PK本服赛季状态 //tagGCCrossRealmPKSeasonState: - Cmd:%s, - SubCmd:%s, + DumpString = ''' + Head:%s, ZoneID:%d, SeasonID:%d, SeasonState:%d, - MatchState:%d + MatchState:%d, + CrossZoneNameLen:%d, + CrossZoneName:%s '''\ %( - self.Cmd, - self.SubCmd, + self.Head.OutputString(), self.ZoneID, self.SeasonID, self.SeasonState, - self.MatchState + self.MatchState, + self.CrossZoneNameLen, + self.CrossZoneName ) return DumpString m_NAtagGCCrossRealmPKSeasonState=tagGCCrossRealmPKSeasonState() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCCrossRealmPKSeasonState.Cmd,m_NAtagGCCrossRealmPKSeasonState.SubCmd))] = m_NAtagGCCrossRealmPKSeasonState +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCCrossRealmPKSeasonState.Head.Cmd,m_NAtagGCCrossRealmPKSeasonState.Head.SubCmd))] = m_NAtagGCCrossRealmPKSeasonState #------------------------------------------------------ -- Gitblit v1.8.0