Trigger build for hl2sdk-l4d changes.
1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2009 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
19 #include <interface.h>
21 #include <sourcehook/sourcehook_impl.h>
22 #include <sourcehook/sourcehook.h>
26 #include "loader_bridge.h"
30 * increase api_major when API breaks
31 * increase api_minor when new functions are added (non-breaking)
33 #define SOURCEMM_VERSION SVN_FILE_VERSION_STRING
34 #define SOURCEMM_DATE __DATE__
35 #define SM_VERS_API_MAJOR 1 //increase this on a breaking change
36 #define SM_VERS_API_MINOR 5 //increase this on a non-breaking API change
38 //We need a good CServerGameDLL version to work properly. We support these inclusively.
39 #define MIN_GAMEDLL_VERSION 3
40 #define MAX_GAMEDLL_VERSION 8
43 void *ServerFactory(const char *name, int *code);
44 void *EngineFactory(const char *name, int *code);
45 void *PhysicsFactory(const char *name, int *code);
46 void *FileSystemFactory(const char *name, int *code);
48 /** @brief Loads all plugins found from the mm_pluginsfile file and from VDFs in mm_basedir */
49 int LoadPlugins(const char *filepath, const char *vdfdir);
51 /** @brief Logs a message to the standard log file */
52 void LogMessage(const char *msg, ...);
54 /** @brief Stores information about the GameDLL */
58 CreateInterfaceFn factory;
59 IServerGameDLL *pGameDLL;
60 IServerGameClients *pGameClients;
63 /** @brief Stores information about the HL2 Engine pointers */
66 EngineInfo() : loaded(false), original(false),
67 engineFactory(NULL), physicsFactory(NULL), fileSystemFactory(NULL),
68 pGlobals(NULL), icvar(NULL), engine(NULL)
72 CreateInterfaceFn engineFactory;
73 CreateInterfaceFn physicsFactory;
74 CreateInterfaceFn fileSystemFactory;
75 CGlobalVars *pGlobals;
77 IVEngineServer *engine;
80 bool AlternatelyLoadMetamod(CreateInterfaceFn ifaceFactory, CreateInterfaceFn serverFactory);
82 extern IServerPluginCallbacks *g_pRealVspCallbacks;
83 extern bool g_bIsBridgedAsVsp;
85 /** @brief Global variable for GameDLL info */
86 extern GameDllInfo g_GameDll;
88 /** @brief Global variable for Engine info */
89 extern EngineInfo g_Engine;
91 /** @brief Global singleton for SourceHook */
92 extern SourceHook::CSourceHookImpl g_SourceHook;
94 /** @brief Mod path (important!)*/
95 extern SourceHook::String g_ModPath;
97 /** @brief Path to Metamod binary */
98 extern SourceHook::String g_MetamodPath;
100 /** @brief Global variable for SourceHook macros */
101 extern SourceHook::ISourceHook *g_SHPtr;
103 /** @brief We have our own internal plugin id... */
104 extern PluginId g_PLID;
106 /** @brief ServerGameDLL version that is currently loaded */
107 extern int g_GameDllVersion;
109 extern bool g_bGameInit;
110 extern bool g_bLevelChanged;
112 extern unsigned int g_vsp_version;
114 void UnloadMetamod(bool shutting_down);
116 void LoadAsGameDLL(const gamedll_bridge_info *info);
118 #endif //_INCLUDE_SOURCEMM_H