sourcemm/ISmmAPI.h
author Pavol Marko <pavolmarko@gmail.com>
Fri Oct 14 21:09:12 2005 +0000 (2005-10-14)
changeset 136 0df65778613e
parent 124 b04971393ee4
child 138 dfa3b31cc042
permissions -rw-r--r--
:D
     1 /* ======== SourceMM ========
     2 * Copyright (C) 2004-2005 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): David "BAILOPAN" Anderson
     8 * ============================
     9 */
    10 
    11 #ifndef _INCLUDE_ISMM_API_H
    12 #define _INCLUDE_ISMM_API_H
    13 
    14 /**
    15  * @brief External API interface
    16  * @file ISmmAPI.h
    17  */
    18 
    19 #include <interface.h>
    20 #include <eiface.h>
    21 #include <convar.h>
    22 #include <sourcehook/sourcehook.h>
    23 #include "IPluginManager.h"
    24 
    25 #if defined __GNUC__
    26 #if ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4)) || (__GNUC__ < 3)
    27 #error "You must compile with at least GCC 3.4! If you know what you are doing, you can remove this message."
    28 #endif //version check
    29 #endif //__GNUC__
    30 
    31 class ISmmPluginManager;
    32 class ISmmPlugin;
    33 
    34 class ISmmAPI
    35 {
    36 public:
    37 	virtual ISmmPluginManager *PluginManager() =0;
    38 	virtual SourceHook::ISourceHook *SourceHook() =0;
    39 	virtual void LogMsg(ISmmPlugin *pl, const char *msg, ...) =0;
    40 public:
    41 	virtual CreateInterfaceFn engineFactory(bool syn=true) =0;
    42 	virtual CreateInterfaceFn physicsFactory(bool syn=true) =0;
    43 	virtual CreateInterfaceFn fileSystemFactory(bool syn=true) =0;
    44 	virtual CreateInterfaceFn serverFactory(bool syn=true) =0;
    45 	virtual CGlobalVars *pGlobals() =0;
    46 	virtual void SetLastMetaReturn(META_RES res) =0;
    47 	virtual META_RES GetLastMetaReturn() =0;
    48 public:		//Added in 1.00-RC2 (0:0)
    49 	//solves concommand problems by keeping track for loading/unloading
    50 	virtual IConCommandBaseAccessor *GetCvarBaseAccessor() =0;
    51 	virtual bool RegisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
    52 	virtual void UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
    53 	//attempt fix at valve not exporting rcon printing
    54 	//these do not add newlines
    55 	virtual void ConPrint(const char *fmt) =0;
    56 	virtual void ConPrintf(const char *fmt, ...) =0;
    57 public:		//Added in 1.10 (1:0)
    58 	//added by request.  Checks if ConPrint/ConPrintf will mirror to rcon.
    59 	virtual bool RemotePrintingAvailable() =0;
    60 	//Returns the Metamod Version numbers as major version and minor (API) version.
    61 	//changes to minor version are guaranteed to be backwards compatible.
    62 	//changes to major version are not.
    63 	//Also returns current plugin version and minimum plugin version
    64 	virtual void GetApiVersions(int &major, int &minor, int &plvers, int &plmin) =0;
    65 	//Returns sourcehook API version and implementation version
    66 	virtual void GetShVersions(int &shvers, int &shimpl) =0;
    67 };
    68 
    69 /** Version history
    70  * 1.10 bumped API to 1:0.  The breaking changes occured in sourcehook and the plugin API.
    71  */
    72 
    73 #endif //_INCLUDE_ISMM_API_H