mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2026-01-10 00:12:28 -05:00
Compare commits
4 Commits
1c647c76fe
...
79bfb5a405
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79bfb5a405 | ||
|
|
965ee98f85 | ||
|
|
6c7a8d4c61 | ||
|
|
3ba84ca3b7 |
@ -110,6 +110,7 @@ function dl.protos.http(host, optPort, path, dest, url) -- string string string
|
|||||||
ns = R.read()
|
ns = R.read()
|
||||||
f:write(ns or "")
|
f:write(ns or "")
|
||||||
until not ns
|
until not ns
|
||||||
|
R.close()
|
||||||
f:close()
|
f:close()
|
||||||
print("Done.")
|
print("Done.")
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -38,6 +38,7 @@ function mtar.iter(stream) -- table -- function -- Given buffer *stream*, return
|
|||||||
return
|
return
|
||||||
elseif nlen == 65535 then -- versioned header
|
elseif nlen == 65535 then -- versioned header
|
||||||
version = string.byte(stream:read(1))
|
version = string.byte(stream:read(1))
|
||||||
|
assert(versions[version], "Unknown version: " .. version)
|
||||||
nlen = string.unpack(versions[version].nlf, stream:read(string.packsize(versions[version].nlf)))
|
nlen = string.unpack(versions[version].nlf, stream:read(string.packsize(versions[version].nlf)))
|
||||||
end
|
end
|
||||||
local name = cleanPath(stream:read(nlen))
|
local name = cleanPath(stream:read(nlen))
|
||||||
|
|||||||
@ -15,3 +15,4 @@ function start()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
return {start=start}
|
||||||
@ -21,5 +21,6 @@ function start()
|
|||||||
state = false
|
state = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,"screenblank")
|
end, "screenblank")
|
||||||
end
|
end
|
||||||
|
return {start=start}
|
||||||
@ -16,13 +16,19 @@ end
|
|||||||
for addr in component.list("tape_drive") do
|
for addr in component.list("tape_drive") do
|
||||||
addNode(addr)
|
addNode(addr)
|
||||||
end
|
end
|
||||||
while true do
|
|
||||||
local tE = {coroutine.yield()}
|
function start()
|
||||||
if tE[1] == "component_added" and tE[3] == "tape_drive" then
|
return os.spawn(function()
|
||||||
addNode(tE[2])
|
while true do
|
||||||
elseif tE[1] == "component_removed" and tE[3] == "tape_drive" then
|
local tE = {coroutine.yield()}
|
||||||
if td[tE[2]] then
|
if tE[1] == "component_added" and tE[3] == "tape_drive" then
|
||||||
fs.remove("/dev/tape"..tostring(td[tE[2]]))
|
addNode(tE[2])
|
||||||
|
elseif tE[1] == "component_removed" and tE[3] == "tape_drive" then
|
||||||
|
if td[tE[2]] then
|
||||||
|
fs.remove("/dev/tape"..tostring(td[tE[2]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end, "tape-devfs")
|
||||||
end
|
end
|
||||||
|
return {start=start}
|
||||||
|
|||||||
@ -61,3 +61,4 @@ function start()
|
|||||||
end
|
end
|
||||||
end,"termsrv")
|
end,"termsrv")
|
||||||
end
|
end
|
||||||
|
return {start=start}
|
||||||
|
|||||||
@ -6,13 +6,18 @@ for modem in component.list("modem") do
|
|||||||
component.invoke(modem,"setWakeMessage",message)
|
component.invoke(modem,"setWakeMessage",message)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ltime = computer.uptime()
|
function start()
|
||||||
while true do
|
return os.spawn(function()
|
||||||
if computer.uptime() > ltime+delay then
|
local ltime = computer.uptime()
|
||||||
for modem in component.list("modem") do
|
while true do
|
||||||
component.invoke(modem,"broadcast",port,message)
|
if computer.uptime() > ltime+delay then
|
||||||
|
for modem in component.list("modem") do
|
||||||
|
component.invoke(modem,"broadcast",port,message)
|
||||||
|
end
|
||||||
|
ltime=computer.uptime()
|
||||||
|
end
|
||||||
|
coroutine.yield()
|
||||||
end
|
end
|
||||||
ltime=computer.uptime()
|
end, "WoLBeacon")
|
||||||
end
|
|
||||||
coroutine.yield()
|
|
||||||
end
|
end
|
||||||
|
return {start=start}
|
||||||
Loading…
Reference in New Issue
Block a user