2 * ===============================================================
3 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
4 * ===============================================================
6 * This file is not open source and may not be copied without explicit
7 * written permission of AlliedModders LLC. This file may not be redistributed
8 * in whole or significant part.
9 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #include "sourcemm_api.h"
16 #include "sm_version.h"
17 #include "sourcemod.h"
19 SourceMod_Core g_SourceMod_Core;
20 IVEngineServer *engine = NULL;
21 IServerGameDLL *gamedll = NULL;
22 IServerGameClients *serverClients = NULL;
23 ISmmPluginManager *g_pMMPlugins = NULL;
24 CGlobalVars *gpGlobals = NULL;
26 IGameEventManager2 *gameevents = NULL;
28 PLUGIN_EXPOSE(SourceMod, g_SourceMod_Core);
30 bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
34 GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
35 GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
36 GET_V_IFACE_CURRENT(serverFactory, serverClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
37 GET_V_IFACE_CURRENT(engineFactory, icvar, ICvar, VENGINE_CVAR_INTERFACE_VERSION);
38 GET_V_IFACE_CURRENT(engineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
40 if ((g_pMMPlugins = (ISmmPluginManager *)g_SMAPI->MetaFactory(MMIFACE_PLMANAGER, NULL, NULL)) == NULL)
44 snprintf(error, maxlen, "Unable to find interface %s", MMIFACE_PLMANAGER);
49 gpGlobals = ismm->pGlobals();
51 return g_SourceMod.InitializeSourceMod(error, maxlen, late);
54 bool SourceMod_Core::Unload(char *error, size_t maxlen)
56 g_SourceMod.CloseSourceMod();
60 bool SourceMod_Core::Pause(char *error, size_t maxlen)
65 bool SourceMod_Core::Unpause(char *error, size_t maxlen)
70 void SourceMod_Core::AllPluginsLoaded()
74 const char *SourceMod_Core::GetAuthor()
76 return "AlliedModders, LLC";
79 const char *SourceMod_Core::GetName()
84 const char *SourceMod_Core::GetDescription()
86 return "Extensible administration and scripting system";
89 const char *SourceMod_Core::GetURL()
91 return "http://www.sourcemod.net/";
94 const char *SourceMod_Core::GetLicense()
96 return "See LICENSE.txt";
99 const char *SourceMod_Core::GetVersion()
101 return SOURCEMOD_VERSION;
104 const char *SourceMod_Core::GetDate()
109 const char *SourceMod_Core::GetLogTag()