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

70 lines
1.6 KiB
Plaintext
Raw Normal View History

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