2007-01-25 23:36:38 +01:00
|
|
|
/**
|
2007-03-22 22:50:20 +01:00
|
|
|
* vim: set ts=4 :
|
2007-08-01 04:12:47 +02:00
|
|
|
* ================================================================
|
|
|
|
* SourceMod
|
|
|
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ================================================================
|
2007-01-25 23:36:38 +01:00
|
|
|
*
|
2007-08-01 04:12:47 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License,
|
|
|
|
* version 3.0, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to
|
|
|
|
* link the code of this program (as well as its derivative works) to
|
|
|
|
* "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
|
|
|
|
* Game MODs that run on software by the Valve Corporation. You must
|
|
|
|
* obey the GNU General Public License in all respects for all other
|
|
|
|
* code used. Additionally, AlliedModders LLC grants this exception
|
|
|
|
* to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version
|
|
|
|
* JULY-31-2007), or <http://www.sourcemod.net/license.php>.
|
2007-01-25 23:36:38 +01:00
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
2006-11-04 20:27:20 +01:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_MM_API_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_MM_API_H_
|
|
|
|
|
2007-02-08 22:41:28 +01:00
|
|
|
#include "convar_sm.h"
|
2006-11-04 20:27:20 +01:00
|
|
|
#include <ISmmPlugin.h>
|
2006-12-13 12:16:20 +01:00
|
|
|
#include <eiface.h>
|
2007-02-08 02:11:45 +01:00
|
|
|
#include <igameevents.h>
|
2007-03-18 00:03:44 +01:00
|
|
|
#include <iplayerinfo.h>
|
2007-02-26 05:24:06 +01:00
|
|
|
#include <random.h>
|
2007-03-25 22:20:43 +02:00
|
|
|
#include <filesystem.h>
|
2007-03-26 00:25:45 +02:00
|
|
|
#include <IEngineSound.h>
|
2006-11-04 20:27:20 +01:00
|
|
|
|
2006-11-08 08:44:26 +01:00
|
|
|
/**
|
|
|
|
* @file Contains wrappers around required Metamod:Source API exports
|
|
|
|
*/
|
|
|
|
|
2007-04-08 20:19:06 +02:00
|
|
|
class SourceMod_Core :
|
|
|
|
public ISmmPlugin,
|
|
|
|
public IMetamodListener
|
2006-11-04 20:27:20 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
|
|
|
|
bool Unload(char *error, size_t maxlen);
|
|
|
|
bool Pause(char *error, size_t maxlen);
|
|
|
|
bool Unpause(char *error, size_t maxlen);
|
|
|
|
void AllPluginsLoaded();
|
|
|
|
public:
|
|
|
|
const char *GetAuthor();
|
|
|
|
const char *GetName();
|
|
|
|
const char *GetDescription();
|
|
|
|
const char *GetURL();
|
|
|
|
const char *GetLicense();
|
|
|
|
const char *GetVersion();
|
|
|
|
const char *GetDate();
|
|
|
|
const char *GetLogTag();
|
2007-04-08 20:19:06 +02:00
|
|
|
public:
|
|
|
|
void OnVSPListening(IServerPluginCallbacks *iface);
|
2007-07-23 20:30:02 +02:00
|
|
|
#if PLAPI_VERSION >= 12
|
|
|
|
void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
|
|
|
|
#else
|
|
|
|
void OnPluginUnload(PluginId id);
|
|
|
|
#endif
|
2006-11-04 20:27:20 +01:00
|
|
|
};
|
|
|
|
|
2006-11-08 08:32:44 +01:00
|
|
|
extern SourceMod_Core g_SourceMod_Core;
|
2006-12-13 12:16:20 +01:00
|
|
|
extern IVEngineServer *engine;
|
|
|
|
extern IServerGameDLL *gamedll;
|
2006-12-28 01:48:09 +01:00
|
|
|
extern IServerGameClients *serverClients;
|
2007-02-08 22:41:28 +01:00
|
|
|
extern ICvar *icvar;
|
2007-01-17 04:01:38 +01:00
|
|
|
extern ISmmPluginManager *g_pMMPlugins;
|
2007-02-07 09:44:48 +01:00
|
|
|
extern CGlobalVars *gpGlobals;
|
2007-02-08 02:11:45 +01:00
|
|
|
extern IGameEventManager2 *gameevents;
|
2007-02-15 21:35:17 +01:00
|
|
|
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
2007-02-26 06:26:54 +01:00
|
|
|
extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
|
2007-02-26 05:24:06 +01:00
|
|
|
extern IUniformRandomStream *engrandom;
|
2007-03-18 00:03:44 +01:00
|
|
|
extern IPlayerInfoManager *playerinfo;
|
2007-03-25 22:20:43 +02:00
|
|
|
extern IBaseFileSystem *basefilesystem;
|
2007-03-26 00:25:45 +02:00
|
|
|
extern IEngineSound *enginesound;
|
2007-03-29 21:48:54 +02:00
|
|
|
extern IServerPluginHelpers *serverpluginhelpers;
|
2007-02-15 21:35:17 +01:00
|
|
|
|
|
|
|
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
|
2007-02-26 06:26:54 +01:00
|
|
|
#define SERVER_CALL(func) SH_CALL(gamedllPatch, &IServerGameDLL::func)
|
2006-11-04 20:27:20 +01:00
|
|
|
|
|
|
|
PLUGIN_GLOBALVARS();
|
|
|
|
|
|
|
|
#endif //_INCLUDE_SOURCEMOD_MM_API_H_
|