aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2021-01-22 15:08:57 +0000
committerGitHub <noreply@github.com>2021-01-22 15:08:57 +0000
commit67aa75d444d0e5cfff2728dbbcffd6f95b2fe88b (patch)
treef3a2079a9b17056508e8197a701cf90447e4ea4b /src/script/lua_api/l_util.cpp
parent4fcd000e20a26120349184cb9d40342b7876e6b8 (diff)
downloadminetest-67aa75d444d0e5cfff2728dbbcffd6f95b2fe88b.tar.xz
Use JSON for favorites, move server list code to Lua (#10085)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/script/lua_api/l_util.cpp')
-rw-r--r--src/script/lua_api/l_util.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index 6490eb578..203a0dd28 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -250,6 +250,17 @@ int ModApiUtil::l_get_builtin_path(lua_State *L)
return 1;
}
+// get_user_path()
+int ModApiUtil::l_get_user_path(lua_State *L)
+{
+ NO_MAP_LOCK_REQUIRED;
+
+ std::string path = porting::path_user;
+ lua_pushstring(L, path.c_str());
+
+ return 1;
+}
+
// compress(data, method, level)
int ModApiUtil::l_compress(lua_State *L)
{
@@ -486,6 +497,7 @@ void ModApiUtil::Initialize(lua_State *L, int top)
API_FCT(is_yes);
API_FCT(get_builtin_path);
+ API_FCT(get_user_path);
API_FCT(compress);
API_FCT(decompress);
@@ -539,6 +551,7 @@ void ModApiUtil::InitializeAsync(lua_State *L, int top)
API_FCT(is_yes);
API_FCT(get_builtin_path);
+ API_FCT(get_user_path);
API_FCT(compress);
API_FCT(decompress);