18#if CHECK_CLIENT_BUILD()
34 #if CHECK_CLIENT_BUILD()
35 static Client* getClient(lua_State *L);
36 static GUIEngine* getGuiEngine(lua_State *L);
53 T *scriptIfaceDowncast =
dynamic_cast<T*
>(scriptIface);
54 if (!scriptIfaceDowncast) {
55 throw LuaError(
"Requested unavailable ScriptApi - core engine bug!");
57 return scriptIfaceDowncast;
67 const luaL_Reg *methods,
68 const luaL_Reg *metamethods)
70 luaL_newmetatable(L, T::className);
71 luaL_register(L, NULL, metamethods);
72 int metatable = lua_gettop(L);
75 luaL_register(L, NULL, methods);
76 int methodtable = lua_gettop(L);
78 lua_pushvalue(L, methodtable);
79 lua_setfield(L, metatable,
"__index");
81 lua_getfield(L, metatable,
"__tostring");
82 bool default_tostring = lua_isnil(L, -1);
84 if (default_tostring) {
86 lua_setfield(L, metatable,
"__tostring");
90 lua_pushvalue(L, methodtable);
91 lua_setfield(L, metatable,
"__metatable");
100 T *obj = *
reinterpret_cast<T**
>(luaL_checkudata(L, narg, T::className));
102 luaL_error(L,
"Object of type %s has been deleted already", T::className);
114 T **ud =
reinterpret_cast<T **
>(lua_touserdata(L, 1));
133 static int l_deprecated_function(lua_State *L,
const char *good,
const char *bad, lua_CFunction func);
141 lua_pushfstring(L,
"%s: %p", T::className, t);
Definition emerge_internal.h:25
Definition environment.h:31
implementation of main menu based upon formspecs
Definition guiEngine.h:115
static bool registerFunction(lua_State *L, const char *name, lua_CFunction func, int top)
Definition l_base.cpp:86
static int l_deprecated_function(lua_State *L, const char *good, const char *bad, lua_CFunction func)
A wrapper for deprecated functions.
Definition l_base.cpp:97
static void registerClass(lua_State *L, const luaL_Reg *methods, const luaL_Reg *metamethods)
Definition l_base.h:66
static ServerInventoryManager * getServerInventoryMgr(lua_State *L)
Definition l_base.cpp:33
static Server * getServer(lua_State *L)
Definition l_base.cpp:28
static IGameDef * getGameDef(lua_State *L)
Definition l_base.cpp:45
static std::string getCurrentModPath(lua_State *L)
Definition l_base.cpp:72
static int defaultToString(lua_State *L)
Definition l_base.h:138
static ScriptApiBase * getScriptApiBase(lua_State *L)
Definition l_base.cpp:14
static Environment * getEnv(lua_State *L)
Definition l_base.cpp:50
static T * getScriptApi(lua_State *L)
Definition l_base.h:51
static EmergeThread * getEmergeThread(lua_State *L)
Definition l_base.cpp:67
static T * takeObjectForGC(lua_State *L)
Definition l_base.h:112
static T * checkObject(lua_State *L, int narg)
Definition l_base.h:98
The thread that runs SSCSM code.
Definition sscsm_environment.h:26
Definition serverinventorymgr.h:17