aboutsummaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
...
* Fix broken client if openal cannot be opened (#9804)Loïc Blot2020-05-05
* Sky API: Rename *_tint to fog_*_tint for consistencySmallJoker2020-05-05
* Rename moveresult speed to velocitySmallJoker2020-05-05
* Fix small typo (#9813)oilboi2020-05-05
* Android: some java-part improvements (#9760)Maksim2020-05-04
* Change default keys for cam/minimap to C/V (#9779)Wuzzy2020-05-04
* Add 'content_offset' and 'padding' style properties for buttons (#9661)Hugues Ross2020-05-02
* Add a convention about z_index (#9701)Wuzzy2020-05-02
* Auto delete MetaData when = 0 (#8770)Lejo2020-05-02
* ci: Update Github Actions workflows (#9774)sfan52020-05-02
* set_fov: Add support for time-based transitions (#9705)ANAND2020-05-02
* Allow connection info to be missing from minetest.get_player_information() (#...sfan52020-05-01
* Give the online lua mainmenu also the client_list and mods (#8691)Lejo2020-05-01
* Fix gettext detection and locale building (#9772)Juozas2020-04-29
* Add docker build stage on Github actionsLoic Blot2020-04-29
* Add MetricsBackend with prometheus counter supportLoic Blot2020-04-29
* Fix breath_bar scaling; delay breath_bar hiding by one second (#8271)ANAND2020-04-28
* cmake: Silence warnings. (#9750)orbea2020-04-28
* Rewrite builtin item entity to use collision infosfan52020-04-27
* Expose collision information to LuaEntity on_stepsfan52020-04-27
* Remove /LTCG from when compiling with clang-cl (#9765)k.h.lai2020-04-27
* Fix detection of in-place path_locale when RUN_IN_PLACE=0sfan52020-04-27
* Add STATIC_LOCALEDIR to BUILD_INFO and move it to version.cppsfan52020-04-27
* Forbid object:attach(obj, ...) (#9762)Loïc Blot2020-04-27
* Script: Enforce type checks if not nil (#9748)SmallJoker2020-04-27
* Fix truncation warning for F1000_MIN, F1000_MAXsfan52020-04-27
* script: Put getGuiEngine() inside a client-only #ifdefsfan52020-04-27
* builtin: Correctly indicate failure in /spawnentitysfan52020-04-27
* script: Fix add_entity returning unusable ref if object deleted in on_activatesfan52020-04-27
* Add PostgreSQL authentication backend (#9756)Loïc Blot2020-04-27
* Add new command /revokeme <priv> (#9584)David Leal2020-04-26
* Remove unused lookup table from noise.cppsfan52020-04-26
* Fix mapgen settings in minetest.conf being ignored (#9737)sfan52020-04-26
* Fix UpdateBonePosition() breaking animations (#9577)theviper1212020-04-26
* Add `animated_image` to clickthrough elements (#9724)v-rob2020-04-25
* Fix DPI scaling on Windowssfan52020-04-25
* mapblock_mesh: Optimize a few things (#9713)sfan52020-04-25
* Ensure game is shutdown if server throws exception (#9742)Paul Ouellette2020-04-25
* Simplify how parseElement splits element string (#9726)Pierre-Yves Rollo2020-04-25
* Add server side translations capability (#9733)EvidenceB Kidscode2020-04-25
* Add LevelDB auth database. (#9476)luk3yx2020-04-23
* Camera: Fix shootline line offsets II (#9730)SmallJoker2020-04-23
* Android: add OpenGL ES 2 support (#9715)Maksim2020-04-22
* minetest.serialize: Reversible number serialization (#9722)HybridDog2020-04-22
* Fix configuration caching in log_deprecated (#9697)HybridDog2020-04-22
* Improve protocol-level receiving code (#9617)sfan52020-04-20
* Fix build badge since switching to github actionsLoïc Blot2020-04-20
* Replace travis with github actions (#9641)Loïc Blot2020-04-20
* Fix alias handling of get_content_id (#9712)sfan52020-04-19
* Reuse object_shader for "wielditem" and "item" entity drawtypes (#9537)Danila Shutov2020-04-19
lc">// Remove key from privs table s64 last_login; if(!getintfield(L, -1, "last_login", last_login)) throw LuaError("Authentication handler didn't return last_login"); if (dst_last_login) *dst_last_login = (s64)last_login; return true; } void ScriptApiServer::getAuthHandler() { lua_State *L = getStack(); lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_auth_handler"); if (lua_isnil(L, -1)){ lua_pop(L, 1); lua_getfield(L, -1, "builtin_auth_handler"); } setOriginFromTable(-1); lua_remove(L, -2); // Remove core if (lua_type(L, -1) != LUA_TTABLE) throw LuaError("Authentication handler table not valid"); } void ScriptApiServer::readPrivileges(int index, std::set<std::string> &result) { lua_State *L = getStack(); result.clear(); lua_pushnil(L); if (index < 0) index -= 1; while (lua_next(L, index) != 0) { // key at index -2 and value at index -1 std::string key = luaL_checkstring(L, -2); bool value = readParam<bool>(L, -1); if (value) result.insert(key); // removes value, keeps key for next iteration lua_pop(L, 1); } } void ScriptApiServer::createAuth(const std::string &playername, const std::string &password) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); getAuthHandler(); lua_getfield(L, -1, "create_auth"); lua_remove(L, -2); // Remove auth handler if (lua_type(L, -1) != LUA_TFUNCTION) throw LuaError("Authentication handler missing create_auth"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); PCALL_RES(lua_pcall(L, 2, 0, error_handler)); lua_pop(L, 1); // Pop error handler } bool ScriptApiServer::setPassword(const std::string &playername, const std::string &password) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); getAuthHandler(); lua_getfield(L, -1, "set_password"); lua_remove(L, -2); // Remove auth handler if (lua_type(L, -1) != LUA_TFUNCTION) throw LuaError("Authentication handler missing set_password"); lua_pushstring(L, playername.c_str()); lua_pushstring(L, password.c_str()); PCALL_RES(lua_pcall(L, 2, 1, error_handler)); lua_remove(L, error_handler); return lua_toboolean(L, -1); } bool ScriptApiServer::on_chat_message(const std::string &name, const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_chat_messages"); // Call callbacks lua_pushstring(L, name.c_str()); lua_pushstring(L, message.c_str()); runCallbacks(2, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } void ScriptApiServer::on_mods_loaded() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_mods_loaded"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiServer::on_shutdown() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_shutdown"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } std::string ScriptApiServer::formatChatMessage(const std::string &name, const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Push function onto stack lua_getglobal(L, "core"); lua_getfield(L, -1, "format_chat_message"); // Push arguments onto stack lua_pushstring(L, name.c_str()); lua_pushstring(L, message.c_str()); // Actually call the function lua_call(L, 2, 1); // Fetch return value std::string ret = lua_tostring(L, -1); lua_pop(L, 1); return ret; }