Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
ModApiServer Class Reference

#include <l_server.h>

+ Inheritance diagram for ModApiServer:
+ Collaboration diagram for ModApiServer:

Static Public Member Functions

static void Initialize (lua_State *L, int top)
 
static void InitializeAsync (lua_State *L, int top)
 
- Static Public Member Functions inherited from ModApiBase
static ScriptApiBasegetScriptApiBase (lua_State *L)
 
static ServergetServer (lua_State *L)
 
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
 
static EmergeThreadgetEmergeThread (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 void registerClass (lua_State *L, const char *name, const luaL_Reg *methods, const luaL_Reg *metamethods)
 
template<typename T >
static T * checkObject (lua_State *L, int narg)
 
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions.
 

Static Private Member Functions

static int l_request_shutdown (lua_State *L)
 
static int l_get_server_status (lua_State *L)
 
static int l_get_server_uptime (lua_State *L)
 
static int l_get_server_max_lag (lua_State *L)
 
static int l_get_worldpath (lua_State *L)
 
static int l_get_mod_data_path (lua_State *L)
 
static int l_is_singleplayer (lua_State *L)
 
static int l_get_current_modname (lua_State *L)
 
static int l_get_modpath (lua_State *L)
 
static int l_get_modnames (lua_State *L)
 
static int l_get_game_info (lua_State *L)
 
static int l_print (lua_State *L)
 
static int l_chat_send_all (lua_State *L)
 
static int l_chat_send_player (lua_State *L)
 
static int l_show_formspec (lua_State *L)
 
static int l_sound_play (lua_State *L)
 
static int l_sound_stop (lua_State *L)
 
static int l_sound_fade (lua_State *L)
 
static int l_dynamic_add_media (lua_State *L)
 
static int l_get_player_privs (lua_State *L)
 
static int l_get_player_ip (lua_State *L)
 
static int l_get_player_information (lua_State *L)
 
static int l_get_player_window_information (lua_State *L)
 
static int l_get_ban_list (lua_State *L)
 
static int l_get_ban_description (lua_State *L)
 
static int l_ban_player (lua_State *L)
 
static int l_unban_player_or_ip (lua_State *L)
 
static int l_disconnect_player (lua_State *L)
 
static int l_remove_player (lua_State *L)
 
static int l_notify_authentication_modified (lua_State *L)
 
static int l_do_async_callback (lua_State *L)
 
static int l_register_async_dofile (lua_State *L)
 
static int l_register_mapgen_script (lua_State *L)
 
static int l_serialize_roundtrip (lua_State *L)
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
template<>
s16 readParam (lua_State *L, int index)
 
template<>
int readParam (lua_State *L, int index)
 
template<>
float readParam (lua_State *L, int index)
 
template<>
v2s16 readParam (lua_State *L, int index)
 
template<>
v2f readParam (lua_State *L, int index)
 
template<>
v3f readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 
template<>
std::string readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
 
- Static Protected Member Functions inherited from LuaHelper
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
 
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 at index.
 

Member Function Documentation

◆ Initialize()

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

References API_FCT.

Referenced by ServerScripting::InitializeModApi().

+ Here is the caller graph for this function:

◆ InitializeAsync()

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

References API_FCT.

Referenced by ServerScripting::initAsync(), and EmergeScripting::InitializeModApi().

+ Here is the caller graph for this function:

◆ l_ban_player()

int ModApiServer::l_ban_player ( lua_State * L)
staticprivate

References ModApiBase::getEnv(), RemotePlayer::getPeerId(), ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_chat_send_all()

int ModApiServer::l_chat_send_all ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, script_get_backtrace(), utf8_to_wide(), warningstream, and BaseException::what().

+ Here is the call graph for this function:

◆ l_chat_send_player()

int ModApiServer::l_chat_send_player ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, script_get_backtrace(), utf8_to_wide(), warningstream, and BaseException::what().

+ Here is the call graph for this function:

◆ l_disconnect_player()

int ModApiServer::l_disconnect_player ( lua_State * L)
staticprivate

References ModApiBase::getEnv(), RemotePlayer::getPeerId(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and SERVER_ACCESSDENIED_CUSTOM_STRING.

+ Here is the call graph for this function:

◆ l_do_async_callback()

int ModApiServer::l_do_async_callback ( lua_State * L)
staticprivate

References call_string_dump(), ModApiBase::getScriptApi(), NO_MAP_LOCK_REQUIRED, ServerScripting::queueAsync(), LuaHelper::readParam(), and script_pack().

+ Here is the call graph for this function:

◆ l_dynamic_add_media()

int ModApiServer::l_dynamic_add_media ( lua_State * L)
staticprivate

◆ l_get_ban_description()

int ModApiServer::l_get_ban_description ( lua_State * L)
staticprivate

References ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_ban_list()

int ModApiServer::l_get_ban_list ( lua_State * L)
staticprivate

References ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_current_modname()

int ModApiServer::l_get_current_modname ( lua_State * L)
staticprivate

References ScriptApiBase::getCurrentModNameInsecure(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_game_info()

int ModApiServer::l_get_game_info ( lua_State * L)
staticprivate

References SubgameSpec::author, ModApiBase::getGameDef(), IGameDef::getGameSpec(), SubgameSpec::id, NO_MAP_LOCK_REQUIRED, SubgameSpec::path, setstringfield(), and SubgameSpec::title.

+ Here is the call graph for this function:

◆ l_get_mod_data_path()

int ModApiServer::l_get_mod_data_path ( lua_State * L)
staticprivate

References fs::CreateAllDirs(), DIR_DELIM, ScriptApiBase::getCurrentModNameInsecure(), Server::getModDataPath(), ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_modnames()

int ModApiServer::l_get_modnames ( lua_State * L)
staticprivate

References ModApiBase::getGameDef(), IGameDef::getMods(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_modpath()

int ModApiServer::l_get_modpath ( lua_State * L)
staticprivate

References ModApiBase::getGameDef(), IGameDef::getModSpec(), NO_MAP_LOCK_REQUIRED, and ModSpec::path.

+ Here is the call graph for this function:

◆ l_get_player_information()

◆ l_get_player_ip()

int ModApiServer::l_get_player_ip ( lua_State * L)
staticprivate

References RemotePlayer::getPeerId(), ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_player_privs()

int ModApiServer::l_get_player_privs ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and table.

+ Here is the call graph for this function:

◆ l_get_player_window_information()

int ModApiServer::l_get_player_window_information ( lua_State * L)
staticprivate

References RemotePlayer::getPeerId(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, push_v2f(), and push_v2u32().

+ Here is the call graph for this function:

◆ l_get_server_max_lag()

int ModApiServer::l_get_server_max_lag ( lua_State * L)
staticprivate

◆ l_get_server_status()

int ModApiServer::l_get_server_status ( lua_State * L)
staticprivate

References ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_server_uptime()

int ModApiServer::l_get_server_uptime ( lua_State * L)
staticprivate

References ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_worldpath()

int ModApiServer::l_get_worldpath ( lua_State * L)
staticprivate

References ModApiBase::getServer(), Server::getWorldPath(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_is_singleplayer()

int ModApiServer::l_is_singleplayer ( lua_State * L)
staticprivate

References ModApiBase::getServer(), Server::isSingleplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_notify_authentication_modified()

int ModApiServer::l_notify_authentication_modified ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and Server::reportPrivsModified().

+ Here is the call graph for this function:

◆ l_print()

int ModApiServer::l_print ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and Server::printToConsoleOnly().

+ Here is the call graph for this function:

◆ l_register_async_dofile()

int ModApiServer::l_register_async_dofile ( lua_State * L)
staticprivate

References CHECK_SECURE_PATH, ScriptApiBase::getCurrentModNameInsecure(), ModApiBase::getServer(), Server::m_async_init_files, NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_register_mapgen_script()

int ModApiServer::l_register_mapgen_script ( lua_State * L)
staticprivate

References CHECK_SECURE_PATH, ScriptApiBase::getCurrentModNameInsecure(), ModApiBase::getServer(), Server::m_mapgen_init_files, NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_remove_player()

int ModApiServer::l_remove_player ( lua_State * L)
staticprivate

References ModApiBase::getEnv(), ServerEnvironment::getPlayer(), NO_MAP_LOCK_REQUIRED, and ServerEnvironment::removePlayerFromDatabase().

+ Here is the call graph for this function:

◆ l_request_shutdown()

int ModApiServer::l_request_shutdown ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and Server::requestShutdown().

+ Here is the call graph for this function:

◆ l_serialize_roundtrip()

int ModApiServer::l_serialize_roundtrip ( lua_State * L)
staticprivate

References NO_MAP_LOCK_REQUIRED, script_dump_packed(), script_pack(), and script_unpack().

+ Here is the call graph for this function:

◆ l_show_formspec()

int ModApiServer::l_show_formspec ( lua_State * L)
staticprivate

References ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_sound_fade()

int ModApiServer::l_sound_fade ( lua_State * L)
staticprivate

References Server::fadeSound(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_sound_play()

int ModApiServer::l_sound_play ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, Server::playSound(), read_server_sound_params(), read_simplesoundspec(), LuaHelper::readParam(), and ServerPlayingSound::spec.

+ Here is the call graph for this function:

◆ l_sound_stop()

int ModApiServer::l_sound_stop ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and Server::stopSound().

+ Here is the call graph for this function:

◆ l_unban_player_or_ip()

int ModApiServer::l_unban_player_or_ip ( lua_State * L)
staticprivate

References ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and Server::unsetIpBanned().

+ Here is the call graph for this function:

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