core/sourcemm_api.h
author David Anderson <dvander@alliedmods.net>
Mon Feb 26 05:26:54 2007 +0000 (2007-02-26)
changeset 532 fe6bb91d79b1
parent 530 ab92d2d7bdb8
child 577 39a746736a0f
permissions -rw-r--r--
added a crapload of random natives
     1 /**
     2  * ===============================================================
     3  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     4  * ===============================================================
     5  *
     6  * This file is not open source and may not be copied without explicit
     7  * written permission of AlliedModders LLC.  This file may not be redistributed 
     8  * in whole or significant part.
     9  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    10  *
    11  * Version: $Id$
    12  */
    13 
    14 #ifndef _INCLUDE_SOURCEMOD_MM_API_H_
    15 #define _INCLUDE_SOURCEMOD_MM_API_H_
    16 
    17 #include "convar_sm.h"
    18 #include <ISmmPlugin.h>
    19 #include <eiface.h>
    20 #include <icvar.h>
    21 #include <igameevents.h>
    22 #include <random.h>
    23 
    24 /**
    25  * @file Contains wrappers around required Metamod:Source API exports
    26  */
    27 
    28 class SourceMod_Core : public ISmmPlugin
    29 {
    30 public:
    31 	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    32 	bool Unload(char *error, size_t maxlen);
    33 	bool Pause(char *error, size_t maxlen);
    34 	bool Unpause(char *error, size_t maxlen);
    35 	void AllPluginsLoaded();
    36 public:
    37 	const char *GetAuthor();
    38 	const char *GetName();
    39 	const char *GetDescription();
    40 	const char *GetURL();
    41 	const char *GetLicense();
    42 	const char *GetVersion();
    43 	const char *GetDate();
    44 	const char *GetLogTag();
    45 };
    46 
    47 extern SourceMod_Core g_SourceMod_Core;
    48 extern IVEngineServer *engine;
    49 extern IServerGameDLL *gamedll;
    50 extern IServerGameClients *serverClients;
    51 extern ICvar *icvar;
    52 extern ISmmPluginManager *g_pMMPlugins;
    53 extern CGlobalVars *gpGlobals;
    54 extern IGameEventManager2 *gameevents;
    55 extern SourceHook::CallClass<IVEngineServer> *enginePatch;
    56 extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
    57 extern IUniformRandomStream *engrandom;
    58 
    59 #define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
    60 #define SERVER_CALL(func)		SH_CALL(gamedllPatch, &IServerGameDLL::func)
    61 
    62 PLUGIN_GLOBALVARS();
    63 
    64 #endif //_INCLUDE_SOURCEMOD_MM_API_H_