core/sourcemm_api.h
author David Anderson <dvander@alliedmods.net>
Wed May 02 22:35:51 2007 +0000 (2007-05-02)
changeset 727 fade10824d88
parent 675 40b8bc6ac247
child 1145 f12e19245c7a
permissions -rw-r--r--
attempted fix for amb243, timers now simulate ticks if gameframe doesn't give changed curtimes
     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 };
    53 
    54 extern SourceMod_Core g_SourceMod_Core;
    55 extern IVEngineServer *engine;
    56 extern IServerGameDLL *gamedll;
    57 extern IServerGameClients *serverClients;
    58 extern ICvar *icvar;
    59 extern ISmmPluginManager *g_pMMPlugins;
    60 extern CGlobalVars *gpGlobals;
    61 extern IGameEventManager2 *gameevents;
    62 extern SourceHook::CallClass<IVEngineServer> *enginePatch;
    63 extern SourceHook::CallClass<IServerGameDLL> *gamedllPatch;
    64 extern IUniformRandomStream *engrandom;
    65 extern IPlayerInfoManager *playerinfo;
    66 extern IBaseFileSystem *basefilesystem;
    67 extern IEngineSound *enginesound;
    68 extern IServerPluginHelpers *serverpluginhelpers;
    69 
    70 #define ENGINE_CALL(func)		SH_CALL(enginePatch, &IVEngineServer::func)
    71 #define SERVER_CALL(func)		SH_CALL(gamedllPatch, &IServerGameDLL::func)
    72 
    73 PLUGIN_GLOBALVARS();
    74 
    75 #endif //_INCLUDE_SOURCEMOD_MM_API_H_