*/
#include "scripting_game.h"
+#include "server.h"
#include "log.h"
#include "cpp_api/s_internal.h"
#include "lua_api/l_base.h"
#include "lua_api/l_server.h"
#include "lua_api/l_util.h"
#include "lua_api/l_vmanip.h"
+#include "lua_api/l_settings.h"
extern "C" {
#include "lualib.h"
//TODO add security
- luaL_openlibs(getStack());
-
SCRIPTAPI_PRECHECKHEADER
- // Create the main minetest table
- lua_newtable(L);
+ lua_getglobal(L, "core");
+ int top = lua_gettop(L);
lua_newtable(L);
lua_setfield(L, -2, "object_refs");
lua_newtable(L);
lua_setfield(L, -2, "luaentities");
- lua_setglobal(L, "minetest");
-
// Initialize our lua_api modules
- lua_getglobal(L, "minetest");
- int top = lua_gettop(L);
InitializeModApi(L, top);
lua_pop(L, 1);
- infostream << "SCRIPTAPI: initialized game modules" << std::endl;
+ // Push builtin initialization type
+ lua_pushstring(L, "game");
+ lua_setglobal(L, "INIT");
+
+ infostream << "SCRIPTAPI: Initialized game modules" << std::endl;
}
void GameScripting::InitializeModApi(lua_State *L, int top)
NodeMetaRef::Register(L);
NodeTimerRef::Register(L);
ObjectRef::Register(L);
+ LuaSettings::Register(L);
+}
+
+void log_deprecated(std::string message)
+{
+ log_deprecated(NULL,message);
}