diff --git a/AMBuildScript b/AMBuildScript index b5e9d5a9..9598e119 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -13,23 +13,25 @@ class SM: 'name': 'EPISODEONE', 'platform': ['windows', 'linux']} self.possibleSdks['ep2'] = {'sdk': 'HL2SDKOB', 'ext': '2.ep2', 'def': '3', 'name': 'ORANGEBOX', 'platform': ['windows', 'linux']} - self.possibleSdks['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '6', + self.possibleSdks['css'] = {'sdk': 'HL2SDKCSS', 'ext': '2.css', 'def': '6', + 'name': 'CSS', 'platform': ['windows', 'linux', 'darwin']} + self.possibleSdks['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '7', 'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']} - self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '7', + self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '8', 'name': 'LEFT4DEAD', 'platform': ['windows', 'linux', 'darwin']} - self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '8', + self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '9', 'name': 'LEFT4DEAD2', 'platform': ['windows', 'linux', 'darwin']} self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', 'name': 'DARKMESSIAH', 'platform': ['windows']} - self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '9', + self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '10', 'name': 'ALIENSWARM', 'platform': ['windows']} self.possibleSdks['bgt'] = {'sdk': 'HL2SDK-BGT', 'ext': '2.bgt', 'def': '4', 'name': 'BLOODYGOODTIME', 'platform': ['windows']} self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5', 'name': 'EYE', 'platform': ['windows']} - self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '11', + self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '12', 'name': 'CSGO', 'platform': ['windows', 'linux']} - # self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '10', + # self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '11', # 'name': 'PORTAL2', 'platform': ['windows']} self.sdkInfo = { } @@ -40,6 +42,7 @@ class SM: #Detect variables envvars = { 'MMSOURCE19': 'mmsource-1.9', + 'HL2SDKCSS': 'hl2sdk-css', 'HL2SDKOBVALVE': 'hl2sdk-ob-valve', 'HL2SDKL4D': 'hl2sdk-l4d', 'HL2SDKL4D2': 'hl2sdk-l4d2', @@ -273,7 +276,7 @@ class SM: else: staticLibs = os.path.join(sdkPath, 'lib', 'linux') workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) - if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']: + if sdk in ['css', 'ep2v', 'l4d', 'l4d2', 'csgo']: libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so'] if sdk == 'csgo': libs.append('interfaces_i486.a') @@ -336,7 +339,7 @@ class SM: # We don't build for Portal 2 (yet?, ever?), but using this define in code as # it saves trouble if we ever need to - compiler['CDEFINES'].append('SE_PORTAL2=10') + compiler['CDEFINES'].append('SE_PORTAL2=11') paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'], ['public', 'tier0'], ['public', 'tier1']] @@ -375,7 +378,7 @@ class SM: if not noLink: if AMBuild.target['platform'] == 'linux': compiler['POSTLINKFLAGS'][0:0] = ['-lm'] - if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']: + if sdk in ['css', 'ep2v', 'l4d', 'l4d2', 'csgo']: compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so'] compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so'] else: diff --git a/core/ExtensionSys.cpp b/core/ExtensionSys.cpp index c3bfc571..f9767ce1 100644 --- a/core/ExtensionSys.cpp +++ b/core/ExtensionSys.cpp @@ -74,6 +74,8 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena #define GAMEFIX "2.bgt" #elif SOURCE_ENGINE == SE_EYE #define GAMEFIX "2.eye" +#elif SOURCE_ENGINE == SE_CSS +#define GAMEFIX "2.css" #elif SOURCE_ENGINE == SE_ORANGEBOXVALVE #define GAMEFIX "2.ep2v" #elif SOURCE_ENGINE == SE_DARKMESSIAH diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index db5be2f2..95068a89 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -51,7 +51,7 @@ typedef ICommandLine *(*FakeGetCommandLine)(); #define TIER0_NAME "libtier0.dylib" #define VSTDLIB_NAME "libvstdlib.dylib" #elif defined __linux__ -#if SOURCE_ENGINE >= SE_ORANGEBOXVALVE +#if SOURCE_ENGINE >= SE_CSS #define TIER0_NAME "libtier0.so" #define VSTDLIB_NAME "libvstdlib.so" #else diff --git a/core/MenuStyle_Base.cpp b/core/MenuStyle_Base.cpp index 665a221c..7cc98492 100644 --- a/core/MenuStyle_Base.cpp +++ b/core/MenuStyle_Base.cpp @@ -337,7 +337,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press) #endif 0, PITCH_NORM, -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE 0, #endif &pos); diff --git a/core/PluginSys.h b/core/PluginSys.h index 4c9c547d..705462b5 100644 --- a/core/PluginSys.h +++ b/core/PluginSys.h @@ -49,9 +49,9 @@ #include #if SOURCE_ENGINE >= SE_ALIENSWARM #include "convar_sm_swarm.h" -#elif (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) +#elif SOURCE_ENGINE >= SE_LEFT4DEAD #include "convar_sm_l4d.h" -#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_BLOODYGOODTIME) || (SOURCE_ENGINE == SE_EYE) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) +#elif SOURCE_ENGINE >= SE_ORANGEBOX #include "convar_sm_ob.h" #else #include "convar_sm.h" diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 09866a13..bb4a10ba 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -159,6 +159,8 @@ static const char *get_source_engine_name() return "bloodygoodtime"; #elif SOURCE_ENGINE == SE_EYE return "eye"; +#elif SOURCE_ENGINE == SE_CSS + return "css"; #elif SOURCE_ENGINE == SE_ORANGEBOXVALVE return "orangebox_valve"; #elif SOURCE_ENGINE == SE_LEFT4DEAD @@ -176,7 +178,7 @@ static const char *get_source_engine_name() static bool symbols_are_hidden() { -#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO) +#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) || (SOURCE_ENGINE == SE_CSGO) return true; #else return false; diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index 4af79bef..2561951c 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -2047,7 +2047,7 @@ static int32_t SDKEntFlagToSMEntFlag(int flag) #if SOURCE_ENGINE == SE_ALIENSWARM case FL_FREEZING: return ENTFLAG_FREEZING; -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS case FL_EP2V_UNKNOWN: return ENTFLAG_EP2V_UNKNOWN1; #endif @@ -2125,7 +2125,7 @@ static int32_t SMEntFlagToSDKEntFlag(int32_t flag) #if SOURCE_ENGINE == SE_ALIENSWARM case ENTFLAG_FREEZING: return FL_FREEZING; -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS case ENTFLAG_EP2V_UNKNOWN1: return FL_EP2V_UNKNOWN; #endif diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 5e6f8295..40dd1587 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -473,6 +473,8 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params) return 32; case SOURCE_ENGINE_EYE: return 33; + case SOURCE_ENGINE_CSS: + return 34; case SOURCE_ENGINE_ORANGEBOXVALVE: return 35; case SOURCE_ENGINE_LEFT4DEAD: diff --git a/core/sourcemm_api.h b/core/sourcemm_api.h index 6a6c1a08..60b09937 100644 --- a/core/sourcemm_api.h +++ b/core/sourcemm_api.h @@ -34,9 +34,9 @@ #if SOURCE_ENGINE >= SE_ALIENSWARM #include "convar_sm_swarm.h" -#elif (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) +#elif SOURCE_ENGINE >= SE_LEFT4DEAD #include "convar_sm_l4d.h" -#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_BLOODYGOODTIME) || (SOURCE_ENGINE == SE_EYE) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) +#elif SOURCE_ENGINE >= SE_ORANGEBOX #include "convar_sm_ob.h" #else #include "convar_sm.h" diff --git a/extensions/cstrike/AMBuilder b/extensions/cstrike/AMBuilder index f226dfe3..3488eb20 100644 --- a/extensions/cstrike/AMBuilder +++ b/extensions/cstrike/AMBuilder @@ -2,7 +2,7 @@ import os for i in SM.sdkInfo: - if i != 'ep2v' and i != 'csgo': + if i != 'css' and i != 'csgo': continue sdk = SM.sdkInfo[i] diff --git a/extensions/sdktools/vcaller.cpp b/extensions/sdktools/vcaller.cpp index bc3f631a..64c97982 100644 --- a/extensions/sdktools/vcaller.cpp +++ b/extensions/sdktools/vcaller.cpp @@ -129,7 +129,7 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p { return 0; } -#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD2) +#if (SOURCE_ENGINE == SE_CSS) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD2) s_call_addr = memutils->ResolveSymbol(handle, &sig[1]); #else s_call_addr = dlsym(handle, &sig[1]); diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index a4836221..af212e7f 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -528,7 +528,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params) CellRecipientFilter rf; rf.SetToReliable(true); rf.Initialize(player_list, total_players); -#if SOURCE_ENGINE == SE_ORANGEBOXVALVE +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, 0, &pos); #elif SOURCE_ENGINE < SE_PORTAL2 engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos); diff --git a/extensions/sdktools/vsound.cpp b/extensions/sdktools/vsound.cpp index 6b161b41..00aada42 100644 --- a/extensions/sdktools/vsound.cpp +++ b/extensions/sdktools/vsound.cpp @@ -36,7 +36,7 @@ SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const #if SOURCE_ENGINE >= SE_PORTAL2 SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector *, bool, float, int); SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector *, bool, float, int); -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector *, bool, float, int); SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector *, bool, float, int); #else @@ -265,7 +265,7 @@ int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChanne float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, @@ -326,7 +326,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, iSoundlevel, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample, float flVolume, float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, @@ -419,7 +419,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan (crf, iEntIndex, iChannel, buffer, -1, buffer, flVolume, SNDLVL_TO_ATTN(static_cast(sndlevel)), nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); -#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE +#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity); -#endif // SOURCE_ENGINE == SE_ORANGEBOXVALVE +#endif // SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS #endif // SOURCE_ENGINE >= SE_PORTAL2 private: size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter); diff --git a/loader/loader.cpp b/loader/loader.cpp index e4a08536..fe9f25d8 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -78,6 +78,7 @@ #define FILENAME_1_6_EYE "sourcemod.2.eye" PLATFORM_EXT #define FILENAME_1_6_PORTAL2 "sourcemod.2.portal2" PLATFORM_EXT #define FILENAME_1_6_CSGO "sourcemod.2.csgo" PLATFORM_EXT +#define FILENAME_1_6_CSS "sourcemod.2.css" PLATFORM_EXT HINSTANCE g_hCore = NULL; bool load_attempted = false; @@ -269,6 +270,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co filename = FILENAME_1_6_CSGO; break; } + case SOURCE_ENGINE_CSS: + { + filename = FILENAME_1_6_CSS; + break; + } default: { return NULL; diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index 12f122a2..75db9661 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -42,7 +42,8 @@ #define SOURCE_SDK_EPISODE2 30 /**< SDK+Engine released after Episode 2/Orange Box */ #define SOURCE_SDK_BLOODYGOODTIME 32 /**< Modified version of ep2 engine used by Bloody Good Time (no SDK) */ #define SOURCE_SDK_EYE 33 /**< Modified version of ep2 engine used by E.Y.E Divine Cybermancy (no SDK) */ -#define SOURCE_SDK_EPISODE2VALVE 35 /**< SDK+Engine released after Episode 2/Orange Box */ +#define SOURCE_SDK_CSS 34 /**< Sometime-older version of Source 2009 SDK+Engine, used for Counter-Strike: Source */ +#define SOURCE_SDK_EPISODE2VALVE 35 /**< SDK+Engine released after Episode 2/Orange Box, "Source 2009" or "Source MP" */ #define SOURCE_SDK_LEFT4DEAD 40 /**< Engine released after Left 4 Dead (no SDK yet) */ #define SOURCE_SDK_LEFT4DEAD2 50 /**< Engine released after Left 4 Dead 2 (no SDK yet) */ #define SOURCE_SDK_ALIENSWARM 60 /**< SDK+Engine released after Alien Swarm */ diff --git a/tools/buildbot/PackageScript b/tools/buildbot/PackageScript index 540c93ca..b52c5027 100644 --- a/tools/buildbot/PackageScript +++ b/tools/buildbot/PackageScript @@ -227,7 +227,7 @@ AddNormalLibrary('geoip.ext', 'extensions') AddNormalLibrary('dbi.mysql.ext', 'extensions') AddNormalLibrary('dbi.sqlite.ext', 'extensions') -AddNormalLibrary('game.cstrike.ext.2.ep2v', 'extensions') +AddNormalLibrary('game.cstrike.ext.2.css', 'extensions') if AMBuild.target['platform'] != 'darwin': AddNormalLibrary('game.cstrike.ext.2.csgo', 'extensions')