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>
29 #define SOURCEMM_VERSION "1.10"
30 #define SOURCEMM_DATE __DATE__
32 #define MIN_GAMEDLL_VERSION 3
33 #define MAX_GAMEDLL_VERSION 4
36 * @brief Entry point for HL2 Engine
38 SMM_API void *CreateInterface(const char *name, int *code);
40 /** @brief Wrapper to catch GameDLL calls */
41 void *EngineFactory(const char *name, int *code);
43 /** @brief Wrapper to catch GameDLL calls */
44 void *PhysicsFactory(const char *name, int *code);
46 /** @brief Wrapper to catch GameDLL calls */
47 void *FileSystemFactory(const char *name, int *code);
49 /** @brief Loads all plugins found in a file */
50 int LoadPluginsFromFile(const char *file);
52 /** @brief Logs a message to the standard log file */
53 void LogMessage(const char *msg, ...);
55 /** @brief Stores information about the GameDLL */
60 CreateInterfaceFn factory;
61 IServerGameDLL *pGameDLL;
64 /** @brief Stores information about the HL2 Engine pointers */
67 EngineInfo() : loaded(false),
68 engineFactory(NULL), physicsFactory(NULL), fileSystemFactory(NULL),
69 pGlobals(NULL), icvar(NULL), engine(NULL)
72 CreateInterfaceFn engineFactory;
73 CreateInterfaceFn physicsFactory;
74 CreateInterfaceFn fileSystemFactory;
75 CGlobalVars *pGlobals;
77 IVEngineServer *engine;
80 /** @brief Global variable for GameDLL info */
81 extern GameDllInfo g_GameDll;
83 /** @brief Global variable for Engine info */
84 extern EngineInfo g_Engine;
86 /** @brief Global singleton for SourceHook */
87 extern SourceHook::CSourceHookImpl g_SourceHook;
89 /** @brief Mod path (important!)*/
90 extern SourceHook::String g_ModPath;
92 /** @brief Path to server binary */
93 extern SourceHook::String g_BinPath;
95 /** @brief Global variable for SourceHook macros */
96 extern SourceHook::ISourceHook *g_SHPtr;
98 /** @brief We have our own internal plugin id... */
99 extern PluginId g_PLID;
101 #endif //_INCLUDE_SOURCEMM_H