10130 【后端】福地争夺资源功能(增加查看记录)
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("QueryType", c_ubyte), # 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地;
|
| | | ("QueryType", c_ubyte), # 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地;5-查看记录
|
| | | ("QueryValue", c_int), # 查询值,类型1时-发送目标玩家ID;3时-发送是否重新随机
|
| | | ]
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|
| | |
| | | #struct tagCGMineAreaView
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE QueryType; // 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地
|
| | | # BYTE QueryType; // 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地;5-查看记录
|
| | | # DWORD QueryValue; // 查询值,类型1时-发送目标玩家ID;3时-发送是否重新随机
|
| | | #};
|
| | | def OnMineAreaView(index, clientData, tick):
|
| | |
| | | # 退出他人福地
|
| | | elif queryType == 4:
|
| | | PyDataManager.GetDBPyMineAreaItemManager().DelViewAreaPlayerID(playerID)
|
| | | |
| | | # 查看记录
|
| | | elif queryType == 5:
|
| | | SyncAreaRecord(curPlayer)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | clientPack.AreaCount = len(clientPack.AreaList)
|
| | | return clientPack
|
| | |
|
| | | def SyncAreaRecord(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | recordMgr = PyDataManager.GetDBPyMineAreaRecordManager()
|
| | | recordList = recordMgr.playerMineRecordListDict.get(playerID, [])
|
| | | |
| | | clientPack = ChPyNetSendPack.tagGCMineAreaRecordInfo()
|
| | | clientPack.AreaRecordList = []
|
| | | for recData in recordList:
|
| | | recordInfo = ChPyNetSendPack.tagGCMineAreaRecord()
|
| | | recordInfo.RecordType = recData.RecordType
|
| | | recordInfo.TagPlayerID = recData.TagPlayerID
|
| | | recordInfo.RecordTime = recData.RecordTime
|
| | | recordInfo.MineID = recData.MineID
|
| | | clientPack.AreaRecordList.append(recordInfo)
|
| | | clientPack.RecordCount = len(clientPack.AreaRecordList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | #// B0 34 福地请求结算奖励 #tagCGMineAreaAwardGet
|
| | | #
|
| | | #struct tagCGMineAreaAwardGet
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("QueryType", c_ubyte), # 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地;
|
| | | ("QueryType", c_ubyte), # 查询同步类型:0-后端主动同步;1-查看指定福地;2-查看道友福地列表;3-查看周围随机福地列表;4-退出他人福地;5-查看记录
|
| | | ("QueryValue", c_int), # 查询值,类型1时-发送目标玩家ID;3时-发送是否重新随机
|
| | | ]
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|