More consistency of some sort...
Oh god, what has possessed me to do this?
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
16 #include "sourcemm_api.h"
17 #include "sm_version.h"
18 #include "sourcemod.h"
20 SourceMod_Core g_SourceMod_Core;
21 IVEngineServer *engine = NULL;
22 IServerGameDLL *gamedll = NULL;
23 IServerGameClients *serverClients = NULL;
24 ISmmPluginManager *g_pMMPlugins = NULL;
25 CGlobalVars *gpGlobals = NULL;
27 IGameEventManager2 *gameevents = NULL;
28 IUniformRandomStream *engrandom = NULL;
29 CallClass<IVEngineServer> *enginePatch = NULL;
30 CallClass<IServerGameDLL> *gamedllPatch = NULL;
31 IPlayerInfoManager *playerinfo = NULL;
33 PLUGIN_EXPOSE(SourceMod, g_SourceMod_Core);
35 bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
39 GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
40 GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
41 GET_V_IFACE_CURRENT(serverFactory, serverClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
42 GET_V_IFACE_CURRENT(engineFactory, icvar, ICvar, VENGINE_CVAR_INTERFACE_VERSION);
43 GET_V_IFACE_CURRENT(engineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
44 GET_V_IFACE_CURRENT(engineFactory, engrandom, IUniformRandomStream, VENGINE_SERVER_RANDOM_INTERFACE_VERSION);
46 /* :TODO: Make this optional and... make it find earlier versions [?] */
47 GET_V_IFACE_CURRENT(serverFactory, playerinfo, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
49 if ((g_pMMPlugins = (ISmmPluginManager *)g_SMAPI->MetaFactory(MMIFACE_PLMANAGER, NULL, NULL)) == NULL)
53 snprintf(error, maxlen, "Unable to find interface %s", MMIFACE_PLMANAGER);
58 gpGlobals = ismm->pGlobals();
60 return g_SourceMod.InitializeSourceMod(error, maxlen, late);
63 bool SourceMod_Core::Unload(char *error, size_t maxlen)
65 g_SourceMod.CloseSourceMod();
69 bool SourceMod_Core::Pause(char *error, size_t maxlen)
74 bool SourceMod_Core::Unpause(char *error, size_t maxlen)
79 void SourceMod_Core::AllPluginsLoaded()
83 const char *SourceMod_Core::GetAuthor()
85 return "AlliedModders, LLC";
88 const char *SourceMod_Core::GetName()
93 const char *SourceMod_Core::GetDescription()
95 return "Extensible administration and scripting system";
98 const char *SourceMod_Core::GetURL()
100 return "http://www.sourcemod.net/";
103 const char *SourceMod_Core::GetLicense()
105 return "See LICENSE.txt";
108 const char *SourceMod_Core::GetVersion()
110 return SVN_FULL_VERSION;
113 const char *SourceMod_Core::GetDate()
118 const char *SourceMod_Core::GetLogTag()