Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lua/wire/stools/fpga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,17 @@ if SERVER then
return
end

local dataLength = net.ReadUInt(16)
local data = net.ReadData(dataLength)
local ok
local data = net.ReadData(net.ReadUInt(16))
data = util.Decompress(data, 1048576)

local ok, data = pcall(util.Decompress, data)
if not ok then return end
if data then
ok, data = pcall(WireLib.von.deserialize, data)
else
-- To have propper fail reason
ok, data = false, "Failed to decompress data"
end

ok, data = pcall(WireLib.von.deserialize, data)
if ok then
chip:Upload(data)
else
Expand Down Expand Up @@ -367,4 +371,4 @@ if CLIENT then
end

end
end
end
Loading