From 4fb0949ddf1bfd69d9afeb7b29c7ec98aa6ed09a Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Wed, 31 May 2023 03:09:30 +0200 Subject: [PATCH] feat: add OnError event --- src/LuaEngine/LuaEngine.cpp | 1 + src/LuaEngine/LuaEngine.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/LuaEngine/LuaEngine.cpp b/src/LuaEngine/LuaEngine.cpp index 89a00d3..b238504 100644 --- a/src/LuaEngine/LuaEngine.cpp +++ b/src/LuaEngine/LuaEngine.cpp @@ -579,6 +579,7 @@ int Eluna::StackTrace(lua_State *_L) // dirty stack? // Stack: errmsg, debug, tracemsg + sEluna->OnError(std::string(lua_tostring(_L, -1))); return 1; } diff --git a/src/LuaEngine/LuaEngine.h b/src/LuaEngine/LuaEngine.h index 62c880e..9d259bd 100644 --- a/src/LuaEngine/LuaEngine.h +++ b/src/LuaEngine/LuaEngine.h @@ -23,6 +23,7 @@ #include "LFG.h" #include "ElunaUtility.h" #include "HttpManager.h" +#include "EventEmitter.h" #include #include @@ -241,6 +242,7 @@ public: EventMgr* eventMgr; HttpManager httpManager; QueryCallbackProcessor queryProcessor; + EventEmitter OnError; BindingMap< EventKey >* ServerEventBindings; BindingMap< EventKey >* PlayerEventBindings;