diff --git a/crafter.lua b/crafter.lua index d2e042b..1ac71c3 100644 --- a/crafter.lua +++ b/crafter.lua @@ -77,7 +77,8 @@ end while true do util.processMessage(function(m) if m.cmd and m.item and m.cmd == "craft" then - return craft(m.item) + return true, craft(m.item) end + return false end) end \ No newline at end of file diff --git a/server.lua b/server.lua index 963588c..7df91ee 100644 --- a/server.lua +++ b/server.lua @@ -137,7 +137,7 @@ function processRequests() local ok, r = pcall(processRequest, msg) if not ok then r = "ERROR" end - return r + return true, r end) end end diff --git a/util.lua b/util.lua index 5a7de71..b635d12 100644 --- a/util.lua +++ b/util.lua @@ -106,8 +106,8 @@ local function split(str, sSeparator, nMax, bRegexp) local function processMessage(f) local id, msg = rednet.receive "dragon" if msg and msg.uid then - local r = f(msg) - rednet.send(id, { uid = msg.uid, msg = r }, "dragon") + local send, response = f(msg) + if send then rednet.send(id, { uid = msg.uid, msg = response }, "dragon") end end end