diff options
author | kwolekr <kwolekr@minetest.net> | 2015-08-11 22:27:54 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-08-12 23:56:12 -0400 |
commit | 2b04ab874d75711bc021a0cd8dc7fca68f4e6929 (patch) | |
tree | 04c1e9ad914c8c744cfd1055e2a8f6620d924c8b /src/script/cpp_api/s_server.cpp | |
parent | 738fbc66d096575bb9a1694056ce2d627a70c03d (diff) | |
download | hax-minetest-server-2b04ab874d75711bc021a0cd8dc7fca68f4e6929.tar.gz hax-minetest-server-2b04ab874d75711bc021a0cd8dc7fca68f4e6929.zip |
SAPI: Track last executed mod and include in error messages
Diffstat (limited to 'src/script/cpp_api/s_server.cpp')
-rw-r--r-- | src/script/cpp_api/s_server.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_server.cpp b/src/script/cpp_api/s_server.cpp index 5b4626f40..ec2f9c0af 100644 --- a/src/script/cpp_api/s_server.cpp +++ b/src/script/cpp_api/s_server.cpp @@ -67,6 +67,9 @@ void ScriptApiServer::getAuthHandler() 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"); @@ -133,7 +136,7 @@ bool ScriptApiServer::on_chat_message(const std::string &name, // Call callbacks lua_pushstring(L, name.c_str()); lua_pushstring(L, message.c_str()); - script_run_callbacks(L, 2, RUN_CALLBACKS_MODE_OR_SC); + runCallbacks(2, RUN_CALLBACKS_MODE_OR_SC); bool ate = lua_toboolean(L, -1); return ate; } @@ -146,6 +149,6 @@ void ScriptApiServer::on_shutdown() lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_shutdown"); // Call callbacks - script_run_callbacks(L, 0, RUN_CALLBACKS_MODE_FIRST); + runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } |