dvander@370: /**
ds@653: * vim: set ts=4 :
ds@1330: * =============================================================================
dvander@1231: * SourceMod
ds@3099: * Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
ds@1330: * =============================================================================
dvander@370: *
ds@1330: * This program is free software; you can redistribute it and/or modify it under
ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330: * Free Software Foundation.
dvander@1231: *
ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ds@1330: * details.
dvander@1231: *
ds@1330: * You should have received a copy of the GNU General Public License along with
ds@1330: * this program. If not, see .
dvander@1231: *
ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in
ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants
ds@1330: * this exception to all derivative works. AlliedModders LLC defines further
ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330: * or .
dvander@370: *
dvander@370: * Version: $Id$
dvander@370: */
dvander@370:
dvander@145: #ifndef _INCLUDE_SOURCEMOD_MM_API_H_
dvander@145: #define _INCLUDE_SOURCEMOD_MM_API_H_
dvander@145:
skamonkey@3515: #if SOURCE_ENGINE >= SE_ALIENSWARM
ds@3099: #include "convar_sm_swarm.h"
skamonkey@3613: #elif SOURCE_ENGINE >= SE_LEFT4DEAD
ds@2400: #include "convar_sm_l4d.h"
skamonkey@3613: #elif SOURCE_ENGINE >= SE_ORANGEBOX
ds@2400: #include "convar_sm_ob.h"
faluco@1541: #else
ds@2400: #include "convar_sm.h"
faluco@1541: #endif
dvander@145: #include
dvander@209: #include
dvander@453: #include
dvander@644: #include
dvander@530: #include
faluco@654: #include
faluco@656: #include
dvander@145:
faluco@1541: #ifndef METAMOD_PLAPI_VERSION
faluco@1541: #include
faluco@1541: #endif
faluco@1541:
dvander@162: /**
dvander@162: * @file Contains wrappers around required Metamod:Source API exports
dvander@162: */
dvander@162:
ds@675: class SourceMod_Core :
ds@675: public ISmmPlugin,
ds@675: public IMetamodListener
dvander@145: {
dvander@145: public:
dvander@145: bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
dvander@145: bool Unload(char *error, size_t maxlen);
dvander@145: bool Pause(char *error, size_t maxlen);
dvander@145: bool Unpause(char *error, size_t maxlen);
dvander@145: void AllPluginsLoaded();
dvander@145: public:
dvander@145: const char *GetAuthor();
dvander@145: const char *GetName();
dvander@145: const char *GetDescription();
dvander@145: const char *GetURL();
dvander@145: const char *GetLicense();
dvander@145: const char *GetVersion();
dvander@145: const char *GetDate();
dvander@145: const char *GetLogTag();
ds@675: public:
ds@675: void OnVSPListening(IServerPluginCallbacks *iface);
dvander@2845: #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
ds@1145: void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
ds@1145: #else
ds@1145: void OnPluginUnload(PluginId id);
ds@1145: #endif
dvander@1655: void *OnMetamodQuery(const char *iface, int *ret);
dvander@145: };
dvander@145:
dvander@160: extern SourceMod_Core g_SourceMod_Core;
dvander@209: extern IVEngineServer *engine;
dvander@209: extern IServerGameDLL *gamedll;
faluco@226: extern IServerGameClients *serverClients;
ds@457: extern ICvar *icvar;
dvander@304: extern ISmmPluginManager *g_pMMPlugins;
dvander@448: extern CGlobalVars *gpGlobals;
dvander@453: extern IGameEventManager2 *gameevents;
dvander@496: extern SourceHook::CallClass *enginePatch;
dvander@532: extern SourceHook::CallClass *gamedllPatch;
dvander@530: extern IUniformRandomStream *engrandom;
dvander@644: extern IPlayerInfoManager *playerinfo;
faluco@654: extern IBaseFileSystem *basefilesystem;
faluco@656: extern IEngineSound *enginesound;
faluco@659: extern IServerPluginHelpers *serverpluginhelpers;
dvander@1581: extern IServerPluginCallbacks *vsp_interface;
dvander@1581: extern int vsp_version;
dvander@496:
dvander@496: #define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
dvander@532: #define SERVER_CALL(func) SH_CALL(gamedllPatch, &IServerGameDLL::func)
dvander@145:
dvander@145: PLUGIN_GLOBALVARS();
dvander@145:
dvander@145: #endif //_INCLUDE_SOURCEMOD_MM_API_H_
dvander@1655: