]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/cpp_api/s_client.cpp
code style fix on src/script/cpp_api/s_client.h
[dragonfireclient.git] / src / script / cpp_api / s_client.cpp
index 666fd693d865281afd64f0ef6f9bd2074ae01afb..a8a7d5e262b99ae8101f74812e9d0eecc34b9a86 100644 (file)
@@ -35,6 +35,17 @@ void ScriptApiClient::on_shutdown()
        runCallbacks(0, RUN_CALLBACKS_MODE_FIRST);
 }
 
+void ScriptApiClient::on_connect()
+{
+       SCRIPTAPI_PRECHECKHEADER
+
+       // get registered connect hooks
+       lua_getglobal(L, "core");
+       lua_getfield(L, -1, "registered_on_connect");
+       // Call callback
+       runCallbacks(0, RUN_CALLBACKS_MODE_FIRST);
+}
+
 bool ScriptApiClient::on_sending_message(const std::string &message)
 {
        SCRIPTAPI_PRECHECKHEADER