diff --git a/Plugins/ThreadGuard/plugins.cpp b/Plugins/ThreadGuard/plugins.cpp index dee8b26f..d0b92899 100644 --- a/Plugins/ThreadGuard/plugins.cpp +++ b/Plugins/ThreadGuard/plugins.cpp @@ -42,6 +42,12 @@ void IPluginsV4::Shutdown(void) void IPluginsV4::LoadEngine(cl_enginefunc_t *pEngfuncs) { + if (g_pInterface->MetaHookAPIVersion < METAHOOK_API_VERSION) + { + g_pMetaHookAPI->SysError("MetaHookAPIVersion too low! expect %d, got %d !", METAHOOK_API_VERSION, g_pInterface->MetaHookAPIVersion); + return; + } + g_pFileSystem = g_pInterface->FileSystem; g_iEngineType = g_pMetaHookAPI->GetEngineType(); g_dwEngineBuildnum = g_pMetaHookAPI->GetEngineBuildnum(); diff --git a/include/HLSDK/common/command.h b/include/HLSDK/common/command.h index 178db801..cc129d41 100644 --- a/include/HLSDK/common/command.h +++ b/include/HLSDK/common/command.h @@ -9,14 +9,14 @@ typedef struct cmd_function_s char *name; xcommand_t function; int flags; -} -cmd_function_t; +}cmd_function_t; -extern cmd_function_t *(*Cmd_GetCmdBase)(void); - -cmd_function_t *Cmd_FindCmd(char *cmd_name); -xcommand_t Cmd_HookCmd(char *cmd_name, xcommand_t newfuncs); -cmd_function_t *Cmd_FindCmdPrev(char *cmd_name); -char *Cmd_CompleteCommand(char *partial, qboolean next); +#if 0 +extern cmd_function_t* (*Cmd_GetCmdBase)(void); +cmd_function_t *Cmd_FindCmd(const char *cmd_name); +xcommand_t Cmd_HookCmd(const char *cmd_name, xcommand_t newfuncs); +cmd_function_t *Cmd_FindCmdPrev(const char *cmd_name); +char *Cmd_CompleteCommand(const char *partial, qboolean next); +#endif #endif \ No newline at end of file diff --git a/include/metahook.h b/include/metahook.h index ed73b8ae..468a5a67 100644 --- a/include/metahook.h +++ b/include/metahook.h @@ -21,6 +21,9 @@ typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf); typedef void(*cvar_callback_t)(cvar_t *pcvar); +#ifndef __HLSDK_COMMAND__ +#define __HLSDK_COMMAND__ + typedef void(*xcommand_t)(void); typedef struct cmd_function_s @@ -42,6 +45,8 @@ typedef struct mh_plugininfo_s size_t PluginModuleSize; }mh_plugininfo_t; +#endif + #include #include @@ -427,12 +432,15 @@ void MH_Shutdown(void); #include #include +#define METAHOOK_API_VERSION 100 + typedef struct mh_interface_s { ICommandLine *CommandLine; IFileSystem *FileSystem; IRegistry *Registry; IFileSystem_HL25* FileSystem_HL25; + int MetaHookAPIVersion; }mh_interface_t; #include diff --git a/src/metahook.cpp b/src/metahook.cpp index 2972529f..445883cf 100644 --- a/src/metahook.cpp +++ b/src/metahook.cpp @@ -1035,6 +1035,7 @@ void MH_LoadEngine(HMODULE hEngineModule, BlobHandle_t hBlobEngine, const char* gInterface.FileSystem = g_pFileSystem; gInterface.Registry = registry; gInterface.FileSystem_HL25 = g_pFileSystem_HL25; + gInterface.MetaHookAPIVersion = METAHOOK_API_VERSION; if (hEngineModule) {