1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

Disable dynamic hooking iface on non-Windows Dota.

This should really be disabled on x64 (or ported to work on it), but
not sure how to best check that in the AMBuilder file.
This commit is contained in:
Nicholas Hastings 2016-07-22 13:59:58 -04:00
parent 366a27e10c
commit 4007ae8310
2 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,6 @@ for sdk_name in MMS.sdks:
'provider/console.cpp', 'provider/console.cpp',
'provider/provider_ep2.cpp', 'provider/provider_ep2.cpp',
'sourcehook/sourcehook.cpp', 'sourcehook/sourcehook.cpp',
'sourcehook/sourcehook_hookmangen.cpp',
'sourcehook/sourcehook_impl_chookidman.cpp', 'sourcehook/sourcehook_impl_chookidman.cpp',
'sourcehook/sourcehook_impl_chookmaninfo.cpp', 'sourcehook/sourcehook_impl_chookmaninfo.cpp',
'sourcehook/sourcehook_impl_cproto.cpp', 'sourcehook/sourcehook_impl_cproto.cpp',
@ -26,5 +25,9 @@ for sdk_name in MMS.sdks:
'gamedll_bridge.cpp', 'gamedll_bridge.cpp',
'vsp_bridge.cpp' 'vsp_bridge.cpp'
] ]
# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?"
if sdk.name != 'dota' or builder.target_platform == 'windows':
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp']
nodes = builder.Add(binary) nodes = builder.Add(binary)
MMS.binaries += [nodes] MMS.binaries += [nodes]

View File

@ -131,7 +131,9 @@ static ConVar *mm_basedir = NULL;
static CreateInterfaceFn engine_factory = NULL; static CreateInterfaceFn engine_factory = NULL;
static CreateInterfaceFn physics_factory = NULL; static CreateInterfaceFn physics_factory = NULL;
static CreateInterfaceFn filesystem_factory = NULL; static CreateInterfaceFn filesystem_factory = NULL;
#if !defined( __amd64__ )
static CHookManagerAutoGen g_SH_HookManagerAutoGen(&g_SourceHook); static CHookManagerAutoGen g_SH_HookManagerAutoGen(&g_SourceHook);
#endif
static META_RES last_meta_res; static META_RES last_meta_res;
static IServerPluginCallbacks *vsp_callbacks = NULL; static IServerPluginCallbacks *vsp_callbacks = NULL;
static bool were_plugins_loaded = false; static bool were_plugins_loaded = false;
@ -1025,11 +1027,19 @@ void *MetamodSource::MetaFactory(const char *iface, int *ret, PluginId *id)
} }
else if (strcmp(iface, MMIFACE_SH_HOOKMANAUTOGEN) == 0) else if (strcmp(iface, MMIFACE_SH_HOOKMANAUTOGEN) == 0)
{ {
#if defined( __amd64__ )
if (ret)
{
*ret = META_IFACE_FAILED;
}
return nullptr;
#else
if (ret) if (ret)
{ {
*ret = META_IFACE_OK; *ret = META_IFACE_OK;
} }
return static_cast<void *>(static_cast<SourceHook::IHookManagerAutoGen *>(&g_SH_HookManagerAutoGen)); return static_cast<void *>(static_cast<SourceHook::IHookManagerAutoGen *>(&g_SH_HookManagerAutoGen));
#endif
} }
CPluginManager::CPlugin *pl; CPluginManager::CPlugin *pl;