core/sourcemm_api.h
author Phong Dang <teame06@gmail.com>
Sun Jul 29 19:20:42 2007 +0000 (2007-07-29)
changeset 1211 990912ee1e1e
parent 1145 f12e19245c7a
child 1231 17badaf66ce4
permissions -rw-r--r--
Added amb<536> requested for using sm_kick without putting quotes around reason.
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     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
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_MM_API_H_
    16 #define _INCLUDE_SOURCEMOD_MM_API_H_
    17 
    18 #include "convar_sm.h"
    19 #include <ISmmPlugin.h>
    20 #include <eiface.h>
    21 #include <igameevents.h>
    22 #include <iplayerinfo.h>
    23 #include <random.h>
    24 #include <filesystem.h>
    25 #include <IEngineSound.h>
    26 
    27 /**
    28  * @file Contains wrappers around required Metamod:Source API exports
    29  */
    30 
    31 class SourceMod_Core : 
    32 	public ISmmPlugin,
    33 	public IMetamodListener
    34 {
    35 public:
    36 	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    37 	bool Unload(char *error, size_t maxlen);
    38 	bool Pause(char *error, size_t maxlen);
    39 	bool Unpause(char *error, size_t maxlen);
    40 	void AllPluginsLoaded();
    41 public:
    42 	const char *GetAuthor();
    43 	const char *GetName();
    44 	const char *GetDescription();
    45 	const char *GetURL();
    46 	const char *GetLicense();
    47 	const char *GetVersion();
    48 	const char *GetDate();
    49 	const char *GetLogTag();
    50 public:
    51 	void OnVSPListening(IServerPluginCallbacks *iface);
    52 #if PLAPI_VERSION >= 12
    53 	void OnUnlinkConCommandBase(PluginId id, ConCommandBase *pCommand);
    54 #else
    55 	void OnPluginUnload(PluginId id);
    56 #endif
    57 };
    58 
    59 extern SourceMod_Core g_SourceMod_Core;
    60 extern IVEngineServer *engine;
    61 extern IServerGameDLL *gamedll;
    62 extern IServerGameClients *serverClients;
    63 extern ICvar *icvar;
    64 extern ISmmPluginManager *g_pMMPlugins;
    65 extern CGlobalVars *gpGlobals;
    66 extern IGameEventManager2 *gameevents;
    67 extern SourceHook::CallClass<IVEngineServer> *enginePatch;
    68 extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
    69 extern IUniformRandomStream *engrandom;
    70 extern IPlayerInfoManager *playerinfo;
    71 extern IBaseFileSystem *basefilesystem;
    72 extern IEngineSound *enginesound;
    73 extern IServerPluginHelpers *serverpluginhelpers;
    74 
    75 #define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
    76 #define SERVER_CALL(func)		SH_CALL(gamedllPatch, &IServerGameDLL::func)
    77 
    78 PLUGIN_GLOBALVARS();
    79 
    80 #endif //_INCLUDE_SOURCEMOD_MM_API_H_