Skip to content

Commit

Permalink
Add support for Military Conflict: Vietnam (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
psychonic committed Dec 20, 2022
1 parent 6f93de3 commit 63c5c15
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 28 deletions.
7 changes: 4 additions & 3 deletions AMBuildScript
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ PossibleSDKs = {
'swarm': SDK('HL2SDK-SWARM', '2.swarm', '17', 'ALIENSWARM', WinOnly, 'swarm'),
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '22', 'CSGO', CSGO, 'csgo'),
'dota': SDK('HL2SDKDOTA', '2.dota', '23', 'DOTA', [], 'dota'),
'mcv': SDK('HL2SDKMCV', '2.mcv', '22', 'MCV', WinOnly, 'mcv'),
'csgo': SDK('HL2SDKCSGO', '2.csgo', '23', 'CSGO', CSGO, 'csgo'),
'dota': SDK('HL2SDKDOTA', '2.dota', '24', 'DOTA', [], 'dota'),
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '18', 'PORTAL2', [], 'portal2'),
'blade': SDK('HL2SDKBLADE', '2.blade', '19', 'BLADE', Blade, 'blade'),
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '20', 'INSURGENCY', Insurgency, 'insurgency'),
Expand Down Expand Up @@ -500,7 +501,7 @@ class MMSConfig(object):
dynamic_libs = ['libtier0.dylib', 'libvstdlib.dylib']
elif compiler.target.platform == 'windows':
libs = ['tier0', 'tier1', 'vstdlib']
if sdk.name in ['swarm', 'blade', 'insurgency', 'doi', 'csgo', 'dota']:
if sdk.name in ['swarm', 'blade', 'insurgency', 'doi', 'mcv', 'csgo', 'dota']:
libs.append('interfaces')
if sdk.name == 'bms':
libs.append('mathlib')
Expand Down
1 change: 1 addition & 0 deletions core/ISmmPluginExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#define SOURCE_ENGINE_DOI 24 /**< Day of Infamy */
#define SOURCE_ENGINE_MOCK 25 /**< Mock source engine */
#define SOURCE_ENGINE_PVKII 26 /**< Pirates, Vikings, and Knights II */
#define SOURCE_ENGINE_MCV 27 /**< Military Conflict: Vietnam */

#define METAMOD_PLAPI_VERSION 16 /**< Version of this header file */
#define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */
Expand Down
8 changes: 6 additions & 2 deletions core/provider/provider_ep2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void BaseProvider::UnregisterConCommandBase(ConCommandBase *pCommand)

int BaseProvider::GetUserMessageCount()
{
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
return -1;
#else
return (int)usermsgs_list.size();
Expand Down Expand Up @@ -544,6 +544,8 @@ int BaseProvider::DetermineSourceEngine()
return SOURCE_ENGINE_MOCK;
#elif SOURCE_ENGINE == SE_PVKII
return SOURCE_ENGINE_PVKII;
#elif SOURCE_ENGINE == SE_MCV
return SOURCE_ENGINE_MCV;
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif
Expand Down Expand Up @@ -679,6 +681,8 @@ const char *BaseProvider::GetEngineDescription() const
return "Mock";
#elif SOURCE_ENGINE == SE_PVKII
return "Pirates, Vikings, and Knights II";
#elif SOURCE_ENGINE == SE_MCV
return "Military Combat: Vietnam";
#else
#error "SOURCE_ENGINE not defined to a known value"
#endif
Expand Down Expand Up @@ -765,7 +769,7 @@ void ClientCommand(edict_t *client)
RETURN_META(MRES_IGNORED);
}

#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_BLADE
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV

void CacheUserMessages()
{
Expand Down
8 changes: 7 additions & 1 deletion loader/loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ static const char *backend_names[] =
"2.bms",
"2.doi",
"2.mock",
"2.pvkii"
"2.pvkii",
"2.mcv"
};

#if defined _WIN32
Expand Down Expand Up @@ -330,6 +331,11 @@ mm_DetermineBackend(QueryValveInterface engineFactory, QueryValveInterface serve
{
return MMBackend_Blade;
}

if (mm_FindPattern((void *)engineFactory, "Military Conflict: Vietnam", sizeof("Military Conflict: Vietnam") - 1))
{
return MMBackend_MCV;
}

return MMBackend_CSGO;
}
Expand Down
2 changes: 1 addition & 1 deletion loader/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ enum MetamodBackend
MMBackend_BMS,
MMBackend_DOI,
MMBackend_Mock,

MMBackend_PVKII,
MMBackend_MCV,
MMBackend_UNKNOWN
};

Expand Down
1 change: 1 addition & 0 deletions loader/serverplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class ServerPlugin
&& mm_backend != MMBackend_Insurgency
&& mm_backend != MMBackend_DOI
&& mm_backend != MMBackend_CSGO
&& mm_backend != MMBackend_MCV
&& mm_backend != MMBackend_DOTA)
{
SourceHook::MemFuncInfo mfp_fconnect;
Expand Down
43 changes: 22 additions & 21 deletions support/checkout-deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@
[CmdletBinding()]
param(
[string[]]$SDKs = @(
'csgo',
'hl2dm',
'nucleardawn',
'l4d2',
'dods',
'l4d',
'css',
'tf2',
'insurgency',
'sdk2013',
'dota',
'orangebox',
'blade',
'episode1',
'bms',
'darkm',
'swarm',
'bgt',
'eye',
'contagion',
'doi',
'csgo'
'hl2dm'
'nucleardawn'
'l4d2'
'dods'
'l4d'
'css'
'tf2'
'insurgency'
'sdk2013'
'dota'
'orangebox'
'blade'
'episode1'
'bms'
'darkm'
'swarm'
'bgt'
'eye'
'contagion'
'doi'
'pvkii'
'mcv'
)
)

Expand Down

0 comments on commit 63c5c15

Please sign in to comment.