From dbb7080ca2e7956b2e1157e68b0aebfeba58760c Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Thu, 26 Mar 2020 17:33:18 +1100 Subject: [PATCH] made rpc.call less flimsy hopefully --- lib/rpc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rpc.lua b/lib/rpc.lua index fd9286f..c95df60 100644 --- a/lib/rpc.lua +++ b/lib/rpc.lua @@ -37,8 +37,8 @@ function rpc.call(hostname,fn,...) local rt = {} repeat local _, from, port, data = event.pull(30, "net_msg", hostname, rpc.port) - rt = serial.unserialize(data) or {} - until rt[1] == rv or computer.uptime() > st + 30 + rt = serial.unserialize(tostring(data)) or {} + until (type(rt) == "table" and rt[1] == rv) or computer.uptime() > st + 30 if table.remove(rt,1) == rv then return table.unpack(rt) end