1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2005 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>
31 * First grouping is major release version (1)
32 * Second grouping is minor release version.
33 * Third grouping is release change version.
34 * For an entire code rehaul, we would change major.
35 * For a simple bug-fix release, we would change the third grouping.
36 * For an API change, we would increase the second grouping by one.
37 * For a breaking API change, we would increase the second group up to the next bracket.
38 * (example: 1.45 -> 1.50. 1.12 -> 1.20. 1.19 -> 1.20)
39 * minor changes can also roll over, but a big change should ALWAYS roll over.
40 * Increasing one grouping should make the lesser ones reset back to zero.
42 #define SOURCEMM_VERSION "1.1.2"
43 #define SOURCEMM_DATE __DATE__
44 #define SM_MAJOR_VERSION 1 //never need to increase this
45 #define SM_VERS_API_MAJOR 1 //increase this on a breaking change
46 #define SM_VERS_API_MINOR 1 //increase this on a non-breaking API change
47 #define SM_VERS_RELEASE 0 //increase this on a bug-fix release.
49 //We need a good CServerGameDLL version to work properly. We support these inclusively.
50 #define MIN_GAMEDLL_VERSION 3
51 #define MAX_GAMEDLL_VERSION 4
54 * @brief Entry point for HL2 Engine
56 SMM_API void *CreateInterface(const char *name, int *code);
58 /** @brief Wrapper to catch GameDLL calls */
59 void *EngineFactory(const char *name, int *code);
61 /** @brief Wrapper to catch GameDLL calls */
62 void *PhysicsFactory(const char *name, int *code);
64 /** @brief Wrapper to catch GameDLL calls */
65 void *FileSystemFactory(const char *name, int *code);
67 /** @brief Loads all plugins found in a file */
68 int LoadPluginsFromFile(const char *file);
70 /** @brief Logs a message to the standard log file */
71 void LogMessage(const char *msg, ...);
73 /** @brief Stores information about the GameDLL */
78 CreateInterfaceFn factory;
79 IServerGameDLL *pGameDLL;
82 /** @brief Stores information about the HL2 Engine pointers */
85 EngineInfo() : loaded(false),
86 engineFactory(NULL), physicsFactory(NULL), fileSystemFactory(NULL),
87 pGlobals(NULL), icvar(NULL), engine(NULL)
90 CreateInterfaceFn engineFactory;
91 CreateInterfaceFn physicsFactory;
92 CreateInterfaceFn fileSystemFactory;
93 CGlobalVars *pGlobals;
95 IVEngineServer *engine;
98 /** @brief Global variable for GameDLL info */
99 extern GameDllInfo g_GameDll;
101 /** @brief Global variable for Engine info */
102 extern EngineInfo g_Engine;
104 /** @brief Global singleton for SourceHook */
105 extern SourceHook::CSourceHookImpl g_SourceHook;
107 /** @brief Mod path (important!)*/
108 extern SourceHook::String g_ModPath;
110 /** @brief Path to server binary */
111 extern SourceHook::String g_BinPath;
113 /** @brief Global variable for SourceHook macros */
114 extern SourceHook::ISourceHook *g_SHPtr;
116 /** @brief We have our own internal plugin id... */
117 extern PluginId g_PLID;
119 #endif //_INCLUDE_SOURCEMM_H