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
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)
end
end

View File

@@ -46,6 +46,7 @@ function lib.listPackages(type)
recorded_packages[name] = data
end
end
queued_requests[event[3]] = nil
end
end
until next(queued_requests) == nil or os.clock() >= next_timestamp
@@ -53,6 +54,7 @@ function lib.listPackages(type)
end
function lib.getPackageData(type,id)
print(type,id)
local queued_requests = {}
local package = nil
for k,v in pairs(repos) do
@@ -70,7 +72,8 @@ function lib.getPackageData(type,id)
package = event[2].data
package.repos = {[event[3]] = event[4]}
end
package.repos[event[3]] = event[4]
package.repos[event[3]] = event[4]
queued_requests[event[3]] = nil
end
end
until next(queued_requests) == nil or os.clock() >= next_timestamp
@@ -89,7 +92,7 @@ local function add_app_to_reg(appid)
end
end
local function app_in_reg(appid)
function lib.appInstalled(appid)
local file = fs.open(appregloc,"r")
local data = {}
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"
end
function lib.uninstallApp(id)
if app_in_reg(id) then
if lib.appInsalled(id) then
remove_app_from_reg(id)
fs.delete(fs.combine("/apps-meta",id..".meta"))
fs.delete(fs.combine("/appears",id))