forked from izaya/OC-PsychOS2
made rpc.call less flimsy hopefully
This commit is contained in:
parent
f33ce1e1e0
commit
dbb7080ca2
@ -37,8 +37,8 @@ function rpc.call(hostname,fn,...)
|
|||||||
local rt = {}
|
local rt = {}
|
||||||
repeat
|
repeat
|
||||||
local _, from, port, data = event.pull(30, "net_msg", hostname, rpc.port)
|
local _, from, port, data = event.pull(30, "net_msg", hostname, rpc.port)
|
||||||
rt = serial.unserialize(data) or {}
|
rt = serial.unserialize(tostring(data)) or {}
|
||||||
until rt[1] == rv or computer.uptime() > st + 30
|
until (type(rt) == "table" and rt[1] == rv) or computer.uptime() > st + 30
|
||||||
if table.remove(rt,1) == rv then
|
if table.remove(rt,1) == rv then
|
||||||
return table.unpack(rt)
|
return table.unpack(rt)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user