Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
do
local commandThread;
if(commandThread == nil)then
commandThread = love.thread.newThread("game/server/commandLineOutputThread.lua")
commandThread:start()
end
local function oldPrint(...)
local Args = {...}
print(unpack(Args))
end
function print(...)
local Args = { ... }
local outputChannel = nil
local stat, err = pcall(function()
outputChannel = love.thread.getChannel("printed-output")
local succ = outputChannel:supply(Args, 0.05)
if(succ == false)then
return error("printing to printing output channel timed out.")
end
end)
if(stat == false)then
oldPrint(unpack(Args))
oldPrint("Error printing output through printed-out channel: " .. err)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.