potatonet fixes

This commit is contained in:
osmarks 2020-08-24 13:08:57 +01:00
parent 5f7ec88abf
commit 7ccc6d2be4
4 changed files with 19 additions and 19 deletions

View File

@ -1,2 +1,2 @@
{"build":146,"description":"change colors","files":{"LICENSES":"f3549d84d66eb53dd4a421a4341d77d3d217c1b117d67e3be8f5211adcda0952","autorun.lua":"30c39e6b0f9bf197e9db5cf4a7b86bbd48343ab12f8bd5e98289c4a1609efc24","bin/5rot26.lua":"91b66cd6d4b33081b25c456142dd7efcb894e819e842693c9e1e17ff48872ff5","bin/chronometer.lua":"db5363993a04382145aef7db2fbe262f0bf10697a589e1e2d2f9ce0f87430dd8","bin/kristminer.lua":"7e7f9fe2a6493d584ad6926cda915e02c1c3d800dc209680898ce930d0bb0e6f","bin/livegps.lua":"c3d17d495cda01aa1261e4c4fcd43439b29af422671972117ec34f68e32c5bba","bin/loading.lua":"c85f7aa1765170325155b921c1fceeb62643f552f12d41b529a22af3a67f5a97","bin/potatoflight.lua":"2fbb0b6f8d78728d8cb0ec64af1bc598bd00cb55f202378e7acdb86bba71efd1","bin/potatoplex.lua":"86c9e7597bbe23d7de7e7f1bfc976d0b94dcdf3af9e6c7c6c9b18b98596898c8","bin/relay.lua":"261ae6c220b83506e3326e8f2b091d246baae458ff0d2ee87512be2c4e35a75d","bin/tryhaskell.lua":"07810d85145da65a3e434154c79d5a9d72f2dcbe59c8d6829040fb925df878ec","potatobios.lua":"9d32752f5bab07085dd574dc22d15141f4dfdf736820e7d70d11c4f836747397","signing-key.tbl":"b32af5229c23af3bc03d538e42751b26044e404a7b1af064ed89894efe421607","startup":"f17bfb9b4322c4467dc9170d50827f2d75717e5c3125d734f21f3406657917bc","xlib/00_cbor.lua":"464b075e4f094b8db42506bd4bdaad0db87699ea7fbf80e5b87739b4aa9279af","xlib/01_skynet.lua":"1d2902d89a61f6c5853157e8ee1b3f2ba2664b1b08af16ad21b41115d551b78f"},"timestamp":1598267369}
{"hash":"f0184322984a1cfa0ab06af3b4de4a517e3cdb806403c6eb13125786366b69d3"}
{"build":149,"description":"fix potatonet more","files":{"LICENSES":"f3549d84d66eb53dd4a421a4341d77d3d217c1b117d67e3be8f5211adcda0952","autorun.lua":"769d1b0b106917ebcd252292e38a8f737a8c6bdc8565626b6fddd5f15cf3efea","bin/5rot26.lua":"91b66cd6d4b33081b25c456142dd7efcb894e819e842693c9e1e17ff48872ff5","bin/chronometer.lua":"db5363993a04382145aef7db2fbe262f0bf10697a589e1e2d2f9ce0f87430dd8","bin/kristminer.lua":"7e7f9fe2a6493d584ad6926cda915e02c1c3d800dc209680898ce930d0bb0e6f","bin/livegps.lua":"c3d17d495cda01aa1261e4c4fcd43439b29af422671972117ec34f68e32c5bba","bin/loading.lua":"c85f7aa1765170325155b921c1fceeb62643f552f12d41b529a22af3a67f5a97","bin/potatoflight.lua":"2fbb0b6f8d78728d8cb0ec64af1bc598bd00cb55f202378e7acdb86bba71efd1","bin/potatoplex.lua":"86c9e7597bbe23d7de7e7f1bfc976d0b94dcdf3af9e6c7c6c9b18b98596898c8","bin/relay.lua":"261ae6c220b83506e3326e8f2b091d246baae458ff0d2ee87512be2c4e35a75d","bin/tryhaskell.lua":"07810d85145da65a3e434154c79d5a9d72f2dcbe59c8d6829040fb925df878ec","potatobios.lua":"c9d8029487273bd85d3b46e1ea0fb2fb9c694b21dbd3b5cdd53123a329d03322","signing-key.tbl":"b32af5229c23af3bc03d538e42751b26044e404a7b1af064ed89894efe421607","startup":"f17bfb9b4322c4467dc9170d50827f2d75717e5c3125d734f21f3406657917bc","update-key.hex":"8d8afb7a45833bb7d68f929421ad60a211d4d73e0ee03b24dc0106ba1de2e1a0","xlib/00_cbor.lua":"464b075e4f094b8db42506bd4bdaad0db87699ea7fbf80e5b87739b4aa9279af","xlib/01_skynet.lua":"bde95ed86f3108ec56624367deea3e2694c8cfcd9eac220a21bad0b56c8a999b"},"timestamp":1598270769}
{"hash":"528594548896514449f9c5dea0338d8d45c3148fc1b3b6c12930f61b388d2d30","sig":"329e956f6d7f335f1288f5fa903ea47c3129de851f064a3785f5dddd5049f554393b980852049f80562a"}

