mirror of
https://github.com/kepler155c/opus
synced 2025-02-07 04:30:03 +00:00
lock computer
This commit is contained in:
parent
aaab059cee
commit
5c35a8383e
@ -14,9 +14,12 @@
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
local colors = _G.colors
|
local colors = _G.colors
|
||||||
|
local fs = _G.fs
|
||||||
|
local keys = _G.keys
|
||||||
local os = _G.os
|
local os = _G.os
|
||||||
local settings = _G.settings
|
local settings = _G.settings
|
||||||
local term = _G.term
|
local term = _G.term
|
||||||
|
local textutils = _G.textutils
|
||||||
|
|
||||||
local function loadBootOptions()
|
local function loadBootOptions()
|
||||||
if not fs.exists('.startup.boot') then
|
if not fs.exists('.startup.boot') then
|
||||||
@ -145,13 +148,13 @@ local function splash()
|
|||||||
term.write(str)
|
term.write(str)
|
||||||
end
|
end
|
||||||
|
|
||||||
term.clear()
|
|
||||||
splash()
|
|
||||||
|
|
||||||
for _, v in pairs(bootOptions.preload) do
|
for _, v in pairs(bootOptions.preload) do
|
||||||
os.run(_ENV, v)
|
os.run(_ENV, v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
term.clear()
|
||||||
|
splash()
|
||||||
|
|
||||||
local timerId = os.startTimer(bootOptions.delay)
|
local timerId = os.startTimer(bootOptions.delay)
|
||||||
while true do
|
while true do
|
||||||
local e, id = os.pullEvent()
|
local e, id = os.pullEvent()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
local fs = _G.fs
|
||||||
|
|
||||||
if fs.native then
|
if fs.native then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -7,8 +9,6 @@ local Util = require('opus.util')
|
|||||||
|
|
||||||
-- TODO: support getDrive for virtual nodes
|
-- TODO: support getDrive for virtual nodes
|
||||||
|
|
||||||
local fs = _G.fs
|
|
||||||
|
|
||||||
fs.native = Util.shallowCopy(fs)
|
fs.native = Util.shallowCopy(fs)
|
||||||
|
|
||||||
local fstypes = { }
|
local fstypes = { }
|
||||||
@ -16,7 +16,7 @@ local nativefs = { }
|
|||||||
|
|
||||||
for k,fn in pairs(fs) do
|
for k,fn in pairs(fs) do
|
||||||
if type(fn) == 'function' then
|
if type(fn) == 'function' then
|
||||||
nativefs[k] = function(node, ...)
|
nativefs[k] = function(_, ...)
|
||||||
return fn(...)
|
return fn(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -340,8 +340,8 @@ function fs.unmount(path)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fs.registerType(name, fs)
|
function fs.registerType(name, vfs)
|
||||||
fstypes[name] = fs
|
fstypes[name] = vfs
|
||||||
end
|
end
|
||||||
|
|
||||||
function fs.getTypes()
|
function fs.getTypes()
|
||||||
|
@ -23,6 +23,9 @@ local sub = string.sub
|
|||||||
local tconcat = table.concat
|
local tconcat = table.concat
|
||||||
local tinsert = table.insert
|
local tinsert = table.insert
|
||||||
|
|
||||||
|
local bit = _G.bit
|
||||||
|
local fs = _G.fs
|
||||||
|
|
||||||
local SIGC = 'LZWC'
|
local SIGC = 'LZWC'
|
||||||
local IGNORE_COMPRESSION = 1 -- support other bits as well
|
local IGNORE_COMPRESSION = 1 -- support other bits as well
|
||||||
|
|
||||||
@ -157,7 +160,7 @@ local function decompress(input)
|
|||||||
return tconcat(result)
|
return tconcat(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
function split(str, pattern)
|
local function split(str, pattern)
|
||||||
pattern = pattern or "(.-)\n"
|
pattern = pattern or "(.-)\n"
|
||||||
local t = {}
|
local t = {}
|
||||||
local function helper(line) tinsert(t, line) return "" end
|
local function helper(line) tinsert(t, line) return "" end
|
||||||
@ -219,7 +222,7 @@ function fs.open(fname, flags)
|
|||||||
end,
|
end,
|
||||||
flush = function()
|
flush = function()
|
||||||
-- this isn't gonna work...
|
-- this isn't gonna work...
|
||||||
// f.write(compress(tconcat(c)))
|
-- f.write(compress(tconcat(c)))
|
||||||
f.flush();
|
f.flush();
|
||||||
end,
|
end,
|
||||||
close = function()
|
close = function()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user