Added ISmmAPI::GetVSPVersion() to get highest supported IServerPluginCallbacks interface version
1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2007 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): David "BAILOPAN" Anderson
8 * ============================
11 #ifndef _INCLUDE_SOURCEMM_H
12 #define _INCLUDE_SOURCEMM_H
15 * @brief SourceMM main functionality for GameDLL interception
20 #include <interface.h>
22 #include <sourcehook/sourcehook_impl.h>
23 #include <sourcehook/sourcehook.h>
28 #include "svn_version.h"
32 * increase api_major when API breaks
33 * increase api_minor when new functions are added (non-breaking)
35 #define SOURCEMM_VERSION SVN_FILE_VERSION_STRING
36 #define SOURCEMM_DATE __DATE__
37 #define SM_VERS_API_MAJOR 1 //increase this on a breaking change
38 #define SM_VERS_API_MINOR 6 //increase this on a non-breaking API change
40 /* We need a good CServerGameDLL version to work properly. We support these inclusively. */
41 #define MIN_GAMEDLL_VERSION 3
42 #define MAX_GAMEDLL_VERSION 8
44 /* Maximum version of IServerPluginCallbacks that SourceMM supports */
45 #define MAX_VSP_VERSION 2
48 * @brief Entry point for HL2 Engine
50 SMM_API void *CreateInterface(const char *name, int *code);
52 /** @brief Wrapper to catch GameDLL calls */
53 void *EngineFactory(const char *name, int *code);
55 /** @brief Wrapper to catch GameDLL calls */
56 void *PhysicsFactory(const char *name, int *code);
58 /** @brief Wrapper to catch GameDLL calls */
59 void *FileSystemFactory(const char *name, int *code);
61 /** @brief Loads all plugins found in a file */
62 int LoadPluginsFromFile(const char *file);
64 /** @brief Logs a message to the standard log file */
65 void LogMessage(const char *msg, ...);
67 /** @brief Stores information about the GameDLL */
72 CreateInterfaceFn factory;
73 IServerGameDLL *pGameDLL;
74 IServerGameClients *pGameClients;
77 /** @brief Stores information about the HL2 Engine pointers */
80 EngineInfo() : loaded(false),
81 engineFactory(NULL), physicsFactory(NULL), fileSystemFactory(NULL),
82 pGlobals(NULL), icvar(NULL), engine(NULL)
85 CreateInterfaceFn engineFactory;
86 CreateInterfaceFn physicsFactory;
87 CreateInterfaceFn fileSystemFactory;
88 CGlobalVars *pGlobals;
90 IVEngineServer *engine;
93 /** @brief Global variable for GameDLL info */
94 extern GameDllInfo g_GameDll;
96 /** @brief Global variable for Engine info */
97 extern EngineInfo g_Engine;
99 /** @brief Global singleton for SourceHook */
100 extern SourceHook::CSourceHookImpl g_SourceHook;
102 /** @brief Mod path (important!)*/
103 extern SourceHook::String g_ModPath;
105 /** @brief Path to server binary */
106 extern SourceHook::String g_BinPath;
108 /** @brief Path to SourceMM binary */
109 extern SourceHook::String g_SmmPath;
111 /** @brief Global variable for SourceHook macros */
112 extern SourceHook::ISourceHook *g_SHPtr;
114 /** @brief We have our own internal plugin id... */
115 extern PluginId g_PLID;
117 /** @brief ServerGameDLL version that is currently loaded */
118 extern int g_GameDllVersion;
120 /** @brief Highest IServerPluginCallbacks version that is supported by engine */
121 extern int g_VspVersion;
123 extern bool bGameInit;
125 /** @brief Global CallClass for IServerGameDLL */
126 extern SourceHook::CallClass<IServerGameDLL> *g_GameDllPatch;
128 #endif //_INCLUDE_SOURCEMM_H