aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Expand)AuthorAge
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* Server: affect bind_addr on constructor instead of start() (#6474)Loïc Blot2017-09-28
* main.cpp: server-only builds should not include client headersLoic Blot2017-09-07
* Add build date to minetest --version and increase readability (#6331)you2017-09-03
* Remove DSTACK support (#6346)Loïc Blot2017-08-30
* Network cleanup (#6302)Loïc Blot2017-08-24
* Modernize source code: last part (#6285)Loïc Blot2017-08-20
* Optimize headers (part 2) (#6272)Loïc Blot2017-08-18
* Modernize various files (src/m*) (#6267)Loïc Blot2017-08-18
* Cleanup various headers to reduce compilation times (#6255)Loïc Blot2017-08-16
* Cpp11 initializers 2 (#5999)Loïc Blot2017-06-17
* Clean up getTime helpersShadowNinja2017-04-28
* Player data to Database (#5475)Loïc Blot2017-04-23
* Windows: Skip cmd for release builds (#5416)adrido2017-04-07
* Server list cleanupShadowNinja2017-03-18
* Windows: dont link to libraries that are already linked by cmakeadrido2016-10-25
* DB::loadBlock copy removal & DB backend cleanupLoic Blot2016-05-17
* Fix typo in the info printed by --versionCraig Robbins2016-05-11
* Add platform name to --version informationCraig Robbins2016-05-11
* Add seperate cache pathShadowNinja2015-12-07
* Abort compile when attempting to build client with Irrlicht 1.8.2kwolekr2015-11-08
* Add server side ncurses terminalest312015-11-06
* Print direct command line responses to standard output instead of using the l...Perttu Ahola2015-11-02
* Fix server crashing on Lua errorsShadowNinja2015-10-31
* Remove some abort() callsest312015-10-26
* Fix compilation under MSVC and remove unnecessary conditional function prototypekwolekr2015-10-24
* init_log_streams: check if log_filename is empty.Jun Zhang2015-10-19
* Always use errorstream for DEBUG_EXCEPTION_HANDLERShadowNinja2015-10-14
* Refactor loggingShadowNinja2015-10-14
* Use CUSTOM_LOCALEDIR if specifiedShadowNinja2015-09-06
* Change i++ to ++iDavid Jones2015-08-25
* Clean up threadingShadowNinja2015-08-23
* Remove profiler.h include where it's not needed. Remove some unreachable and ...Loic Blot2015-07-21
* Revert the upper-case PROJECT_NAME nonsense that was part of #2402sfan52015-04-27
* Tests: Modularize unit testingkwolekr2015-04-26
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Clean up and tweak build systemShadowNinja2015-03-27
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Don't start a server for map migrationShadowNinja2015-03-06
* Clean up database API and save the local map on an intervalShadowNinja2015-03-06
* Rename --do-unittests to --run-unittests as @Zeno- and @sfan5 requestedLoic Blot2015-02-24
* Unit tests must be done at integration process.Loic Blot2015-02-21
* Replace std::list by std::vector into ServerMap::listAllLoadableBlocks Server...Loic Blot2015-02-17
* main.cpp rework * Move ClientLauncher class to a dedicated file * ClientLaunc...Loic Blot2015-02-12
* Small changes in the style of controlsngosang2015-02-12
* Reduce gettext wide/narrow and string/char* conversionsShadowNinja2015-02-05
* Create minidump on fatal Win32 exceptionskwolekr2015-02-02
* Reorganize supported video driver query mechanismskwolekr2015-01-18
* Performance fixes.onkrot2015-01-13
* Skip further loading of client if there was an exit signalChristophe Piveteau2014-12-28
eturn 0; } int NodeTimerRef::l_is_started(lua_State *L) { MAP_LOCK_REQUIRED; NodeTimerRef *o = checkobject(L, 1); ServerEnvironment *env = o->m_env; if(env == NULL) return 0; NodeTimer t = env->getMap().getNodeTimer(o->m_p); lua_pushboolean(L,(t.timeout != 0)); return 1; } int NodeTimerRef::l_get_timeout(lua_State *L) { MAP_LOCK_REQUIRED; NodeTimerRef *o = checkobject(L, 1); ServerEnvironment *env = o->m_env; if(env == NULL) return 0; NodeTimer t = env->getMap().getNodeTimer(o->m_p); lua_pushnumber(L,t.timeout); return 1; } int NodeTimerRef::l_get_elapsed(lua_State *L) { MAP_LOCK_REQUIRED; NodeTimerRef *o = checkobject(L, 1); ServerEnvironment *env = o->m_env; if(env == NULL) return 0; NodeTimer t = env->getMap().getNodeTimer(o->m_p); lua_pushnumber(L,t.elapsed); return 1; } NodeTimerRef::NodeTimerRef(v3s16 p, ServerEnvironment *env): m_p(p), m_env(env) { } NodeTimerRef::~NodeTimerRef() { } // Creates an NodeTimerRef and leaves it on top of stack // Not callable from Lua; all references are created on the C side. void NodeTimerRef::create(lua_State *L, v3s16 p, ServerEnvironment *env) { NodeTimerRef *o = new NodeTimerRef(p, env); *(void **)(lua_newuserdata(L, sizeof(void *))) = o; luaL_getmetatable(L, className); lua_setmetatable(L, -2); } void NodeTimerRef::set_null(lua_State *L) { NodeTimerRef *o = checkobject(L, -1); o->m_env = NULL; } void NodeTimerRef::Register(lua_State *L) { lua_newtable(L); int methodtable = lua_gettop(L); luaL_newmetatable(L, className); int metatable = lua_gettop(L); lua_pushliteral(L, "__metatable"); lua_pushvalue(L, methodtable); lua_settable(L, metatable); // hide metatable from Lua getmetatable() lua_pushliteral(L, "__index"); lua_pushvalue(L, methodtable); lua_settable(L, metatable); lua_pushliteral(L, "__gc"); lua_pushcfunction(L, gc_object); lua_settable(L, metatable); lua_pop(L, 1); // drop metatable luaL_openlib(L, 0, methods, 0); // fill methodtable lua_pop(L, 1); // drop methodtable // Cannot be created from Lua //lua_register(L, className, create_object); } const char NodeTimerRef::className[] = "NodeTimerRef"; const luaL_reg NodeTimerRef::methods[] = { luamethod(NodeTimerRef, start), luamethod(NodeTimerRef, set), luamethod(NodeTimerRef, stop), luamethod(NodeTimerRef, is_started), luamethod(NodeTimerRef, get_timeout), luamethod(NodeTimerRef, get_elapsed), {0,0} };