1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2006 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 * ?what the hell was I smoking when I wrote this
32 * increase api_major when API breaks
33 * increase api_minor when new functions are added (non-breaking)
34 * increase vers_release when bug fix releases are made
35 * never increase major
37 #define SOURCEMM_VERSION "1.2.1"
38 #define SOURCEMM_DATE __DATE__
39 #define SM_MAJOR_VERSION 1 //never need to increase this
40 #define SM_VERS_API_MAJOR 1 //increase this on a breaking change
41 #define SM_VERS_API_MINOR 2 //increase this on a non-breaking API change
42 #define SM_VERS_RELEASE 1 //increase this on a bug-fix release.
44 //We need a good CServerGameDLL version to work properly. We support these inclusively.
45 #define MIN_GAMEDLL_VERSION 3
46 #define MAX_GAMEDLL_VERSION 4
49 * @brief Entry point for HL2 Engine
51 SMM_API void *CreateInterface(const char *name, int *code);
53 /** @brief Wrapper to catch GameDLL calls */
54 void *EngineFactory(const char *name, int *code);
56 /** @brief Wrapper to catch GameDLL calls */
57 void *PhysicsFactory(const char *name, int *code);
59 /** @brief Wrapper to catch GameDLL calls */
60 void *FileSystemFactory(const char *name, int *code);
62 /** @brief Loads all plugins found in a file */
63 int LoadPluginsFromFile(const char *file);
65 /** @brief Logs a message to the standard log file */
66 void LogMessage(const char *msg, ...);
68 /** @brief Stores information about the GameDLL */
73 CreateInterfaceFn factory;
74 IServerGameDLL *pGameDLL;
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 Global variable for SourceHook macros */
109 extern SourceHook::ISourceHook *g_SHPtr;
111 /** @brief We have our own internal plugin id... */
112 extern PluginId g_PLID;
114 #endif //_INCLUDE_SOURCEMM_H