1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/sourcemm/stub_mm/stub_mm.cpp Tue Apr 19 22:05:41 2005 +0000
1.3 @@ -0,0 +1,108 @@
1.4 +/* ======== stub_mm ========
1.5 +* Copyright (C) 2004-2005 Metamod:Source Development Team
1.6 +* No warranties of any kind
1.7 +*
1.8 +* License: zlib/libpng
1.9 +*
1.10 +* Author(s): David "BAILOPAN" Anderson
1.11 +* ============================
1.12 +*/
1.13 +
1.14 +#include <oslink.h>
1.15 +#include "stub_mm.h"
1.16 +
1.17 +StubPlugin g_StubPlugin;
1.18 +
1.19 +PLUGIN_EXPOSE(SamplePlugin, g_StubPlugin);
1.20 +
1.21 +//This has all of the necessary hook declarations. Read it!
1.22 +#include "meta_hooks.h"
1.23 +
1.24 +void StubPlugin::ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
1.25 +{
1.26 + META_LOG(g_PLAPI, "ServerActivate() called: edictCount=%d, clientMax=%d", edictCount, clientMax);
1.27 + RETURN_META(MRES_IGNORED);
1.28 +}
1.29 +
1.30 +bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, factories *list, char *error, size_t maxlen)
1.31 +{
1.32 + PLUGIN_SAVEVARS();
1.33 +
1.34 + m_ServerDll = (IServerGameDLL *)((ismm->serverFactory())(INTERFACEVERSION_SERVERGAMEDLL, NULL));
1.35 +
1.36 + if (!m_ServerDll)
1.37 + {
1.38 + snprintf(error, maxlen, "Could not find interface %s", INTERFACEVERSION_SERVERGAMEDLL);
1.39 + return false;
1.40 + }
1.41 +
1.42 + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, m_ServerDll, &g_StubPlugin, ServerActivate, true);
1.43 +
1.44 + m_ServerDll_CC = SH_GET_CALLCLASS(IServerGameDLL, m_ServerDll);
1.45 +
1.46 + return true;
1.47 +}
1.48 +
1.49 +bool StubPlugin::Unload(char *error, size_t maxlen)
1.50 +{
1.51 + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, m_ServerDll, &g_StubPlugin, ServerActivate, true);
1.52 +
1.53 + SH_RELEASE_CALLCLASS(m_ServerDll_CC);
1.54 +
1.55 + return true;
1.56 +}
1.57 +
1.58 +bool StubPlugin::Pause(char *error, size_t maxlen)
1.59 +{
1.60 + return true;
1.61 +}
1.62 +
1.63 +bool StubPlugin::Unpause(char *error, size_t maxlen)
1.64 +{
1.65 + return true;
1.66 +}
1.67 +
1.68 +void StubPlugin::AllPluginsLoaded()
1.69 +{
1.70 +
1.71 +}
1.72 +
1.73 +const char *StubPlugin::GetAuthor()
1.74 +{
1.75 + return "AUTHOR";
1.76 +}
1.77 +
1.78 +const char *StubPlugin::GetName()
1.79 +{
1.80 + return "Stub Plugin";
1.81 +}
1.82 +
1.83 +const char *StubPlugin::GetDescription()
1.84 +{
1.85 + return "Stub Plugin";
1.86 +}
1.87 +
1.88 +const char *StubPlugin::GetURL()
1.89 +{
1.90 + return "http://www.mysite.com/";
1.91 +}
1.92 +
1.93 +const char *StubPlugin::GetLicense()
1.94 +{
1.95 + return "zlib/libpng";
1.96 +}
1.97 +
1.98 +const char *StubPlugin::GetVersion()
1.99 +{
1.100 + return "1.00";
1.101 +}
1.102 +
1.103 +const char *StubPlugin::GetDate()
1.104 +{
1.105 + return __DATE__;
1.106 +}
1.107 +
1.108 +const char *StubPlugin::GetLogTag()
1.109 +{
1.110 + return "STUB";
1.111 +}