Skip to content

Commit

Permalink
Register the "think_hooks" library.
Browse files Browse the repository at this point in the history
  • Loading branch information
fakuivan committed Jan 23, 2017
1 parent bc9c1d3 commit a219fe0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include "am-utility.h"
#endif

#define LIB_NAME "think_hooks"

class MutexWrapper
{
public:
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions include/think_hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a219fe0

Please sign in to comment.