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