core/sourcemm_api.h
author Phong Dang <teame06@gmail.com>
Wed Aug 01 04:17:36 2007 +0000 (2007-08-01)
changeset 1235 88bb46f9731e
parent 1231 17badaf66ce4
child 1330 ab94316bb52b
permissions -rw-r--r--
Implemented requested amb603. Added voice natives.
dvander@370
     1
/**
ds@653
     2
 * vim: set ts=4 :
dvander@1231
     3
 * ================================================================
dvander@1231
     4
 * SourceMod
dvander@1231
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
dvander@1231
     6
 * ================================================================
dvander@370
     7
 *
dvander@1231
     8
 * This program is free software; you can redistribute it and/or 
dvander@1231
     9
 * modify it under the terms of the GNU General Public License, 
dvander@1231
    10
 * version 3.0, as published by the Free Software Foundation.
dvander@1231
    11
 * 
dvander@1231
    12
 * This program is distributed in the hope that it will be useful,
dvander@1231
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dvander@1231
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dvander@1231
    15
 * GNU General Public License for more details.
dvander@1231
    16
 *
dvander@1231
    17
 * You should have received a copy of the GNU General Public License
dvander@1231
    18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1231
    19
 *
dvander@1231
    20
 * As a special exception, AlliedModders LLC gives you permission to 
dvander@1231
    21
 * link the code of this program (as well as its derivative works) to 
dvander@1231
    22
 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any 
dvander@1231
    23
 * Game MODs that run on software by the Valve Corporation.  You must 
dvander@1231
    24
 * obey the GNU General Public License in all respects for all other 
dvander@1231
    25
 * code used. Additionally, AlliedModders LLC grants this exception 
dvander@1231
    26
 * to all derivative works. AlliedModders LLC defines further 
dvander@1231
    27
 * exceptions, found in LICENSE.txt (as of this writing, version 
dvander@1231
    28
 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
dvander@370
    29
 *
dvander@370
    30
 * Version: $Id$
dvander@370
    31
 */
dvander@370
    32
dvander@145
    33
#ifndef _INCLUDE_SOURCEMOD_MM_API_H_
dvander@145
    34
#define _INCLUDE_SOURCEMOD_MM_API_H_
dvander@145
    35
ds@457
    36
#include "convar_sm.h"
dvander@145
    37
#include <ISmmPlugin.h>
dvander@209
    38
#include <eiface.h>
dvander@453
    39
#include <igameevents.h>
dvander@644
    40
#include <iplayerinfo.h>
dvander@530
    41
#include <random.h>
faluco@654
    42
#include <filesystem.h>
faluco@656
    43
#include <IEngineSound.h>
dvander@145
    44
dvander@162
    45
/**
dvander@162
    46
 * @file Contains wrappers around required Metamod:Source API exports
dvander@162
    47
 */
dvander@162
    48
ds@675
    49
class SourceMod_Core : 
ds@675
    50
	public ISmmPlugin,
ds@675
    51
	public IMetamodListener
dvander@145
    52
{
dvander@145
    53
public:
dvander@145
    54
	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
dvander@145
    55
	bool Unload(char *error, size_t maxlen);
dvander@145
    56
	bool Pause(char *error, size_t maxlen);
dvander@145
    57
	bool Unpause(char *error, size_t maxlen);
dvander@145
    58
	void AllPluginsLoaded();
dvander@145
    59
public:
dvander@145
    60
	const char *GetAuthor();
dvander@145
    61
	const char *GetName();
dvander@145
    62
	const char *GetDescription();
dvander@145
    63
	const char *GetURL();
dvander@145
    64
	const char *GetLicense();
dvander@145
    65
	const char *GetVersion();
dvander@145
    66
	const char *GetDate();
dvander@145
    67
	const char *GetLogTag();
ds@675
    68
public:
ds@675
    69
	void OnVSPListening(IServerPluginCallbacks *iface);
ds@1145
    70
#if PLAPI_VERSION >= 12
ds@1145
    71
	void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
ds@1145
    72
#else
ds@1145
    73
	void OnPluginUnload(PluginId id);
ds@1145
    74
#endif
dvander@145
    75
};
dvander@145
    76
dvander@160
    77
extern SourceMod_Core g_SourceMod_Core;
dvander@209
    78
extern IVEngineServer *engine;
dvander@209
    79
extern IServerGameDLL *gamedll;
faluco@226
    80
extern IServerGameClients *serverClients;
ds@457
    81
extern ICvar *icvar;
dvander@304
    82
extern ISmmPluginManager *g_pMMPlugins;
dvander@448
    83
extern CGlobalVars *gpGlobals;
dvander@453
    84
extern IGameEventManager2 *gameevents;
dvander@496
    85
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
dvander@532
    86
extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
dvander@530
    87
extern IUniformRandomStream *engrandom;
dvander@644
    88
extern IPlayerInfoManager *playerinfo;
faluco@654
    89
extern IBaseFileSystem *basefilesystem;
faluco@656
    90
extern IEngineSound *enginesound;
faluco@659
    91
extern IServerPluginHelpers *serverpluginhelpers;
dvander@496
    92
dvander@496
    93
#define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
dvander@532
    94
#define SERVER_CALL(func)		SH_CALL(gamedllPatch, &IServerGameDLL::func)
dvander@145
    95
dvander@145
    96
PLUGIN_GLOBALVARS();
dvander@145
    97
dvander@145
    98
#endif //_INCLUDE_SOURCEMOD_MM_API_H_