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