diff --git a/apis/net.lua b/apis/net.lua index 10b9985..980bfab 100644 --- a/apis/net.lua +++ b/apis/net.lua @@ -1,4 +1,4 @@ -local _VERSION = '2.1.1'; +local _VERSION = '2.1.2'; local createEventLoop = require('/apis/eventloop'); @@ -162,6 +162,16 @@ local function createNetwork(el, modem, routingChannel, timeoutInSec) end local function sendMultipleRequests(channel, eventType, payload, destId) + if destId ~= nil and tonumber(destId) ~= nil then + local ok, res, packet = sendRequest(channel, eventType, payload, destId); + + if not ok then + return ok, res, packet + end + + return ok, { res }, { packet }; + end + local ok = false; local results = {}; local packetResults = {}; diff --git a/startup/servers.lua b/startup/servers.lua index db9e7d9..defa5c7 100644 --- a/startup/servers.lua +++ b/startup/servers.lua @@ -6,7 +6,7 @@ local SERVERS = { "servers/cube-startup.lua", }; -if periphemu then +local periphEmulation = function() -- attach modem periphemu.create('top', 'modem'); @@ -25,6 +25,10 @@ if periphemu then end end +if periphemu then + periphEmulation(); +end + local function shellFn() os.sleep(0.1); shell.run("shell");