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,18 +43,21 @@ 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
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
end
for k,v in pairs(ps) do
if v.lt < os.time()-1 then
for l,m in ipairs(net.tm) do
@ -68,7 +71,6 @@ 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
@ -76,6 +78,5 @@ spawn("copperd",function() print(pcall(function ()
end
end
end
end
end)) end)
end