aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api/s_player.cpp')
-rw-r--r--src/script/cpp_api/s_player.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_player.cpp b/src/script/cpp_api/s_player.cpp
index f3c316650..578298e24 100644
--- a/src/script/cpp_api/s_player.cpp
+++ b/src/script/cpp_api/s_player.cpp
@@ -206,3 +206,14 @@ void ScriptApiPlayer::on_playerReceiveFields(ServerActiveObject *player,
runCallbacks(3, RUN_CALLBACKS_MODE_OR_SC);
}
+void ScriptApiPlayer::on_auth_failure(const std::string &name, const std::string &ip)
+{
+ SCRIPTAPI_PRECHECKHEADER
+
+ // Get core.registered_on_auth_failure
+ lua_getglobal(L, "core");
+ lua_getfield(L, -1, "registered_on_auth_fail");
+ lua_pushstring(L, name.c_str());
+ lua_pushstring(L, ip.c_str());
+ runCallbacks(2, RUN_CALLBACKS_MODE_FIRST);
+}