mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2024-12-02 14:24:16 +01:00
Switched from MEMFUNC to STATICFUNC for simplicity
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%4054
This commit is contained in:
parent
54a4d6d007
commit
095929dd76
@ -18,7 +18,7 @@ PLUGIN_EXPOSE(SamplePlugin, g_StubPlugin);
|
||||
//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 @@ bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, factories *list, char *error,
|
||||
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;
|
||||
}
|
||||
|
@ -30,9 +30,6 @@ public:
|
||||
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 @@ extern StubPlugin g_StubPlugin;
|
||||
|
||||
PLUGIN_GLOBALVARS();
|
||||
|
||||
//Called on ServerActivate. Same definition as server plugins
|
||||
void ServerActivate_handler(edict_t *pEdictList, int edictCount, int clientMax);
|
||||
|
||||
#endif //_INCLUDE_SAMPLEPLUGIN_H
|
||||
|
Loading…
Reference in New Issue
Block a user