Files
JJBB/Assets/Project/Script/LuaScripts/NetWork/Lua/Distributes/LuaDistributesSyncMazeInfo.txt
2024-08-23 15:49:34 +08:00

52 lines
1.4 KiB
Plaintext

LuaDistributesSyncMazeInfo = {}
LuaDistributesSyncMazeInfo.sysID = 53
LuaDistributesSyncMazeInfo.cmdID = 4
function LuaDistributesSyncMazeInfo.ExtraPacket(memStream)
-- print('ExtraPacket:'..memStream.Length)
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
local sysID = binaryReader:ReadByte()
local cmdID = binaryReader:ReadByte()
packet = LuaDistributesSyncMazeInfo.ReadPacket(binaryReader)
return packet
end
function LuaDistributesSyncMazeInfo.SendPacket(packet)
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesSyncMazeInfo.sysID, LuaDistributesSyncMazeInfo.cmdID)
if(packet['finishCount'] == nil) then
packet['finishCount'] = 0
end
message:WriteInt(packet['finishCount'])
if(systemRecord == nil) then
systemRecord = {}
end
message:WriteInt(#packet['systemRecord'])
for k,v in ipairs(packet['systemRecord']) do
require "LuaDistributessystemRecordList"
LuaDistributessystemRecordList.WritePacket(v, binaryWriter)
end
message:Send()
end
function LuaDistributesSyncMazeInfo.ReadPacket(binaryReader)
local packet = {}
packet['finishCount'] = binaryReader:ReadInt32()
packet['systemRecord'] = {}
local systemRecordCnt = binaryReader:ReadInt32()
for i=1,systemRecordCnt,1 do
require "LuaDistributessystemRecordList"
packet['systemRecord'][i] = LuaDistributessystemRecordList.ReadPacket(binaryReader)
end
return packet
end