Skip to content

Commit e83812f

Browse files
committed
fix wrong check for http api access
* related to SkyBuilder1717/essentials#1 * real workaround for SkyBuilder1717/essentials#3 * final fix for http update check will be only for minenux governing api
1 parent 13f8f98 commit e83812f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

init.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ minetest.after(0, function()
3939
if essentials.check_for_updates then
4040
minetest.log("action", "[Essentials] Checking for updates...")
4141
if not minetest.request_insecure_environment() then
42+
if not http then
43+
minetest.log("error","[essentials] update check error, server http api cannot be access, unfortuantelly you are forced to added the mod to trusted ones, check README")
44+
return
45+
end
4246
minetest.log("action", "[Essentials] Getting an Github version...")
4347
http.fetch({
4448
url = "https://raw.githubusercontent.com/SkyBuilder1717/essentials/main/gitVersion.txt",
@@ -55,8 +59,7 @@ minetest.after(0, function()
5559
end
5660
--core.chat_send_all(dump(test))
5761
if git > this then
58-
minetest.log("warning", "[Essentials] Versions doesnt match!")
59-
core.chat_send_all("[Essentials] Your server using old version of mod! ("..core.colorize("red", version)..") Old version can have a bugs! Download v"..core.colorize("lime", result.data:gsub("[\n\\]", "")).." on ContentDB.")
62+
minetest.log("error", "[Essentials] Versions doesnt match! something wrong seems YOU ARE USING OLDER VERSION!")
6063
else
6164
local _type
6265
if core.is_singleplayer() then
@@ -68,7 +71,7 @@ minetest.after(0, function()
6871
end
6972
end)
7073
else
71-
core.chat_send_all("[Essentials] Please, add mod \'essentials\' to \"secure.trusted_mods\" for checking an updates!")
74+
minetest.log("error","[essentials] update check error, server http api cannot be access, unfortuantelly you are forced to added the mod to trusted ones, check README")
7275
end
7376
end
7477
end)

0 commit comments

Comments
 (0)