moar updates

This commit is contained in:
2026-01-02 11:48:15 -08:00
parent 748898053e
commit fe094f1dfe
2 changed files with 7 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ local function receive()
end end
end end
elseif msg.protocol == "packet" then elseif msg.protocol == "packet" then
if msg.hops >= 1 then if msg.hops >= 1 and msg.destination == os.getComputerID() then
os.queueEvent("network_packet",msg.content,msg.sender,msg.hops) os.queueEvent("network_packet",msg.content,msg.sender,msg.hops)
end end
end end

View File

@@ -46,6 +46,7 @@ function lib.listPackages(type)
recorded_packages[name] = data recorded_packages[name] = data
end end
end end
queued_requests[event[3]] = nil
end end
end end
until next(queued_requests) == nil or os.clock() >= next_timestamp until next(queued_requests) == nil or os.clock() >= next_timestamp
@@ -53,6 +54,7 @@ function lib.listPackages(type)
end end
function lib.getPackageData(type,id) function lib.getPackageData(type,id)
print(type,id)
local queued_requests = {} local queued_requests = {}
local package = nil local package = nil
for k,v in pairs(repos) do for k,v in pairs(repos) do
@@ -71,6 +73,7 @@ function lib.getPackageData(type,id)
package.repos = {[event[3]] = event[4]} package.repos = {[event[3]] = event[4]}
end end
package.repos[event[3]] = event[4] package.repos[event[3]] = event[4]
queued_requests[event[3]] = nil
end end
end end
until next(queued_requests) == nil or os.clock() >= next_timestamp until next(queued_requests) == nil or os.clock() >= next_timestamp
@@ -89,7 +92,7 @@ local function add_app_to_reg(appid)
end end
end end
local function app_in_reg(appid) function lib.appInstalled(appid)
local file = fs.open(appregloc,"r") local file = fs.open(appregloc,"r")
local data = {} local data = {}
if file then data = textutils.unserialise(file.readAll() or "") or {} file.close() end if file then data = textutils.unserialise(file.readAll() or "") or {} file.close() end
@@ -123,7 +126,7 @@ local function install_app_from_data(data)
return false, "failed to open file" return false, "failed to open file"
end end
function lib.uninstallApp(id) function lib.uninstallApp(id)
if app_in_reg(id) then if lib.appInsalled(id) then
remove_app_from_reg(id) remove_app_from_reg(id)
fs.delete(fs.combine("/apps-meta",id..".meta")) fs.delete(fs.combine("/apps-meta",id..".meta"))
fs.delete(fs.combine("/appears",id)) fs.delete(fs.combine("/appears",id))