# HG changeset patch # User David Anderson # Date 1114973166 0 # Node ID 797ecc5394d6c3d264f6da72b504a4c1a9e8916d # Parent 948ae76c45b53c0a1e10aeb03b572955b628f983 Switched from MEMFUNC to STATICFUNC for simplicity diff -r 948ae76c45b5 -r 797ecc5394d6 sourcemm/stub_mm/stub_mm.cpp --- a/sourcemm/stub_mm/stub_mm.cpp Sun May 01 18:42:16 2005 +0000 +++ b/sourcemm/stub_mm/stub_mm.cpp Sun May 01 18:46:06 2005 +0000 @@ -18,7 +18,7 @@ //This has all of the necessary hook declarations. Read it! #include "meta_hooks.h" -void StubPlugin::ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) +void ServerActivate_handler(edict_t *pEdictList, int edictCount, int clientMax) { META_LOG(g_PLAPI, "ServerActivate() called: edictCount=%d, clientMax=%d", edictCount, clientMax); RETURN_META(MRES_IGNORED); @@ -36,18 +36,14 @@ return false; } - SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, m_ServerDll, &g_StubPlugin, ServerActivate, true); - - m_ServerDll_CC = SH_GET_CALLCLASS(IServerGameDLL, m_ServerDll); + SH_ADD_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true); return true; } bool StubPlugin::Unload(char *error, size_t maxlen) { - SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, m_ServerDll, &g_StubPlugin, ServerActivate, true); - - SH_RELEASE_CALLCLASS(m_ServerDll_CC); + SH_REMOVE_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true); return true; } diff -r 948ae76c45b5 -r 797ecc5394d6 sourcemm/stub_mm/stub_mm.h --- a/sourcemm/stub_mm/stub_mm.h Sun May 01 18:42:16 2005 +0000 +++ b/sourcemm/stub_mm/stub_mm.h Sun May 01 18:46:06 2005 +0000 @@ -30,9 +30,6 @@ const char *GetVersion(); const char *GetDate(); const char *GetLogTag(); -public: - //Called on ServerActivate. Same definition as server plugins - void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); private: IServerGameDLL *m_ServerDll; IServerGameDLL *m_ServerDll_CC; @@ -42,4 +39,7 @@ PLUGIN_GLOBALVARS(); +//Called on ServerActivate. Same definition as server plugins +void ServerActivate_handler(edict_t *pEdictList, int edictCount, int clientMax); + #endif //_INCLUDE_SAMPLEPLUGIN_H