Minetest  5.4.0
ServerScripting Class Reference

#include <scripting_server.h>

+ Inheritance diagram for ServerScripting:
+ Collaboration diagram for ServerScripting:

Public Member Functions

 ServerScripting (Server *server)
 
- Public Member Functions inherited from ScriptApiBase
 ScriptApiBase (ScriptingType type)
 
 ScriptApiBase ()
 
virtual ~ScriptApiBase ()
 
 DISABLE_CLASS_COPY (ScriptApiBase)
 
void loadMod (const std::string &script_path, const std::string &mod_name)
 
void loadScript (const std::string &script_path)
 
void loadModFromMemory (const std::string &mod_name)
 
void runCallbacksRaw (int nargs, RunCallbacksMode mode, const char *fxn)
 
void addObjectReference (ServerActiveObject *cobj)
 
void removeObjectReference (ServerActiveObject *cobj)
 
IGameDefgetGameDef ()
 
ServergetServer ()
 
ScriptingType getType ()
 
ClientgetClient ()
 
std::string getOrigin ()
 
void setOriginDirect (const char *origin)
 
void setOriginFromTableRaw (int index, const char *fxn)
 
void clientOpenLibs (lua_State *L)
 
- Public Member Functions inherited from ScriptApiDetached
int detached_inventory_AllowMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
int detached_inventory_AllowPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
int detached_inventory_AllowTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void detached_inventory_OnMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
void detached_inventory_OnPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void detached_inventory_OnTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
- Public Member Functions inherited from ScriptApiEntity
bool luaentity_Add (u16 id, const char *name)
 
void luaentity_Activate (u16 id, const std::string &staticdata, u32 dtime_s)
 
void luaentity_Deactivate (u16 id)
 
void luaentity_Remove (u16 id)
 
std::string luaentity_GetStaticdata (u16 id)
 
void luaentity_GetProperties (u16 id, ServerActiveObject *self, ObjectProperties *prop)
 
void luaentity_Step (u16 id, float dtime, const collisionMoveResult *moveresult)
 
bool luaentity_Punch (u16 id, ServerActiveObject *puncher, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s16 damage)
 
bool luaentity_on_death (u16 id, ServerActiveObject *killer)
 
void luaentity_Rightclick (u16 id, ServerActiveObject *clicker)
 
void luaentity_on_attach_child (u16 id, ServerActiveObject *child)
 
void luaentity_on_detach_child (u16 id, ServerActiveObject *child)
 
void luaentity_on_detach (u16 id, ServerActiveObject *parent)
 
- Public Member Functions inherited from ScriptApiEnv
void environment_Step (float dtime)
 
void environment_OnGenerated (v3s16 minp, v3s16 maxp, u32 blockseed)
 
void player_event (ServerActiveObject *player, const std::string &type)
 
void on_emerge_area_completion (v3s16 blockpos, int action, ScriptCallbackState *state)
 
void initializeEnvironment (ServerEnvironment *env)
 
- Public Member Functions inherited from ScriptApiModChannels
void on_modchannel_message (const std::string &channel, const std::string &sender, const std::string &message)
 
void on_modchannel_signal (const std::string &channel, ModChannelSignal signal)
 
- Public Member Functions inherited from ScriptApiNode
 ScriptApiNode ()=default
 
virtual ~ScriptApiNode ()=default
 
bool node_on_punch (v3s16 p, MapNode node, ServerActiveObject *puncher, const PointedThing &pointed)
 
bool node_on_dig (v3s16 p, MapNode node, ServerActiveObject *digger)
 
void node_on_construct (v3s16 p, MapNode node)
 
void node_on_destruct (v3s16 p, MapNode node)
 
bool node_on_flood (v3s16 p, MapNode node, MapNode newnode)
 
void node_after_destruct (v3s16 p, MapNode node)
 
bool node_on_timer (v3s16 p, MapNode node, f32 dtime)
 
void node_on_receive_fields (v3s16 p, const std::string &formname, const StringMap &fields, ServerActiveObject *sender)
 
- Public Member Functions inherited from ScriptApiNodemeta
 ScriptApiNodemeta ()=default
 
virtual ~ScriptApiNodemeta ()=default
 
int nodemeta_inventory_AllowMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
int nodemeta_inventory_AllowPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
int nodemeta_inventory_AllowTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void nodemeta_inventory_OnMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
void nodemeta_inventory_OnPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void nodemeta_inventory_OnTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
- Public Member Functions inherited from ScriptApiItem
bool item_OnDrop (ItemStack &item, ServerActiveObject *dropper, v3f pos)
 
bool item_OnPlace (ItemStack &item, ServerActiveObject *placer, const PointedThing &pointed)
 
bool item_OnUse (ItemStack &item, ServerActiveObject *user, const PointedThing &pointed)
 
bool item_OnSecondaryUse (ItemStack &item, ServerActiveObject *user, const PointedThing &pointed)
 
