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

63 lines
1.5 KiB
Plaintext

LuaDistributesPropsDetailedInfo = {}
LuaDistributesPropsDetailedInfo.sysID = 0
LuaDistributesPropsDetailedInfo.cmdID = 0
function LuaDistributesPropsDetailedInfo.ExtraPacket(memStream)
-- print('ExtraPacket:'..memStream.Length)
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
local sysID = binaryReader:ReadByte()
local cmdID = binaryReader:ReadByte()
packet = LuaDistributesPropsDetailedInfo.ReadPacket(binaryReader)
return packet
end
function LuaDistributesPropsDetailedInfo.SendPacket(packet)
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesPropsDetailedInfo.sysID, LuaDistributesPropsDetailedInfo.cmdID)
if(packet['boxId'] == nil) then
packet['boxId'] = 0
end
message:WriteInt(packet['boxId'])
if(packet['state'] == nil) then
packet['state'] = 0
end
message:WriteInt(packet['state'])
if(packet['propId'] == nil) then
packet['propId'] = 0
end
message:WriteInt(packet['propId'])
if(packet['propNum'] == nil) then
packet['propNum'] = 0
end
message:WriteInt(packet['propNum'])
if(packet['isBind'] == nil) then
packet['isBind'] = 0
end
message:WriteInt(packet['isBind'])
message:Send()
end
function LuaDistributesPropsDetailedInfo.ReadPacket(binaryReader)
local packet = {}
packet['boxId'] = binaryReader:ReadInt32()
packet['state'] = binaryReader:ReadInt32()
packet['propId'] = binaryReader:ReadInt32()
packet['propNum'] = binaryReader:ReadInt32()
packet['isBind'] = binaryReader:ReadInt32()
return packet
end