1.1 --- a/sourcemm/sample_mm/SamplePlugin.cpp Sat Apr 30 15:52:26 2005 +0000
1.2 +++ b/sourcemm/sample_mm/SamplePlugin.cpp Sat Apr 30 18:45:41 2005 +0000
1.3 @@ -108,6 +108,8 @@
1.4 return false;
1.5 }
1.6
1.7 + META_LOG(g_PLAPI, "Starting plugin.\n");
1.8 +
1.9 //We're hooking the following things as POST, in order to seem like Server Plugins.
1.10 //However, I don't actually know if Valve has done server plugins as POST or not.
1.11 //Change the last parameter to 'false' in order to change this to PRE.
1.12 @@ -139,6 +141,12 @@
1.13 //Hook ClientCommand to our function
1.14 SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, m_ServerClients, &g_SamplePlugin, ClientCommand, false);
1.15
1.16 + //Get the call class for IVServerEngine so we can safely call functions without
1.17 + // invoking their hooks (when needed).
1.18 + m_Engine_CC = SH_GET_CALLCLASS(m_Engine);
1.19 +
1.20 + SH_CALL(m_Engine_CC, &IVEngineServer::LogPrint)("All hooks started!\n");
1.21 +
1.22 return true;
1.23 }
1.24
1.25 @@ -159,6 +167,8 @@
1.26 SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, m_ServerClients, &g_SamplePlugin, ClientConnect, false);
1.27 SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, m_ServerClients, &g_SamplePlugin, ClientCommand, false);
1.28
1.29 + SH_RELEASE_CALLCLASS(m_Engine_CC);
1.30 +
1.31 return true;
1.32 }
1.33