bool item_OnCraft (ItemStack &item, ServerActiveObject *user, const InventoryList *old_craft_grid, const InventoryLocation &craft_inv)
 
bool item_CraftPredict (ItemStack &item, ServerActiveObject *user, const InventoryList *old_craft_grid, const InventoryLocation &craft_inv)
 
- Public Member Functions inherited from ScriptApiPlayer
virtual ~ScriptApiPlayer ()=default
 
void on_newplayer (ServerActiveObject *player)
 
void on_dieplayer (ServerActiveObject *player, const PlayerHPChangeReason &reason)
 
bool on_respawnplayer (ServerActiveObject *player)
 
bool on_prejoinplayer (const std::string &name, const std::string &ip, std::string *reason)
 
bool can_bypass_userlimit (const std::string &name, const std::string &ip)
 
void on_joinplayer (ServerActiveObject *player, s64 last_login)
 
void on_leaveplayer (ServerActiveObject *player, bool timeout)
 
void on_cheat (ServerActiveObject *player, const std::string &cheat_type)
 
bool on_punchplayer (ServerActiveObject *player, ServerActiveObject *hitter, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s16 damage)
 
void on_rightclickplayer (ServerActiveObject *player, ServerActiveObject *clicker)
 
s32 on_player_hpchange (ServerActiveObject *player, s32 hp_change, const PlayerHPChangeReason &reason)
 
void on_playerReceiveFields (ServerActiveObject *player, const std::string &formname, const StringMap &fields)
 
void on_authplayer (const std::string &name, const std::string &ip, bool is_success)
 
int player_inventory_AllowMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
int player_inventory_AllowPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
int player_inventory_AllowTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void player_inventory_OnMove (const MoveAction &ma, int count, ServerActiveObject *player)
 
void player_inventory_OnPut (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
void player_inventory_OnTake (const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
 
- Public Member Functions inherited from ScriptApiServer
bool on_chat_message (const std::string &name, const std::string &message)
 
void on_mods_loaded ()
 
void on_shutdown ()
 
std::string formatChatMessage (const std::string &name, const std::string &message)
 
bool getAuth (const std::string &playername, std::string *dst_password, std::set< std::string > *dst_privs, s64 *dst_last_login=nullptr)
 
void createAuth (const std::string &playername, const std::string &password)
 
bool setPassword (const std::string &playername, const std::string &password)
 
- Public Member Functions inherited from ScriptApiSecurity
int getThread (lua_State *L)
 
void createEmptyEnv (lua_State *L)
 
void setLuaEnv (lua_State *L, int thread)
 
void initializeSecurity ()
 
void initializeSecurityClient ()
 

Private Member Functions

void InitializeModApi (lua_State *L, int top)
 

Additional Inherited Members

- Static Public Member Functions inherited from ScriptApiSecurity
static bool isSecure (lua_State *L)
 
static bool safeLoadString (lua_State *L, const std::string &code, const char *chunk_name)
 
static bool safeLoadFile (lua_State *L, const char *path, const char *display_name=NULL)
 
static bool checkPath (lua_State *L, const char *path, bool write_required, bool *write_allowed=NULL)
 
- Static Public Attributes inherited from ScriptApiNode
static struct EnumString es_DrawType []
 
static struct EnumString es_ContentParamType []
 
static struct EnumString es_ContentParamType2 []
 
static struct EnumString es_LiquidType []
 
static struct EnumString es_NodeBoxType []
 
static struct EnumString es_TextureAlphaMode []
 
- Protected Member Functions inherited from ScriptApiBase
lua_State * getStack ()
 
void realityCheck ()
 
void scriptError (int result, const char *fxn)
 
void stackDump (std::ostream &o)
 
void setGameDef (IGameDef *gamedef)
 
EnvironmentgetEnv ()
 
void setEnv (Environment *env)
 
GUIEnginegetGuiEngine ()
 
void setGuiEngine (GUIEngine *guiengine)
 
void objectrefGetOrCreate (lua_State *L, ServerActiveObject *cobj)
 
void pushPlayerHPChangeReason (lua_State *L, const PlayerHPChangeReason &reason)
 
- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
- Protected Member Functions inherited from ScriptApiItem
bool getItemCallback (const char *name, const char *callbackname, const v3s16 *p=nullptr)
 
void pushPointedThing (const PointedThing &pointed, bool hitpoint=false)
 
- 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...
 
- Protected Attributes inherited from ScriptApiBase
std::recursive_mutex m_luastackmutex
 
std::string m_last_run_mod
 
bool m_secure = false
 
int m_lock_recursion_count {}
 
std::thread::id m_owning_thread
 

Constructor & Destructor Documentation

◆ ServerScripting()

ServerScripting::ServerScripting ( Server server)

References g_settings, Settings::getBool(), infostream, InitializeModApi(), ScriptApiSecurity::initializeSecurity(), SCRIPTAPI_PRECHECKHEADER, ScriptApiBase::setGameDef(), and warningstream.

+ Here is the call graph for this function:

Member Function Documentation

◆ InitializeModApi()


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