From 403e958e2636d4c1847f4dd1cf40f47dd1cfe63d Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 07 三月 2024 20:26:45 +0800 Subject: [PATCH] 10130 【后端】福地争夺资源功能(增加查看记录) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 116 insertions(+), 0 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 540dd44..92c0aa1 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -8076,6 +8076,122 @@ #------------------------------------------------------ +# B0 35 福地记录信息 #tagGCMineAreaRecordInfo + +class tagGCMineAreaRecord(Structure): + _pack_ = 1 + _fields_ = [ + ("RecordType", c_ubyte), # 记录类型;1-自己拉物品;2-物品被人抢 + ("TagPlayerID", c_int), # 目标玩家ID,等于自己玩家ID时代表拉自己的,反之为抢别人的 + ("RecordTime", c_int), # 记录时间戳 + ("MineID", c_ushort), # 矿物ID,对应福地采集表中ID + ] + + def __init__(self): + self.Clear() + 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.RecordType = 0 + self.TagPlayerID = 0 + self.RecordTime = 0 + self.MineID = 0 + return + + def GetLength(self): + return sizeof(tagGCMineAreaRecord) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B0 35 福地记录信息 //tagGCMineAreaRecordInfo: + RecordType:%d, + TagPlayerID:%d, + RecordTime:%d, + MineID:%d + '''\ + %( + self.RecordType, + self.TagPlayerID, + self.RecordTime, + self.MineID + ) + return DumpString + + +class tagGCMineAreaRecordInfo(Structure): + Head = tagHead() + RecordCount = 0 #(BYTE RecordCount) + AreaRecordList = list() #(vector<tagGCMineAreaRecord> AreaRecordList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB0 + self.Head.SubCmd = 0x35 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.RecordCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.RecordCount): + temAreaRecordList = tagGCMineAreaRecord() + _pos = temAreaRecordList.ReadData(_lpData, _pos) + self.AreaRecordList.append(temAreaRecordList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB0 + self.Head.SubCmd = 0x35 + self.RecordCount = 0 + self.AreaRecordList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.RecordCount): + length += self.AreaRecordList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.RecordCount) + for i in range(self.RecordCount): + data = CommFunc.WriteString(data, self.AreaRecordList[i].GetLength(), self.AreaRecordList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + RecordCount:%d, + AreaRecordList:%s + '''\ + %( + self.Head.OutputString(), + self.RecordCount, + "..." + ) + return DumpString + + +m_NAtagGCMineAreaRecordInfo=tagGCMineAreaRecordInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCMineAreaRecordInfo.Head.Cmd,m_NAtagGCMineAreaRecordInfo.Head.SubCmd))] = m_NAtagGCMineAreaRecordInfo + + +#------------------------------------------------------ # B0 32 福地物品拉预览结果 #tagGCMineItemPullPreviewRet class tagGCMineItemPullPreviewRet(Structure): -- Gitblit v1.8.0