View File

@ -956,7 +956,6 @@ local function run_with_sandbox()
-- if fs.exists "lib/bigfont" then os.loadAPI "lib/bigfont" end
if fs.exists "lib/gps.lua" then
os.loadAPI "lib/gps.lua"
_G.gps = _G.potatogps
end
-- Hook up the debug registry to the potatOS Registry.
@ -1143,11 +1142,6 @@ local function run_with_sandbox()
--debug = (potatOS or external_env).debug -- too insecure, this has been removed, why did I even add this.
}
_G.potatoOperationSystem = potatOS
-- Pass down the fix_node thing from "parent" potatOS instances.
if global_potatOS then potatOS.fix_node = global_potatOS.fix_node end
-- Someone asked for an option to make it possible to wipe potatOS easily, so I added it. The hedgehogs are vital to its operation.
-- See https://hackage.haskell.org/package/hedgehog-classes for further information.
if settings.get "potatOS.removable" then

View File

@ -1721,10 +1721,13 @@ local function handle_potatoNET(message)
end
local function potatoNET()
while true do
local channel, message = skynet.receive "potatoNET"
local ok, res = pcall(handle_potatoNET, message)
skynet.send(channel .. "-", {ok = ok, result = res, from = os.getComputerID()})
skynet.open "potatoNET"
while true do
local _, channel, message = os.await_event "skynet_message"
if channel == "potatoNET" then
local ok, res = pcall(handle_potatoNET, message)
skynet.send(channel .. "-", {ok = ok, result = res, from = os.getComputerID()})
end
end
end
@ -1778,7 +1781,7 @@ if _G.textutilsprompt then textutils.prompt = _G.textutilsprompt end
if process then
process.spawn(keyboard_shortcuts, "kbsd")
if http.websocket then process.spawn(potatoNET, "systemd-potatod") end
if http.websocket then process.spawn(skynet.listen, "skynetd") process.spawn(potatoNET, "systemd-potatod") end
local autorun = potatOS.registry.get "potatOS.autorun"
if type(autorun) == "string" then
autorun = load(autorun)

View File

@ -58,12 +58,15 @@ local function recv_one(filter)
skynet.connect()
while true do
-- weirdness with CC: Tweaked makes `receive` apparently not work?
local contents = (skynet.socket.receive or skynet.socket.result)()
local result = CBOR.decode(contents)
if type(result) == "table" then
if result[1] == "error" then error(result[2] .. ": " .. result[3]) end
if filter(result) then
return result
--local contents = (skynet.socket.receive or skynet.socket.result)()
local _, u, contents = os.await_event "websocket_message"
if u == skynet.server then
local result = CBOR.decode(contents)
if type(result) == "table" then
if result[1] == "error" then error(result[2] .. ": " .. result[3]) end
if filter(result) then
return result
end
end
end
end