mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2024-12-01 13:24:25 +01:00
87 lines
2.0 KiB
C
87 lines
2.0 KiB
C
|
/* ======== SourceMM ========
|
||
|
* Copyright (C) 2004-2005 SourceMM Development Team
|
||
|
* No warranties of any kind
|
||
|
*
|
||
|
* License: zlib/libpng
|
||
|
*
|
||
|
* Author(s): David "BAILOPAN" Anderson
|
||
|
* ============================
|
||
|
*/
|
||
|
|
||
|
#ifndef _INCLUDE_SOURCEMM_H
|
||
|
#define _INCLUDE_SOURCEMM_H
|
||
|
|
||
|
/**
|
||
|
* @brief SourceMM main functionality for GameDLL interception
|
||
|
* @file sourcemm.h
|
||
|
*/
|
||
|
|
||
|
#include <string>
|
||
|
#include <interface.h>
|
||
|
#include <eiface.h>
|
||
|
#include <sourcehook/sourcehook_impl.h>
|
||
|
#include <sourcehook/sourcehook.h>
|
||
|
#include "ISmmAPI.h"
|
||
|
#include "CPlugin.h"
|
||
|
#include "oslink.h"
|
||
|
#include "util.h"
|
||
|
|
||
|
#define SOURCEMM_VERSION "1.00"
|
||
|
#define SOURCEMM_DATE __DATE__
|
||
|
|
||
|
/**
|
||
|
* @brief Entry point for HL2 Engine
|
||
|
*/
|
||
|
SMM_API void *CreateInterface(const char *name, int *code);
|
||
|
|
||
|
/** @brief Wrapper to catch GameDLL calls */
|
||
|
void *EngineFactory(const char *name, int *code);
|
||
|
|
||
|
/** @brief Wrapper to catch GameDLL calls */
|
||
|
void *PhysicsFactory(const char *name, int *code);
|
||
|
|
||
|
/** @brief Wrapper to catch GameDLL calls */
|
||
|
void *FileSystemFactory(const char *name, int *code);
|
||
|
|
||
|
/** @brief Loads all plugins found in a file */
|
||
|
int LoadPluginsFromFile(const char *file);
|
||
|
|
||
|
/** @brief Logs a message to the standard log file */
|
||
|
void LogMessage(const char *msg, ...);
|
||
|
|
||
|
/** @brief Stores information about the GameDLL */
|
||
|
struct GameDllInfo
|
||
|
{
|
||
|
bool loaded;
|
||
|
HINSTANCE lib;
|
||
|
CreateInterfaceFn factory;
|
||
|
};
|
||
|
|
||
|
/** @brief Stores information about the HL2 Engine pointers */
|
||
|
struct EngineInfo
|
||
|
{
|
||
|
CreateInterfaceFn engineFactory;
|
||
|
CreateInterfaceFn physicsFactory;
|
||
|
CreateInterfaceFn fileSystemFactory;
|
||
|
CGlobalVars *pGlobals;
|
||
|
ICvar *icvar;
|
||
|
IVEngineServer *engine;
|
||
|
};
|
||
|
|
||
|
/** @brief Global variable for GameDLL info */
|
||
|
extern GameDllInfo g_GameDll;
|
||
|
|
||
|
/** @brief Global variable for Engine info */
|
||
|
extern EngineInfo g_Engine;
|
||
|
|
||
|
/** @brief Global singleton for SourceHook */
|
||
|
extern SourceHook::CSourceHookImpl g_SourceHook;
|
||
|
|
||
|
/** @brief Mod path (important!)*/
|
||
|
extern std::string g_ModPath;
|
||
|
|
||
|
/** @brief Path to server binary */
|
||
|
extern std::string g_BinPath;
|
||
|
|
||
|
#endif //_INCLUDE_SOURCEMM_H
|