Minetest  5.4.0
ModApiUtil Class Reference

#include <l_util.h>

+ Inheritance diagram for ModApiUtil:
+ Collaboration diagram for ModApiUtil:

Static Public Member Functions

static void Initialize (lua_State *L, int top)
 
static void InitializeAsync (lua_State *L, int top)
 
static void InitializeClient (lua_State *L, int top)
 
static void InitializeAsync (AsyncEngine &engine)
 
- Static Public Member Functions inherited from ModApiBase
static ScriptApiBasegetScriptApiBase (lua_State *L)
 
static ServergetServer (lua_State *L)
 
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
 
static ClientgetClient (lua_State *L)
 
static GUIEnginegetGuiEngine (lua_State *L)
 
static IGameDefgetGameDef (lua_State *L)
 
static EnvironmentgetEnv (lua_State *L)
 
static std::string getCurrentModPath (lua_State *L)
 
template<typename T >
static T * getScriptApi (lua_State *L)
 
static bool registerFunction (lua_State *L, const char *name, lua_CFunction func, int top)
 
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions. More...
 

Static Private Member Functions

static int l_log (lua_State *L)
 
static int l_get_us_time (lua_State *L)
 
static int l_parse_json (lua_State *L)
 
static int l_write_json (lua_State *L)
 
static int l_get_dig_params (lua_State *L)
 
static int l_get_hit_params (lua_State *L)
 
static int l_check_password_entry (lua_State *L)
 
static int l_get_password_hash (lua_State *L)
 
static int l_is_yes (lua_State *L)
 
static int l_get_builtin_path (lua_State *L)
 
static int l_get_user_path (lua_State *L)
 
static int l_compress (lua_State *L)
 
static int l_decompress (lua_State *L)
 
static int l_mkdir (lua_State *L)
 
static int l_get_dir_list (lua_State *L)
 
static int l_safe_file_write (lua_State *L)
 
static int l_request_insecure_environment (lua_State *L)
 
static int l_encode_base64 (lua_State *L)
 
static int l_decode_base64 (lua_State *L)
 
static int l_get_version (lua_State *L)
 
static int l_sha1 (lua_State *L)
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
- Static Protected Member Functions inherited from LuaHelper
static bool isNaN (lua_State *L, int idx)
 
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua State L and index. More...
 
template<typename T >
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua State L and index. More...
 

Member Function Documentation

◆ Initialize()

void ModApiUtil::Initialize ( lua_State *  L,
int  top 
)
static

References API_FCT, compress(), LuaSettings::create(), decompress(), g_settings, g_settings_path, and is_yes().

Referenced by MainMenuScripting::initializeModApi(), and ServerScripting::InitializeModApi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeAsync() [1/2]

static void ModApiUtil::InitializeAsync ( AsyncEngine engine)
static

◆ InitializeAsync() [2/2]

void ModApiUtil::InitializeAsync ( lua_State *  L,
int  top 
)
static

References API_FCT, compress(), LuaSettings::create(), decompress(), g_settings, g_settings_path, and is_yes().

Referenced by MainMenuScripting::initializeModApi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeClient()

void ModApiUtil::InitializeClient ( lua_State *  L,
int  top 
)
static

References API_FCT, compress(), decompress(), and is_yes().

Referenced by ClientScripting::InitializeModApi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l_check_password_entry()

int ModApiUtil::l_check_password_entry ( lua_State *  L)
staticprivate

References base64_is_valid(), decode_srp_verifier_and_salt(), generate_srp_verifier(), hash(), NO_MAP_LOCK_REQUIRED, translate_password(), and warningstream.

+ Here is the call graph for this function:

◆ l_compress()

int ModApiUtil::l_compress ( lua_State *  L)
staticprivate

References compressZlib(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_decode_base64()

int ModApiUtil::l_decode_base64 ( lua_State *  L)
staticprivate

References base64_decode(), base64_is_valid(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_decompress()

int ModApiUtil::l_decompress ( lua_State *  L)
staticprivate

References decompressZlib(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_encode_base64()

int ModApiUtil::l_encode_base64 ( lua_State *  L)
staticprivate

References base64_encode(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_builtin_path()

int ModApiUtil::l_get_builtin_path ( lua_State *  L)
staticprivate

◆ l_get_dig_params()

int ModApiUtil::l_get_dig_params ( lua_State *  L)
staticprivate

References getDigParams(), NO_MAP_LOCK_REQUIRED, push_dig_params(), read_groups(), and read_tool_capabilities().

+ Here is the call graph for this function:

◆ l_get_dir_list()

int ModApiUtil::l_get_dir_list ( lua_State *  L)
staticprivate

References CHECK_SECURE_PATH, fs::GetDirListing(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_hit_params()

int ModApiUtil::l_get_hit_params ( lua_State *  L)
staticprivate

References getHitParams(), NO_MAP_LOCK_REQUIRED, push_hit_params(), read_groups(), and read_tool_capabilities().

+ Here is the call graph for this function:

◆ l_get_password_hash()

int ModApiUtil::l_get_password_hash ( lua_State *  L)
staticprivate

References hash(), NO_MAP_LOCK_REQUIRED, and translate_password().

+ Here is the call graph for this function:

◆ l_get_us_time()

int ModApiUtil::l_get_us_time ( lua_State *  L)
staticprivate

References porting::getTimeUs(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_user_path()

int ModApiUtil::l_get_user_path ( lua_State *  L)
staticprivate

◆ l_get_version()

int ModApiUtil::l_get_version ( lua_State *  L)
staticprivate

◆ l_is_yes()

int ModApiUtil::l_is_yes ( lua_State *  L)
staticprivate

References is_yes(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_log()

int ModApiUtil::l_log ( lua_State *  L)
staticprivate

References g_logger, LL_MAX, LL_NONE, Logger::log(), log_deprecated(), NO_MAP_LOCK_REQUIRED, Logger::stringToLevel(), and warningstream.

+ Here is the call graph for this function:

◆ l_mkdir()

int ModApiUtil::l_mkdir ( lua_State *  L)
staticprivate

References CHECK_SECURE_PATH, fs::CreateAllDirs(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_parse_json()

int ModApiUtil::l_parse_json ( lua_State *  L)
staticprivate

References errorstream, NO_MAP_LOCK_REQUIRED, push_json_value(), and warningstream.

+ Here is the call graph for this function:

◆ l_request_insecure_environment()

int ModApiUtil::l_request_insecure_environment ( lua_State *  L)
staticprivate

References CUSTOM_RIDX_CURRENT_MOD_NAME, CUSTOM_RIDX_GLOBALS_BACKUP, FATAL_ERROR_IF, g_settings, Settings::get(), ScriptApiSecurity::isSecure(), NO_MAP_LOCK_REQUIRED, and str_split().

+ Here is the call graph for this function:

◆ l_safe_file_write()

int ModApiUtil::l_safe_file_write ( lua_State *  L)
staticprivate

References CHECK_SECURE_PATH, NO_MAP_LOCK_REQUIRED, and fs::safeWriteToFile().

+ Here is the call graph for this function:

◆ l_sha1()

int ModApiUtil::l_sha1 ( lua_State *  L)
staticprivate

References SHA1::addBytes(), SHA1::getDigest(), hex_encode(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_write_json()

int ModApiUtil::l_write_json ( lua_State *  L)
staticprivate

References fastWriteJson(), NO_MAP_LOCK_REQUIRED, read_json_value(), and BaseException::what().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: