forked from Mirrorlandia_minetest/digistuff
Fix HTTP API detection
This commit is contained in:
parent
395d6f0ccf
commit
bd4684e000
9
init.lua
9
init.lua
@ -4,7 +4,6 @@ local components = {
|
|||||||
"touchscreen",
|
"touchscreen",
|
||||||
"light",
|
"light",
|
||||||
"noteblock",
|
"noteblock",
|
||||||
"nic",
|
|
||||||
"camera",
|
"camera",
|
||||||
"button",
|
"button",
|
||||||
"panel",
|
"panel",
|
||||||
@ -16,3 +15,11 @@ local components = {
|
|||||||
for _,name in ipairs(components) do
|
for _,name in ipairs(components) do
|
||||||
dofile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,name))
|
dofile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,name))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local http = minetest.request_http_api()
|
||||||
|
if not http then
|
||||||
|
minetest.log("error","digistuff is not allowed to use the HTTP API - digilines NIC will not be available!")
|
||||||
|
minetest.log("error","If this functionality is desired, please add digistuff to your secure.http_mods setting")
|
||||||
|
else
|
||||||
|
loadfile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,"nic"))(http)
|
||||||
|
end
|
||||||
|
8
nic.lua
8
nic.lua
@ -1,10 +1,4 @@
|
|||||||
local http = minetest.request_http_api()
|
local http = ...
|
||||||
if not http then
|
|
||||||
minetest.log("error","digistuff is not allowed to use the HTTP API - digilines NIC will not be available!")
|
|
||||||
minetest.log("error","If this functionality is desired, please add digistuff to your secure.http_mods setting")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("digistuff:nic", {
|
minetest.register_node("digistuff:nic", {
|
||||||
description = "Digilines NIC",
|
description = "Digilines NIC",
|
||||||
groups = {cracky=3},
|
groups = {cracky=3},
|
||||||
|
Loading…
Reference in New Issue
Block a user