Add support for hl2sdk-mock.

This commit is contained in:
David Anderson 2021-09-20 21:23:33 -07:00
parent d84fd76070
commit 1b0c7bc1b8
4 changed files with 17 additions and 1 deletions

View File

@ -36,6 +36,11 @@ CSGO = {
'linux': ['x86', 'x86_64'],
'mac': ['x86_64']
}
Mock = {
'windows': ['x86', 'x86_64'],
'linux': ['x86', 'x86_64'],
'mac': ['x86_64']
}
SDKMap = {
'episode1': SDK('HL2SDK', '2.ep1', '1', 'EPISODEONE', WinLinux, 'episode1'),
@ -59,6 +64,7 @@ SDKMap = {
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
'doi': SDK('HL2SDKDOI', '2.doi', '20', 'DOI', WinLinuxMac, 'doi'),
'mock': SDK('HL2SDK-MOCK', '2.mock', '999', 'MOCK', Mock, 'mock'),
}
# Stable sorting for command equivalence in AMBuild.
@ -613,7 +619,7 @@ class SMConfig(object):
if compiler.target.platform == 'linux':
if sdk.name in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'bms', 'nucleardawn', 'l4d2', 'insurgency', 'doi']:
dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so']
elif compiler.target.arch == 'x86_64' and sdk.name in ['csgo', 'blade']:
elif compiler.target.arch == 'x86_64' and sdk.name in ['csgo', 'blade', 'mock']:
dynamic_libs = ['libtier0_client.so', 'libvstdlib_client.so']
elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo']:
dynamic_libs = ['libtier0.so', 'libvstdlib.so']

View File

@ -496,6 +496,8 @@ const char *CoreProviderImpl::GetSourceEngineName()
return "doi";
#elif SOURCE_ENGINE == SE_CSGO
return "csgo";
#elif SOURCE_ENGINE == SE_MOCK
return "mock";
#endif
}

View File

@ -12,6 +12,8 @@ project.sources += [
for sdk_name in SM.sdks:
sdk = SM.sdks[sdk_name]
if sdk.name == 'mock':
continue
for cxx in builder.targets:
if not cxx.target.arch in sdk.platformSpec[cxx.target.platform]:

View File

@ -85,6 +85,7 @@
#define FILENAME_1_6_DOI PLATFORM_ARCH_FOLDER "sourcemod.2.doi" PLATFORM_EXT
#define FILENAME_1_6_CONTAGION PLATFORM_ARCH_FOLDER "sourcemod.2.contagion" PLATFORM_EXT
#define FILENAME_1_6_BMS PLATFORM_ARCH_FOLDER "sourcemod.2.bms" PLATFORM_EXT
#define FILENAME_1_6_MOCK PLATFORM_ARCH_FOLDER "sourcemod.2.mock" PLATFORM_EXT
HINSTANCE g_hCore = NULL;
bool load_attempted = false;
@ -333,6 +334,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
filename = FILENAME_1_6_DOI;
break;
}
case SOURCE_ENGINE_MOCK:
{
filename = FILENAME_1_6_MOCK;
break;
}
default:
{
return NULL;