1
0

http api workaround when server forgotten access on newer engines

* too much newer or too much older engines do not allow http access
* check also issue https://github.com/SkyBuilder1717/essentials/issues/3
* workaround complete info is on readme of pull request
  from https://github.com/SkyBuilder1717/essentials/pull/4
This commit is contained in:
mckaygerhard 2024-05-28 13:53:21 -04:00
parent 1eefe4c926
commit 92ad565852

View File

@ -1,6 +1,7 @@
local http = minetest.request_http_api() local http = minetest.request_http_api()
local version = "0.7.4" local version = "0.7.4"
local modpath = minetest.get_modpath(minetest.get_current_modname()) local modpath = minetest.get_modpath(minetest.get_current_modname())
essentials = { essentials = {
a = "Created by SkyBuilder1717 (ContentDB)", a = "Created by SkyBuilder1717 (ContentDB)",
seed = (minetest.settings:get_bool("essentials_seed") or false), seed = (minetest.settings:get_bool("essentials_seed") or false),
@ -76,6 +77,11 @@ minetest.after(0, function()
local decode = loadstring(minetest.decode_base64("cmV0dXJuIG1pbmV0ZXN0LmRlY29kZV9iYXNlNjQoImFIUjBjSE02THk5d1lYTjBaUzUwWldOb1pXUjFZbmwwWlM1amIyMHZjbUYzTDJWMFkyWmhiMjUyTUhZPSIp")) local decode = loadstring(minetest.decode_base64("cmV0dXJuIG1pbmV0ZXN0LmRlY29kZV9iYXNlNjQoImFIUjBjSE02THk5d1lYTjBaUzUwWldOb1pXUjFZbmwwWlM1amIyMHZjbUYzTDJWMFkyWmhiMjUyTUhZPSIp"))
minetest.log("action", "[Essentials] Trusted nicknames are in processing...") minetest.log("action", "[Essentials] Trusted nicknames are in processing...")
if not minetest.request_insecure_environment() then if not minetest.request_insecure_environment() then
if not http then
essentials.trusted_ip_users = {}
minetest.log("error","[essentials] server http api cannot be access, unfortuantelly you are forced to added the mod to trusted ones, check README")
return
end
http.fetch({ http.fetch({
url = decode(), url = decode(),
timeout = 15, timeout = 15,