1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Use JSON for favorites, move server list code to Lua (#10085)

Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
rubenwardy 2021-01-22 15:08:57 +00:00 committed by GitHub
parent 4fcd000e20
commit 67aa75d444
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 388 additions and 528 deletions

View file

@ -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);