2005-04-17 01:35:37 +02:00
|
|
|
/* ======== SourceMM ========
|
|
|
|
* Copyright (C) 2004-2005 Metamod:Source Development Team
|
|
|
|
* No warranties of any kind
|
|
|
|
*
|
|
|
|
* License: zlib/libpng
|
|
|
|
*
|
|
|
|
* Author(s): David "BAILOPAN" Anderson
|
|
|
|
* ============================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_CSMM_API_H
|
|
|
|
#define _INCLUDE_CSMM_API_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Header for CSmmAPI implementation
|
|
|
|
* @file CSmmAPI.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ISmmAPI.h"
|
|
|
|
|
2005-06-25 00:26:19 +02:00
|
|
|
typedef void (*CONPRINTF_FUNC)(const char *, ...);
|
|
|
|
|
2005-04-19 07:36:59 +02:00
|
|
|
namespace SourceMM
|
2005-04-17 01:35:37 +02:00
|
|
|
{
|
2005-04-19 07:36:59 +02:00
|
|
|
class CSmmAPI : public ISmmAPI
|
|
|
|
{
|
2005-06-25 00:26:19 +02:00
|
|
|
public:
|
|
|
|
CSmmAPI::CSmmAPI();
|
2005-04-19 07:36:59 +02:00
|
|
|
public:
|
|
|
|
void LogMsg(ISmmPlugin *pl, const char *msg, ...);
|
|
|
|
public:
|
|
|
|
CreateInterfaceFn engineFactory(bool syn=true);
|
|
|
|
CreateInterfaceFn physicsFactory(bool syn=true);
|
|
|
|
CreateInterfaceFn fileSystemFactory(bool syn=true);
|
|
|
|
CreateInterfaceFn serverFactory(bool syn=true);
|
|
|
|
CGlobalVars *pGlobals();
|
|
|
|
void SetLastMetaReturn(META_RES res);
|
|
|
|
META_RES GetLastMetaReturn();
|
2005-05-16 22:15:57 +02:00
|
|
|
IConCommandBaseAccessor *GetCvarBaseAccessor();
|
2005-05-26 10:06:23 +02:00
|
|
|
bool RegisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand);
|
|
|
|
void UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand);
|
2005-06-25 00:26:19 +02:00
|
|
|
void ConPrint(const char *fmt);
|
|
|
|
void ConPrintf(const char *fmt, ...);
|
|
|
|
bool CacheSuccessful();
|
2005-10-06 23:59:10 +02:00
|
|
|
bool RemotePrintingAvailable()
|
|
|
|
{
|
|
|
|
return CacheSuccessful();
|
|
|
|
}
|
|
|
|
virtual void GetApiVersions(int &major, int &minor, int &plvers, int &plmin);
|
|
|
|
virtual void GetShVersions(int &shvers, int &shimpl);
|
2005-10-20 16:37:47 +02:00
|
|
|
virtual void AddListener(ISmmPlugin *plugin, IMetamodListener *pListener);
|
2005-10-20 16:52:49 +02:00
|
|
|
virtual void *MetaFactory(const char *iface, int *ret, PluginId *id);
|
2005-12-06 08:59:18 +01:00
|
|
|
virtual int FormatIface(char buffer[], unsigned int maxlength);
|
2005-06-25 00:26:19 +02:00
|
|
|
public:
|
|
|
|
bool CacheCmds();
|
2005-04-19 07:36:59 +02:00
|
|
|
private:
|
|
|
|
META_RES m_Res;
|
2005-06-25 00:26:19 +02:00
|
|
|
CONPRINTF_FUNC m_ConPrintf;
|
|
|
|
bool m_Cache;
|
2005-04-19 07:36:59 +02:00
|
|
|
};
|
2005-04-17 01:35:37 +02:00
|
|
|
};
|
|
|
|
|
2005-04-19 07:36:59 +02:00
|
|
|
extern SourceMM::CSmmAPI g_SmmAPI;
|
2005-04-17 01:35:37 +02:00
|
|
|
|
2005-06-25 00:26:19 +02:00
|
|
|
#define CONMSG g_SmmAPI.ConPrintf
|
|
|
|
|
2005-04-17 01:35:37 +02:00
|
|
|
#endif //_INCLUDE_CSMM_API_H
|