summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-08-02 21:34:17 +0200
committerGitHub <noreply@github.com>2022-08-02 21:34:17 +0200
commita81259d19a434752614e5a430fdebf86f07c1cfc (patch)
treefcb83c0aa14c645c0050d683b54131bc598556f3 /src
parentf22d40975e907d9f0e84b67b21256953333a6cc8 (diff)
downloadminetest-a81259d19a434752614e5a430fdebf86f07c1cfc.tar.gz
minetest-a81259d19a434752614e5a430fdebf86f07c1cfc.tar.bz2
minetest-a81259d19a434752614e5a430fdebf86f07c1cfc.zip
Run Minetest update checker on startup (#7629)
This feature is enabled by default for non-Android release builds. Package maintainers may use -DENABLE_UPDATE_CHECKER=0 to disable it. Co-authored-by: rubenwardy <rw@rubenwardy.com> Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src')
-rw-r--r--src/cmake_config.h.in2
-rw-r--r--src/config.h1
-rw-r--r--src/defaultsettings.cpp6
-rw-r--r--src/gui/guiFormSpecMenu.cpp2
-rw-r--r--src/script/lua_api/l_util.cpp2
5 files changed, 12 insertions, 1 deletions
diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in
index b1298165e..17b70e268 100644
--- a/src/cmake_config.h.in
+++ b/src/cmake_config.h.in
@@ -15,6 +15,8 @@
#define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#define ICON_DIR "@ICONDIR@"
#cmakedefine01 RUN_IN_PLACE
+#cmakedefine01 DEVELOPMENT_BUILD
+#cmakedefine01 ENABLE_UPDATE_CHECKER
#cmakedefine01 USE_GETTEXT
#cmakedefine01 USE_CURL
#cmakedefine01 USE_SOUND
diff --git a/src/config.h b/src/config.h
index 50e118428..a4c6c9f10 100644
--- a/src/config.h
+++ b/src/config.h
@@ -16,6 +16,7 @@
#define PROJECT_NAME "minetest"
#define PROJECT_NAME_C "Minetest"
#define STATIC_SHAREDIR ""
+ #define ENABLE_UPDATE_CHECKER 0
#define VERSION_STRING STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_PATCH) STR(VERSION_EXTRA)
#endif
#ifdef NDEBUG
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 222000712..c5d92e680 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -335,6 +335,12 @@ void set_default_settings()
settings->setDefault("contentdb_flag_blacklist", "nonfree, desktop_default");
#endif
+ settings->setDefault("update_information_url", "https://www.minetest.net/release_info.json");
+#if ENABLE_UPDATE_CHECKER
+ settings->setDefault("update_last_checked", "");
+#else
+ settings->setDefault("update_last_checked", "disabled");
+#endif
// Server
settings->setDefault("disable_escape_sequences", "false");
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 5d4ca6747..1f9914e72 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -1686,7 +1686,7 @@ void GUIFormSpecMenu::parseField(parserData* data, const std::string &element,
void GUIFormSpecMenu::parseHyperText(parserData *data, const std::string &element)
{
- MY_CHECKCLIENT("list");
+ MY_CHECKCLIENT("hypertext");
std::vector<std::string> parts;
if (!precheckElement("hypertext", element, 4, 4, parts))
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index 47a68ad75..f602aed99 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -480,6 +480,8 @@ int ModApiUtil::l_get_version(lua_State *L)
lua_setfield(L, table, "hash");
}
+ lua_pushboolean(L, DEVELOPMENT_BUILD);
+ lua_setfield(L, table, "is_dev");
return 1;
}