core/sourcemm_api.h
author David Anderson <dvander@alliedmods.net>
Fri Feb 16 04:16:31 2007 +0000 (2007-02-16)
changeset 502 4530ea065a8b
parent 496 a16c05dcf584
child 530 ab92d2d7bdb8
permissions -rw-r--r--
fixed a serious potential bug with swapping plugins to debug mode, leaving stale function pointers without plugin removal
     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 
    23 /**
    24  * @file Contains wrappers around required Metamod:Source API exports
    25  */
    26 
    27 class SourceMod_Core : public ISmmPlugin
    28 {
    29 public:
    30 	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    31 	bool Unload(char *error, size_t maxlen);
    32 	bool Pause(char *error, size_t maxlen);
    33 	bool Unpause(char *error, size_t maxlen);
    34 	void AllPluginsLoaded();
    35 public:
    36 	const char *GetAuthor();
    37 	const char *GetName();
    38 	const char *GetDescription();
    39 	const char *GetURL();
    40 	const char *GetLicense();
    41 	const char *GetVersion();
    42 	const char *GetDate();
    43 	const char *GetLogTag();
    44 };
    45 
    46 extern SourceMod_Core g_SourceMod_Core;
    47 extern IVEngineServer *engine;
    48 extern IServerGameDLL *gamedll;
    49 extern IServerGameClients *serverClients;
    50 extern ICvar *icvar;
    51 extern ISmmPluginManager *g_pMMPlugins;
    52 extern CGlobalVars *gpGlobals;
    53 extern IGameEventManager2 *gameevents;
    54 extern SourceHook::CallClass<IVEngineServer> *enginePatch;
    55 
    56 #define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
    57 
    58 PLUGIN_GLOBALVARS();
    59 
    60 #endif //_INCLUDE_SOURCEMOD_MM_API_H_