From a219fe08af12ab74dd115908805bb9436ba2246d Mon Sep 17 00:00:00 2001 From: fakuivan Date: Mon, 23 Jan 2017 20:58:25 -0300 Subject: [PATCH] Register the "think_hooks" library. --- extension.cpp | 1 + extension.h | 4 +++- include/think_hooks.inc | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/extension.cpp b/extension.cpp index d76c254..3ca0a2a 100644 --- a/extension.cpp +++ b/extension.cpp @@ -112,6 +112,7 @@ void ThinkHooks::SDK_OnAllLoaded() //creating the global OnServerThink forward m_pOnServerThink = forwards->CreateForward("OnServerThink", ET_Ignore, 0, NULL); + sharesys->RegisterLibrary(myself, LIB_NAME); m_bReady = true; } diff --git a/extension.h b/extension.h index 0ac01b7..86ce58a 100644 --- a/extension.h +++ b/extension.h @@ -48,6 +48,8 @@ #include "am-utility.h" #endif +#define LIB_NAME "think_hooks" + class MutexWrapper { public: @@ -87,7 +89,7 @@ class ThinkHooks : public SDKExtension * @brief This is called once all known extensions have been loaded. * Note: It is is a good idea to add natives here, if any are provided. */ - virtual void SDK_OnAllLoaded(); + virtual void SDK_OnAllLoaded(); /** * @brief Called when the pause state is changed. diff --git a/include/think_hooks.inc b/include/think_hooks.inc index f42afce..5766978 100644 --- a/include/think_hooks.inc +++ b/include/think_hooks.inc @@ -6,6 +6,8 @@ #endif #define _think_hooks_included +#define THINK_HOOKS_LIB_NAME "think_hooks" /**< You can use this macro to check ``LibraryExists(THINK_HOOKS_LIB_NAME)`` */ + /** * Called before every server think. Note that you should avoid * doing expensive computations or declaring large local arrays. @@ -37,8 +39,8 @@ public __ext_think_hooks_SetNTVOptional() public Extension __ext_think_hooks = { - name = "think_hooks", - file = "think_hooks.ext", + name = THINK_HOOKS_LIB_NAME, + file = THINK_HOOKS_LIB_NAME...".ext", #if defined AUTOLOAD_EXTENSIONS autoload = 1, #else