149 lines
3.6 KiB
Plaintext
149 lines
3.6 KiB
Plaintext
LuaDistributesMazeInfoRsp = {}
|
|
|
|
LuaDistributesMazeInfoRsp.sysID = 53
|
|
LuaDistributesMazeInfoRsp.cmdID = 3
|
|
|
|
function LuaDistributesMazeInfoRsp.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesMazeInfoRsp.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesMazeInfoRsp.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesMazeInfoRsp.sysID, LuaDistributesMazeInfoRsp.cmdID)
|
|
if(packet['freeCount'] == nil) then
|
|
packet['freeCount'] = 0
|
|
end
|
|
message:WriteInt(packet['freeCount'])
|
|
|
|
if(packet['useCount'] == nil) then
|
|
packet['useCount'] = 0
|
|
end
|
|
message:WriteInt(packet['useCount'])
|
|
|
|
if(packet['stepNumber'] == nil) then
|
|
packet['stepNumber'] = 0
|
|
end
|
|
message:WriteInt(packet['stepNumber'])
|
|
|
|
if(packet['finishCount'] == nil) then
|
|
packet['finishCount'] = 0
|
|
end
|
|
message:WriteInt(packet['finishCount'])
|
|
|
|
if(mazeRecord == nil) then
|
|
mazeRecord = {}
|
|
end
|
|
message:WriteInt(#packet['mazeRecord'])
|
|
for k,v in ipairs(packet['mazeRecord']) do
|
|
require "LuaDistributesmazeRecordList"
|
|
LuaDistributesmazeRecordList.WritePacket(v, binaryWriter)
|
|
|
|
end
|
|
|
|
if(pathWay == nil) then
|
|
pathWay = {}
|
|
end
|
|
message:WriteInt(#packet['pathWay'])
|
|
for k,v in ipairs(packet['pathWay']) do
|
|
require "LuaDistributespathWayList"
|
|
LuaDistributespathWayList.WritePacket(v, binaryWriter)
|
|
|
|
end
|
|
|
|
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
|
|
|
|
if(packet['ConsumeType'] == nil) then
|
|
packet['ConsumeType'] = 0
|
|
end
|
|
message:WriteInt(packet['ConsumeType'])
|
|
|
|
if(packet['ConsumeSubType'] == nil) then
|
|
packet['ConsumeSubType'] = 0
|
|
end
|
|
message:WriteInt(packet['ConsumeSubType'])
|
|
|
|
if(packet['ConsumeNum'] == nil) then
|
|
packet['ConsumeNum'] = 0
|
|
end
|
|
message:WriteInt(packet['ConsumeNum'])
|
|
|
|
if(packet['number'] == nil) then
|
|
packet['number'] = 0
|
|
end
|
|
message:WriteInt(packet['number'])
|
|
|
|
if(packet['freeCountLimit'] == nil) then
|
|
packet['freeCountLimit'] = 0
|
|
end
|
|
message:WriteInt(packet['freeCountLimit'])
|
|
|
|
if(packet['cycleTime'] == nil) then
|
|
packet['cycleTime'] = 0
|
|
end
|
|
message:WriteInt(packet['cycleTime'])
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesMazeInfoRsp.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['freeCount'] = binaryReader:ReadInt32()
|
|
|
|
packet['useCount'] = binaryReader:ReadInt32()
|
|
|
|
packet['stepNumber'] = binaryReader:ReadInt32()
|
|
|
|
packet['finishCount'] = binaryReader:ReadInt32()
|
|
|
|
packet['mazeRecord'] = {}
|
|
local mazeRecordCnt = binaryReader:ReadInt32()
|
|
for i=1,mazeRecordCnt,1 do
|
|
require "LuaDistributesmazeRecordList"
|
|
packet['mazeRecord'][i] = LuaDistributesmazeRecordList.ReadPacket(binaryReader)
|
|
|
|
end
|
|
packet['pathWay'] = {}
|
|
local pathWayCnt = binaryReader:ReadInt32()
|
|
for i=1,pathWayCnt,1 do
|
|
require "LuaDistributespathWayList"
|
|
packet['pathWay'][i] = LuaDistributespathWayList.ReadPacket(binaryReader)
|
|
|
|
end
|
|
packet['systemRecord'] = {}
|
|
local systemRecordCnt = binaryReader:ReadInt32()
|
|
for i=1,systemRecordCnt,1 do
|
|
require "LuaDistributessystemRecordList"
|
|
packet['systemRecord'][i] = LuaDistributessystemRecordList.ReadPacket(binaryReader)
|
|
|
|
end
|
|
packet['ConsumeType'] = binaryReader:ReadInt32()
|
|
|
|
packet['ConsumeSubType'] = binaryReader:ReadInt32()
|
|
|
|
packet['ConsumeNum'] = binaryReader:ReadInt32()
|
|
|
|
packet['number'] = binaryReader:ReadInt32()
|
|
|
|
packet['freeCountLimit'] = binaryReader:ReadInt32()
|
|
|
|
packet['cycleTime'] = binaryReader:ReadInt32()
|
|
|
|
|
|
return packet
|
|
end |