sourcemm/CSmmAPI.h
author David Anderson <dvander@alliedmods.net>
Tue Sep 13 18:20:53 2005 +0000 (2005-09-13)
changeset 104 a3f2126f71a8
parent 76 39266faeec97
child 124 b04971393ee4
permissions -rw-r--r--
Bumped version to 1.1
     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_CSMM_API_H
    12 #define _INCLUDE_CSMM_API_H
    13 
    14 /**
    15  * @brief Header for CSmmAPI implementation
    16  * @file CSmmAPI.h
    17  */
    18 
    19 #include "ISmmAPI.h"
    20 
    21 typedef void (*CONPRINTF_FUNC)(const char *, ...);
    22 
    23 namespace SourceMM
    24 {
    25 	class CSmmAPI : public ISmmAPI
    26 	{
    27 	public:
    28 		CSmmAPI::CSmmAPI();
    29 	public:
    30 		ISmmPluginManager *PluginManager();
    31 		SourceHook::ISourceHook *SourceHook();
    32 		void LogMsg(ISmmPlugin *pl, const char *msg, ...);
    33 	public:
    34 		CreateInterfaceFn engineFactory(bool syn=true);
    35 		CreateInterfaceFn physicsFactory(bool syn=true);
    36 		CreateInterfaceFn fileSystemFactory(bool syn=true);
    37 		CreateInterfaceFn serverFactory(bool syn=true);
    38 		CGlobalVars *pGlobals();
    39 		void SetLastMetaReturn(META_RES res);
    40 		META_RES GetLastMetaReturn();
    41 		IConCommandBaseAccessor *GetCvarBaseAccessor();
    42 		bool RegisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand);
    43 		void UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand);
    44 		void ConPrint(const char *fmt);
    45 		void ConPrintf(const char *fmt, ...);
    46 		bool CacheSuccessful();
    47 	public:
    48 		bool CacheCmds();
    49 	private:
    50 		META_RES m_Res;
    51 		CONPRINTF_FUNC m_ConPrintf;
    52 		bool m_Cache;
    53 	};
    54 };
    55 
    56 extern SourceMM::CSmmAPI g_SmmAPI;
    57 
    58 #define	CONMSG	g_SmmAPI.ConPrintf
    59 
    60 #endif //_INCLUDE_CSMM_API_H