1 /* ======== stub_mm ========
2 * Copyright (C) 2004-2005 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): David "BAILOPAN" Anderson
8 * ============================
14 StubPlugin g_StubPlugin;
16 PLUGIN_EXPOSE(SamplePlugin, g_StubPlugin);
18 //This has all of the necessary hook declarations. Read it!
19 #include "meta_hooks.h"
21 #define FIND_IFACE(func, assn_var, num_var, name, type) \
23 if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \
29 } while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \
32 snprintf(error, maxlen, "Could not find interface %s", name); \
36 void ServerActivate_handler(edict_t *pEdictList, int edictCount, int clientMax)
38 META_LOG(g_PLAPI, "ServerActivate() called: edictCount=%d, clientMax=%d", edictCount, clientMax);
39 RETURN_META(MRES_IGNORED);
42 bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
46 char iface_buffer[255];
49 strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMEDLL);
50 FIND_IFACE(serverFactory, m_ServerDll, num, iface_buffer, IServerGameDLL *);
52 SH_ADD_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true);
57 bool StubPlugin::Unload(char *error, size_t maxlen)
59 SH_REMOVE_HOOK_STATICFUNC(IServerGameDLL, ServerActivate, m_ServerDll, ServerActivate_handler, true);
64 bool StubPlugin::Pause(char *error, size_t maxlen)
69 bool StubPlugin::Unpause(char *error, size_t maxlen)
74 void StubPlugin::AllPluginsLoaded()
76 //This is an example of inter-plugin communication
78 void *ptr = g_SMAPI->MetaFactory("SamplePlugin", NULL, &id);
81 META_LOG(g_PLAPI, "Found Sample Plugin[%d] at (%p)!", id, ptr);
83 META_LOG(g_PLAPI, "Did not find Sample Plugin!");
87 const char *StubPlugin::GetAuthor()
92 const char *StubPlugin::GetName()
97 const char *StubPlugin::GetDescription()
102 const char *StubPlugin::GetURL()
104 return "http://www.mysite.com/";
107 const char *StubPlugin::GetLicense()
109 return "zlib/libpng";
112 const char *StubPlugin::GetVersion()
117 const char *StubPlugin::GetDate()
122 const char *StubPlugin::GetLogTag()