#pragma once class CMLuaEnvironment : public CMPluginBase { private: std::map m_hookRefs; std::map m_serviceRefs; void CreateEnvironmentTable(); public: lua_State *L; CMLuaEnvironment(lua_State *L); virtual ~CMLuaEnvironment(); static CMLuaEnvironment* GetEnvironment(lua_State *L); static int GetEnvironmentId(lua_State *L); HANDLE HookEvent(const char *name, int ref); int UnhookEvent(HANDLE hHook); HANDLE CreateServiceFunction(const char *name, int ref); void DestroyServiceFunction(HANDLE hService); int Load() override; };