core/sourcemm_api.h
author Borja Ferrer <faluco@alliedmods.net>
Sun Mar 25 20:20:43 2007 +0000 (2007-03-25)
changeset 654 e00dd6df311e
parent 653 ef60870067ff
child 656 351fca8ce6a5
permissions -rw-r--r--
initial implementation of KV natives
     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 
    26 /**
    27  * @file Contains wrappers around required Metamod:Source API exports
    28  */
    29 
    30 class SourceMod_Core : public ISmmPlugin
    31 {
    32 public:
    33 	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    34 	bool Unload(char *error, size_t maxlen);
    35 	bool Pause(char *error, size_t maxlen);
    36 	bool Unpause(char *error, size_t maxlen);
    37 	void AllPluginsLoaded();
    38 public:
    39 	const char *GetAuthor();
    40 	const char *GetName();
    41 	const char *GetDescription();
    42 	const char *GetURL();
    43 	const char *GetLicense();
    44 	const char *GetVersion();
    45 	const char *GetDate();
    46 	const char *GetLogTag();
    47 };
    48 
    49 extern SourceMod_Core g_SourceMod_Core;
    50 extern IVEngineServer *engine;
    51 extern IServerGameDLL *gamedll;
    52 extern IServerGameClients *serverClients;
    53 extern ICvar *icvar;
    54 extern ISmmPluginManager *g_pMMPlugins;
    55 extern CGlobalVars *gpGlobals;
    56 extern IGameEventManager2 *gameevents;
    57 extern SourceHook::CallClass<IVEngineServer> *enginePatch;
    58 extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
    59 extern IUniformRandomStream *engrandom;
    60 extern IPlayerInfoManager *playerinfo;
    61 extern IBaseFileSystem *basefilesystem;
    62 
    63 #define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
    64 #define SERVER_CALL(func)		SH_CALL(gamedllPatch, &IServerGameDLL::func)
    65 
    66 PLUGIN_GLOBALVARS();
    67 
    68 #endif //_INCLUDE_SOURCEMOD_MM_API_H_