00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _INCLUDE_ISMM_API_H
00012 #define _INCLUDE_ISMM_API_H
00013
00019 #include <interface.h>
00020 #include <eiface.h>
00021 #include <sourcehook/sourcehook.h>
00022 #include "IPluginManager.h"
00023
00024 #if defined __GNUC__
00025 #if ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4)) || (__GNUC__ < 3)
00026 #error "You must compile with at least GCC 3.4! If you know what you are doing, you can remove this message."
00027 #endif //version check
00028 #endif //__GNUC__
00029
00030 class IMetamodListener;
00031 class ISmmPluginManager;
00032 class ISmmPlugin;
00033
00034 #define MMIFACE_SOURCEHOOK "ISourceHook"
00035 #define MMIFACE_PLMANAGER "IPluginManager"
00036 #define IFACE_MAXNUM 999
00037
00038 class ISmmAPI
00039 {
00040 public:
00048 virtual void LogMsg(ISmmPlugin *pl, const char *msg, ...) =0;
00049 public:
00057 virtual CreateInterfaceFn engineFactory(bool syn=true) =0;
00058
00066 virtual CreateInterfaceFn physicsFactory(bool syn=true) =0;
00067
00075 virtual CreateInterfaceFn fileSystemFactory(bool syn=true) =0;
00076
00084 virtual CreateInterfaceFn serverFactory(bool syn=true) =0;
00085
00091 virtual CGlobalVars *pGlobals() =0;
00092
00099 virtual void SetLastMetaReturn(META_RES res) =0;
00100
00107 virtual META_RES GetLastMetaReturn() =0;
00108
00109 public:
00115 virtual IConCommandBaseAccessor *GetCvarBaseAccessor() =0;
00116
00124 virtual bool RegisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
00125
00132 virtual void UnregisterConCmdBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
00133
00140 virtual void ConPrint(const char *str) =0;
00141
00148 virtual void ConPrintf(const char *fmt, ...) =0;
00149
00150 public:
00156 virtual bool RemotePrintingAvailable() =0;
00157
00168 virtual void GetApiVersions(int &major, int &minor, int &plvers, int &plmin) =0;
00169
00176 virtual void GetShVersions(int &shvers, int &shimpl) =0;
00177
00184 virtual void AddListener(ISmmPlugin *plugin, IMetamodListener *pListener) =0;
00185
00194 virtual void *MetaFactory(const char *iface, int *ret, PluginId *id) =0;
00195
00196 public:
00206 virtual int FormatIface(char iface[], unsigned int maxlength) =0;
00207
00208 public:
00218 virtual void *InterfaceSearch(CreateInterfaceFn fn, const char *iface, int max, int *ret) =0;
00219
00226 virtual const char *GetBaseDir() =0;
00227
00236 virtual void PathFormat(char *buffer, size_t len, const char *fmt, ...) =0;
00237
00238 public:
00246 virtual void ClientConPrintf(edict_t *client, const char *fmt, ...) =0;
00247
00248 public:
00263 virtual void *VInterfaceMatch(CreateInterfaceFn fn, const char *iface, int min=-1) =0;
00264
00265 public:
00273 virtual void EnableVSPListener() =0;
00274
00280 virtual int GetGameDLLVersion() =0;
00281
00287 virtual int GetUserMessageCount() =0;
00288
00296 virtual int FindUserMessage(const char *name, int *size=NULL) =0;
00297
00305 virtual const char *GetUserMessage(int index, int *size=NULL) =0;
00306 };
00307
00308
00320 #endif //_INCLUDE_ISMM_API_H