fixed cache clearing, some nil issues

This commit is contained in:
Izaya 2017-09-04 02:20:45 +10:00
parent 621cc397a2
commit f289516c9d

View File

@ -43,14 +43,17 @@ spawn("copperd",function() print(pcall(function ()
pd.pt = 2 pd.pt = 2
pd.nid = src pd.nid = src
pd.lt = 0 pd.lt = 0
pd.msg = ""
ps[pd.pid] = pd ps[pd.pid] = pd
elseif pd.pt == 2 then elseif pd.pt == 2 then
ps[pd.pid] = nil ps[pd.pid] = nil
end end
end end
else else
for k,v in ipairs(net.tm) do if hops < 255 then
v.broadcast(net.np,"copper",cdlib.encode(hops+1,src,dst,data)) for k,v in ipairs(net.tm) do
v.broadcast(net.np,"copper",cdlib.encode(hops+1,src,dst,data))
end
end end
end end
end end
@ -68,12 +71,10 @@ spawn("copperd",function() print(pcall(function ()
ps[k] = nil ps[k] = nil
end end
end end
if #pt > 63 then local cot = os.time()
local cot = os.time() for k,v in pairs(pt) do
for k,v in pairs(pt) do if v < cot-16 then
if v < cot-16 then pt[k] = nil
pt[k] = nil
end
end end
end end
end end