00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef _INCLUDE_ISMM_API_H
00029 #define _INCLUDE_ISMM_API_H
00030 
00036 #include <stdarg.h>
00037 #include <interface.h>
00038 #include <eiface.h>
00039 #include <sourcehook.h>
00040 #include <IPluginManager.h>
00041 #include <ISmmPlugin.h>
00042 #include <ISmmPluginExt.h>
00043 
00044 #if defined __GNUC__
00045 #if ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4)) || (__GNUC__ < 3)
00046 #error "You must compile with at least GCC 3.4! If you know what you are doing, you can remove this message."
00047 #endif //version check
00048 #endif //__GNUC__
00049 
00050 #define MMIFACE_SOURCEHOOK              "ISourceHook"                   
00051 #define MMIFACE_PLMANAGER               "IPluginManager"                
00052 #define MMIFACE_SH_HOOKMANAUTOGEN       "IHookManagerAutoGen"           
00053 #define IFACE_MAXNUM                    999                                             
00055 namespace SourceMM
00056 {
00057         class ISmmPlugin;
00058         class IMetamodListener;
00059 
00063         class ISmmAPI
00064         {
00065         public:
00073                 virtual void LogMsg(ISmmPlugin *pl, const char *msg, ...) =0;
00074         
00082                 virtual CreateInterfaceFn GetEngineFactory(bool syn=true) =0;
00083 
00091                 virtual CreateInterfaceFn GetPhysicsFactory(bool syn=true) =0;
00092 
00100                 virtual CreateInterfaceFn GetFileSystemFactory(bool syn=true) =0;
00101 
00108                 virtual CreateInterfaceFn GetServerFactory(bool syn=true) =0;
00109 
00115                 virtual CGlobalVars *GetCGlobals() =0;
00116 
00124                 virtual bool RegisterConCommandBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
00125 
00132                 virtual void UnregisterConCommandBase(ISmmPlugin *plugin, ConCommandBase *pCommand) =0;
00133         
00141                 virtual void ConPrint(const char *str) =0;
00142 
00150                 virtual void ConPrintf(const char *fmt, ...) =0;
00151 
00163                 virtual void GetApiVersions(int &major, int &minor, int &plvers, int &plmin) =0;
00164         
00171                 virtual void GetShVersions(int &shvers, int &shimpl) =0;
00172         
00179                 virtual void AddListener(ISmmPlugin *plugin, IMetamodListener *pListener) =0;
00180 
00190                 virtual void *MetaFactory(const char *iface, int *ret, PluginId *id) =0;
00191 
00204                 virtual int FormatIface(char iface[], unsigned int maxlength) =0;
00205 
00216                 virtual void *InterfaceSearch(CreateInterfaceFn fn, 
00217                                                                           const char *iface, 
00218                                                                           int max, 
00219                                                                           int *ret) =0;
00220 
00227                 virtual const char *GetBaseDir() =0;
00228 
00243                 virtual size_t PathFormat(char *buffer, size_t len, const char *fmt, ...) =0;
00244 
00253                 virtual void ClientConPrintf(edict_t *client, const char *fmt, ...) =0;
00254 
00272                 virtual void *VInterfaceMatch(CreateInterfaceFn fn, 
00273                                                                           const char *iface, 
00274                                                                           int min=-1) =0;
00275 
00287                 virtual void EnableVSPListener() =0;
00288 
00295                 virtual int GetGameDLLVersion() =0;
00296 
00303                 virtual int GetUserMessageCount() =0;
00304 
00312                 virtual int FindUserMessage(const char *name, int *size=NULL) =0;
00313 
00321                 virtual const char *GetUserMessage(int index, int *size=NULL) =0;
00322 
00333                 virtual int GetVSPVersion() =0;
00334 
00343                 virtual int GetSourceEngineBuild() =0;
00344 
00356                 virtual IServerPluginCallbacks *GetVSPInfo(int *pVersion) =0;
00357 
00369         virtual size_t Format(char *buffer, 
00370                                                   size_t maxlength,
00371                                                   const char *format,
00372                                                   ...) =0;
00373 
00385                 virtual size_t FormatArgs(char *buffer,
00386                                                                   size_t maxlength,
00387                                                                   const char *format,
00388                                                                   va_list ap) =0;
00389         };
00390 }
00391 
00392 #if !defined METAMOD_NO_AUTO_NAMESPACE
00393 using namespace SourceMM;
00394 #endif
00395 
00409 #endif //_INCLUDE_ISMM_API_H
00410