From c8a3fd5959d53114dd5e31a032444bef99272261 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 9 Oct 2013 08:46:13 -0400 Subject: [PATCH] Add support for Blade Symphony (bug 5948, r=asherkin). --- AMBuildScript | 19 +++++++++++-------- core/ISmmPluginExt.h | 1 + core/metamod_console.cpp | 2 ++ core/provider/provider_ep2.cpp | 2 ++ loader/loader.cpp | 5 +++++ loader/loader.h | 1 + loader/serverplugin.cpp | 1 + 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index a039ad6..085d2eb 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -51,15 +51,18 @@ class MMS: self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5', 'name': 'EYE', 'platform': ['windows'], 'dir': 'hl2sdk-eye'} - self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '16', + self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '17', 'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin'], 'dir': 'hl2sdk-csgo'} - self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '17', + self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '18', 'name': 'DOTA', 'platform': ['windows'], 'dir': 'hl2sdk-dota'} self.possibleSdks['portal2'] = {'sdk': 'HL2SDKPORTAL2','ext': '2.portal2', 'def': '15', 'name': 'PORTAL2', 'platform': [], 'dir': 'hl2sdk-portal2'} + self.possibleSdks['blade'] = {'sdk': 'HL2SDKBLADE', 'ext': '2.blade', 'def': '16', + 'name': 'BLADE', 'platform': ['windows', 'linux'], + 'dir': 'hl2sdk-blade'} self.sdkInfo = { } @@ -277,9 +280,9 @@ class MMS: libs = [] if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'l4d2']: libs = ['tier1_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so'] - elif sdk in ['l4d', 'nd', 'csgo']: + elif sdk in ['l4d', 'nd', 'blade', 'csgo']: libs = ['tier1_i486.a', 'libvstdlib.so', 'libtier0.so'] - if sdk == 'csgo': + if sdk in ['blade', 'csgo']: libs.insert(0, 'interfaces_i486.a') elif sdk == 'sdk2013': libs = ['tier1.a', 'libvstdlib_srv.so', 'libtier0_srv.so'] @@ -312,7 +315,7 @@ class MMS: job.AddCommand(SymlinkCommand(link, target)) elif AMBuild.target['platform'] == 'windows': libs = ['tier0', 'tier1', 'vstdlib'] - if sdk in ['swarm', 'csgo', 'dota']: + if sdk in ['swarm', 'blade', 'csgo', 'dota']: libs.append('interfaces') for lib in libs: libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib' @@ -326,7 +329,7 @@ class MMS: else: builder.AddObjectFiles(['tier1_i486.a']) - if( sdk in ['csgo', 'dota'] ): + if( sdk in ['blade', 'csgo', 'dota'] ): builder.AddObjectFiles(['interfaces_i486.a']) def DefaultHL2Compiler(self, path, sdk, noLink = False): @@ -361,7 +364,7 @@ class MMS: compiler['CDEFINES'].remove('_snprintf=snprintf') compiler['CDEFINES'].remove('_vsnprintf=vsnprintf') - if sdk in ['swarm', 'csgo', 'dota']: + if sdk in ['swarm', 'blade', 'csgo', 'dota']: if AMBuild.target['platform'] == 'windows': compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32']) else: @@ -394,7 +397,7 @@ class MMS: if sdk in ['css', 'hl2dm', 'dods', 'tf2', 'sdk2013', 'l4d2']: compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so'] compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so'] - elif sdk in ['l4d', 'nd', 'csgo']: + elif sdk in ['l4d', 'nd', 'blade', 'csgo']: compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so'] compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so'] else: diff --git a/core/ISmmPluginExt.h b/core/ISmmPluginExt.h index 477061d..46859b8 100644 --- a/core/ISmmPluginExt.h +++ b/core/ISmmPluginExt.h @@ -62,6 +62,7 @@ enum #define SOURCE_ENGINE_TF2 17 /**< Team Fortress 2 */ #define SOURCE_ENGINE_NUCLEARDAWN 18 /**< Nuclear Dawn */ #define SOURCE_ENGINE_SDK2013 19 /**< Source SDK 2013 */ +#define SOURCE_ENGINE_BLADE 20 /**< Blade Symphony */ #define METAMOD_PLAPI_VERSION 15 /**< Version of this header file */ #define METAMOD_PLAPI_NAME "ISmmPlugin" /**< Name of the plugin interface */ diff --git a/core/metamod_console.cpp b/core/metamod_console.cpp index 60ced5a..8ccd2e2 100644 --- a/core/metamod_console.cpp +++ b/core/metamod_console.cpp @@ -139,6 +139,8 @@ bool Command_Meta(IMetamodSourceCommandInfo *info) CONMSG(" Engine: E.Y.E. Divine Cybermancy (2011)\n"); #elif SOURCE_ENGINE == SE_PORTAL2 CONMSG(" Engine: Portal 2 (2011)\n"); +#elif SOURCE_ENGINE == SE_BLADE + CONMSG(" Engine: Blade Symphony (2013)\n"); #elif SOURCE_ENGINE == SE_CSGO CONMSG(" Engine: Counter-Strike: Global Offensive (2012)\n"); #elif SOURCE_ENGINE == SE_DOTA diff --git a/core/provider/provider_ep2.cpp b/core/provider/provider_ep2.cpp index 6a7b66a..e8b8a41 100644 --- a/core/provider/provider_ep2.cpp +++ b/core/provider/provider_ep2.cpp @@ -399,6 +399,8 @@ int BaseProvider::DetermineSourceEngine(const char *game) return SOURCE_ENGINE_EYE; #elif SOURCE_ENGINE == SE_PORTAL2 return SOURCE_ENGINE_PORTAL2; +#elif SOURCE_ENGINE == SE_BLADE + return SOURCE_ENGINE_BLADE; #elif SOURCE_ENGINE == SE_CSGO return SOURCE_ENGINE_CSGO; #elif SOURCE_ENGINE == SE_DOTA diff --git a/loader/loader.cpp b/loader/loader.cpp index d52b6d0..52eb9ba 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -86,6 +86,7 @@ static const char *backend_names[] = "2.tf2", "2.nd", "2.sdk2013", + "2.blade", }; #if defined _WIN32 @@ -280,6 +281,10 @@ mm_DetermineBackend(QueryValveInterface engineFactory, const char *game_name) else if (engineFactory("VEngineServer022", NULL) != NULL && engineFactory("VEngineCvar007", NULL) != NULL) { + if (strcmp(game_name, "berimbau") == 0) + { + return MMBackend_Blade; + } if (strcmp(game_name, "portal2") == 0) { return MMBackend_Portal2; diff --git a/loader/loader.h b/loader/loader.h index d52508e..a3e3cfb 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -98,6 +98,7 @@ enum MetamodBackend MMBackend_TF2, MMBackend_NuclearDawn, MMBackend_SDK2013, + MMBackend_Blade, MMBackend_UNKNOWN }; diff --git a/loader/serverplugin.cpp b/loader/serverplugin.cpp index 014f575..e3b3140 100644 --- a/loader/serverplugin.cpp +++ b/loader/serverplugin.cpp @@ -136,6 +136,7 @@ public: /* AS inserted ClientFullyConnect into vtable, so move entries up on older engines */ if (mm_backend != MMBackend_AlienSwarm && mm_backend != MMBackend_Portal2 + && mm_backend != MMBackend_Blade && mm_backend != MMBackend_CSGO && mm_backend != MMBackend_DOTA) {