Files
JJBB/Assets/Project/Script/LuaScripts/NetWork/Lua/Distributes/LuaDistributesDrawGoodsInfo.txt

56 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-08-23 15:49:34 +08:00
LuaDistributesDrawGoodsInfo = {}
LuaDistributesDrawGoodsInfo.sysID = 0
LuaDistributesDrawGoodsInfo.cmdID = 0
function LuaDistributesDrawGoodsInfo.ExtraPacket(memStream)
-- print('ExtraPacket:'..memStream.Length)
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
local sysID = binaryReader:ReadByte()
local cmdID = binaryReader:ReadByte()
packet = LuaDistributesDrawGoodsInfo.ReadPacket(binaryReader)
return packet
end
function LuaDistributesDrawGoodsInfo.SendPacket(packet)
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesDrawGoodsInfo.sysID, LuaDistributesDrawGoodsInfo.cmdID)
if(packet['boxId'] == nil) then
packet['boxId'] = 0
end
message:WriteInt(packet['boxId'])
if(packet['openState'] == nil) then
packet['openState'] = 0
end
message:WriteInt(packet['openState'])
if(packet['prizeId'] == nil) then
packet['prizeId'] = 0
end
message:WriteInt(packet['prizeId'])
if(packet['prizeNum'] == nil) then
packet['prizeNum'] = 0
end
message:WriteInt(packet['prizeNum'])
message:Send()
end
function LuaDistributesDrawGoodsInfo.ReadPacket(binaryReader)
local packet = {}
packet['boxId'] = binaryReader:ReadInt32()
packet['openState'] = binaryReader:ReadInt32()
packet['prizeId'] = binaryReader:ReadInt32()
packet['prizeNum'] = binaryReader:ReadInt32()
return packet
end