11#include <unordered_map>
26#define SCRIPTAPI_LOCK_DEBUG
30#define BUILTIN_MOD_NAME "*builtin*"
32#define PCALL_RES(RES) { \
33 int result_ = (RES); \
35 scriptError(result_, __FUNCTION__); \
39#define runCallbacks(nargs, mode) \
40 runCallbacksRaw((nargs), (mode), __FUNCTION__)
42#define setOriginFromTable(index) \
43 setOriginFromTableRaw(index, __FUNCTION__)
54#if CHECK_CLIENT_BUILD()
70 FATAL_ERROR(
"ScriptApiBase created without ScriptingType!");
76 void loadMod(
const std::string &script_path,
const std::string &mod_name);
77 void loadScript(
const std::string &script_path);
79#if CHECK_CLIENT_BUILD()
80 void loadModFromMemory(
const std::string &mod_name);
94#if CHECK_CLIENT_BUILD()
116#if !CHECK_CLIENT_BUILD()
160#if CHECK_CLIENT_BUILD()
161 GUIEngine* getGuiEngine() {
return m_guiengine; }
162 void setGuiEngine(
GUIEngine* guiengine) { m_guiengine = guiengine; }
175#ifdef SCRIPTAPI_LOCK_DEBUG
187#if CHECK_CLIENT_BUILD()
RunCallbacksMode
Definition c_internal.h:83
Definition emerge_internal.h:25
Definition environment.h:34
implementation of main menu based uppon formspecs
Definition guiEngine.h:113
Definition l_inventory.h:18
static std::string getCurrentModNameInsecure(lua_State *L)
Definition s_base.cpp:220
void setOriginDirect(const char *origin)
Definition s_base.cpp:420
void addObjectReference(ServerActiveObject *cobj)
Definition s_base.cpp:446
std::recursive_mutex m_luastackmutex
Definition s_base.h:172
void setEnv(Environment *env)
Definition s_base.h:158
void stackDump(std::ostream &o)
Definition s_base.cpp:393
void pushPlayerHPChangeReason(lua_State *L, const PlayerHPChangeReason &reason)
Definition s_base.cpp:512
Environment * getEnv()
Definition s_base.h:157
IGameDef * getGameDef()
Definition s_base.h:92
EmergeThread * m_emerge
Definition s_base.h:190
IGameDef * m_gamedef
Definition s_base.h:185
void realityCheck()
Definition s_base.cpp:377
ScriptingType getType()
Definition s_base.h:90
DISABLE_CLASS_COPY(ScriptApiBase)
EmergeThread * getEmergeThread()
Definition s_base.h:165
int m_lock_recursion_count
Definition s_base.h:176
bool m_secure
Definition s_base.h:174
static std::string getCurrentModName(lua_State *L)
Definition s_base.cpp:228
void clientOpenLibs(lua_State *L)
Definition s_base.h:117
void setEmergeThread(EmergeThread *emerge)
Definition s_base.h:166
ScriptApiBase()
Definition s_base.h:68
ScriptingType m_type
Definition s_base.h:192
std::string m_last_run_mod
Definition s_base.h:173
void loadScript(const std::string &script_path)
Definition s_base.cpp:267
void loadMod(const std::string &script_path, const std::string &mod_name)
Definition s_base.cpp:259
void removeObjectReference(ServerActiveObject *cobj)
Definition s_base.cpp:467
Server * getServer()
Definition s_base.cpp:544
lua_State * m_luastack
Definition s_base.h:183
void setGameDef(IGameDef *gamedef)
Definition s_base.h:155
static int luaPanic(lua_State *L)
Definition s_base.cpp:163
const std::string & getOrigin()
Definition s_base.h:100
lua_State * getStack()
Definition s_base.h:145
void runCallbacksRaw(int nargs, RunCallbacksMode mode, const char *fxn)
Definition s_base.cpp:336
void checkSetByBuiltin()
Definition s_base.cpp:202
virtual ~ScriptApiBase()
Definition s_base.cpp:158
std::thread::id m_owning_thread
Definition s_base.h:177
void scriptError(int result, const char *fxn)
Definition s_base.cpp:388
void setOriginFromTableRaw(int index, const char *fxn)
Definition s_base.cpp:425
Environment * m_environment
Definition s_base.h:186
void objectrefGetOrCreate(lua_State *L, ServerActiveObject *cobj)
Definition s_base.cpp:491
Definition serveractiveobject.h:41
Definition test_moveaction.cpp:12
#define FATAL_ERROR(msg)
Definition debug.h:33
ScriptingType
Definition s_base.h:45
Definition player_sao.h:227