1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 10:38:05 +11:00

removed the requirement for access to the computer API, used the system-wide hostname if available

This commit is contained in:
Izaya 2018-04-25 02:50:35 +10:00
parent 1c8f5f75bf
commit 6a5b711172

View File

@ -1,11 +1,11 @@
-- KittenOS NEO Wrapper for OpenOS Minitel -- KittenOS NEO Wrapper for OpenOS Minitel
-- Take my word for it it works p. well -- Take my word for it it works p. well
local rcomputer = neo.requireAccess("k.computer","pushing packets") --local rcomputer = neo.requireAccess("k.computer","pushing packets")
neo.requireAccess("s.h.modem_message","pulling packets") neo.requireAccess("s.h.modem_message","pulling packets")
local processes = {} local processes = {}
local hooks = {} local hooks = {}
local computer = {["uptime"]=rcomputer.uptime,["address"]=rcomputer.address} -- wrap computer so the OpenOS code more or less works local computer = {["uptime"]=os.uptime,["address"]=os.address} -- wrap computer so the OpenOS code more or less works
local event = {} local event = {}
function event.timer() function event.timer()
end end
@ -88,19 +88,12 @@ local function dprint(...)
end end
end end
-- this stuff doesn't work on KittenOS, I'll need to implement a better hostname getting thing than the computer address local globals = neo.requestAccess("x.neo.pub.globals") -- KittenOS standard hostname stuff
--[[ if globals then
local f=io.open("/etc/hostname","rb") hostname = globals.getSetting("hostname") or hostname
if f then globals.setSetting("hostname",hostname)
hostname = f:read()
f:close()
end end
print("Hostname: "..hostname)
if listener then return end
for a,t in component.list("modem") do
modems[#modems+1] = component.proxy(a)
end
]]--
for p in neo.requireAccess("c.modem","networking").list() do -- fun stuff for KittenOS for p in neo.requireAccess("c.modem","networking").list() do -- fun stuff for KittenOS
dprint(p.address) dprint(p.address)
modems[p.address] = p modems[p.address] = p