diff --git a/AMBuildScript b/AMBuildScript index 6ada6eb9..ec943c78 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -55,22 +55,23 @@ SDKMap = { 'hl2dm': SDK('HL2SDKHL2DM', '2.hl2dm', '7', 'HL2DM', WinLinuxMac, 'hl2dm'), 'dods': SDK('HL2SDKDODS', '2.dods', '8', 'DODS', WinLinuxMac, 'dods'), 'sdk2013': SDK('HL2SDK2013', '2.sdk2013', '9', 'SDK2013', WinLinuxMac, 'sdk2013'), - 'tf2': SDK('HL2SDKTF2', '2.tf2', '11', 'TF2', WinLinuxMac, 'tf2'), - 'l4d': SDK('HL2SDKL4D', '2.l4d', '12', 'LEFT4DEAD', WinLinuxMac, 'l4d'), - 'nucleardawn': SDK('HL2SDKND', '2.nd', '13', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), - 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '15', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), + 'tf2': SDK('HL2SDKTF2', '2.tf2', '12', 'TF2', WinLinuxMac, 'tf2'), + 'l4d': SDK('HL2SDKL4D', '2.l4d', '13', 'LEFT4DEAD', WinLinuxMac, 'l4d'), + 'nucleardawn': SDK('HL2SDKND', '2.nd', '14', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), + 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '16', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), 'darkm': SDK('HL2SDK-DARKM', '2.darkm', '2', 'DARKMESSIAH', WinOnly, 'darkm'), - 'swarm': SDK('HL2SDK-SWARM', '2.swarm', '16', 'ALIENSWARM', WinOnly, 'swarm'), + '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', '21', 'CSGO', CSGO, 'csgo'), - 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'), - 'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', Blade, 'blade'), - 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'), - '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'), + 'csgo': SDK('HL2SDKCSGO', '2.csgo', '22', 'CSGO', CSGO, 'csgo'), + 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '18', 'PORTAL2', [], 'portal2'), + 'blade': SDK('HL2SDKBLADE', '2.blade', '19', 'BLADE', Blade, 'blade'), + 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '20', 'INSURGENCY', WinLinuxMac, 'insurgency'), + 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '15', 'CONTAGION', WinOnly, 'contagion'), + 'bms': SDK('HL2SDKBMS', '2.bms', '11', 'BMS', WinLinux, 'bms'), + 'doi': SDK('HL2SDKDOI', '2.doi', '21', 'DOI', WinLinuxMac, 'doi'), 'mock': SDK('HL2SDK-MOCK', '2.mock', '999', 'MOCK', Mock, 'mock'), + 'pvkii': SDK('HL2SDKPVKII', '2.pvkii', '10', 'PVKII', WinLinux, 'pvkii'), } # Stable sorting for command equivalence in AMBuild. @@ -595,7 +596,7 @@ class SMConfig(object): compiler.defines += ['SOURCE_ENGINE=' + sdk.code] - if sdk.name in ['sdk2013', 'bms'] and compiler.like('gcc'): + if sdk.name in ['sdk2013', 'bms', 'pvkii'] and compiler.like('gcc'): # The 2013 SDK already has these in public/tier0/basetypes.h compiler.defines.remove('stricmp=strcasecmp') compiler.defines.remove('_stricmp=strcasecmp') @@ -620,7 +621,7 @@ class SMConfig(object): if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']: compiler.defines += ['NETWORK_VARS_ENABLED'] - if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2']: + if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'pvkii']: if compiler.target.platform in ['linux', 'mac']: compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE'] @@ -653,14 +654,14 @@ class SMConfig(object): if compiler.target.platform == 'linux': if sdk.name == 'episode1': lib_folder = os.path.join(sdk.path, 'linux_sdk') - elif sdk.name in ['sdk2013', 'bms']: + elif sdk.name in ['sdk2013', 'bms', 'pvkii']: lib_folder = os.path.join(sdk.path, 'lib', 'public', 'linux32') elif compiler.target.arch == 'x86_64': lib_folder = os.path.join(sdk.path, 'lib', 'linux64') else: lib_folder = os.path.join(sdk.path, 'lib', 'linux') elif compiler.target.platform == 'mac': - if sdk.name in ['sdk2013', 'bms']: + if sdk.name in ['sdk2013', 'bms', 'pvkii']: lib_folder = os.path.join(sdk.path, 'lib', 'public', 'osx32') elif compiler.target.arch == 'x86_64': lib_folder = os.path.join(sdk.path, 'lib', 'osx64') @@ -668,7 +669,7 @@ class SMConfig(object): lib_folder = os.path.join(sdk.path, 'lib', 'mac') if compiler.target.platform in ['linux', 'mac']: - if sdk.name in ['sdk2013', 'bms'] or compiler.target.arch == 'x86_64': + if sdk.name in ['sdk2013', 'bms', 'pvkii'] or compiler.target.arch == 'x86_64': compiler.postlink += [ os.path.join(lib_folder, 'tier1.a'), os.path.join(lib_folder, 'mathlib.a') @@ -691,7 +692,7 @@ class SMConfig(object): dynamic_libs = ['libtier0_srv.so', 'libvstdlib_srv.so'] elif compiler.target.arch == 'x86_64' and sdk.name in ['csgo', 'mock']: dynamic_libs = ['libtier0_client.so', 'libvstdlib_client.so'] - elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo']: + elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo', 'pvkii']: dynamic_libs = ['libtier0.so', 'libvstdlib.so'] else: dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so'] diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 2b62c63b..b557f8a2 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -184,7 +184,8 @@ void CHalfLife2::InitLogicalEntData() || SOURCE_ENGINE == SE_SDK2013 \ || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_BLADE \ - || SOURCE_ENGINE == SE_NUCLEARDAWN + || SOURCE_ENGINE == SE_NUCLEARDAWN \ + || SOURCE_ENGINE == SE_PVKII if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr)) { @@ -1339,7 +1340,7 @@ SMFindMapResult CHalfLife2::FindMap(const char *pMapName, char *pFoundMap, size_ } #elif SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM \ - || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS + || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_PVKII static IVEngineServer *engine23 = (IVEngineServer *)(g_SMAPI->GetEngineFactory()("VEngineServer023", nullptr)); if (engine23) { @@ -1526,7 +1527,8 @@ uint64_t CHalfLife2::GetServerSteamId64() const || SOURCE_ENGINE == SE_DOI \ || SOURCE_ENGINE == SE_SDK2013 \ || SOURCE_ENGINE == SE_ALIENSWARM \ - || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_TF2 \ + || SOURCE_ENGINE == SE_PVKII const CSteamID *sid = engine->GetGameServerSteamID(); if (sid) { diff --git a/core/HalfLife2.h b/core/HalfLife2.h index 0b6b4449..4c1d90a2 100644 --- a/core/HalfLife2.h +++ b/core/HalfLife2.h @@ -74,7 +74,7 @@ using namespace SourceMod; || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_DOI #define SOURCE_BIN_PREFIX "lib" #define SOURCE_BIN_SUFFIX "_srv" -#elif SOURCE_ENGINE >= SE_LEFT4DEAD +#elif SOURCE_ENGINE >= SE_LEFT4DEAD || SOURCE_ENGINE == SE_PVKII #define SOURCE_BIN_PREFIX "lib" #define SOURCE_BIN_SUFFIX "" #else diff --git a/core/MenuStyle_Base.cpp b/core/MenuStyle_Base.cpp index 9c1614ae..b194ae03 100644 --- a/core/MenuStyle_Base.cpp +++ b/core/MenuStyle_Base.cpp @@ -339,7 +339,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press) 0, PITCH_NORM, #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \ - || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII 0, #endif &pos); diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 3fd7b2a3..34f25db3 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -646,7 +646,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername int userId = engine->GetPlayerUserId(pEntity); #if (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2) + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2 || SOURCE_ENGINE == SE_PVKII) static ConVar *tv_name = icvar->FindVar("tv_name"); #endif #if SOURCE_ENGINE == SE_TF2 @@ -674,7 +674,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername #elif SOURCE_ENGINE == SE_BLADE || strcmp(playername, "BBTV") == 0 #elif (SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2) + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_LEFT4DEAD2 || SOURCE_ENGINE == SE_PVKII) || (tv_name && strcmp(playername, tv_name->GetString()) == 0) || (tv_name && tv_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0) #else || strcmp(playername, "SourceTV") == 0 @@ -2087,7 +2087,8 @@ void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity) || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_INSURGENCY \ || SOURCE_ENGINE == SE_DOI \ - || SOURCE_ENGINE == SE_BLADE + || SOURCE_ENGINE == SE_BLADE \ + || SOURCE_ENGINE == SE_PVKII m_pIClient = engine->GetIServer()->GetClient(m_iIndex - 1); #else #if SOURCE_ENGINE == SE_SDK2013 diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 8c68cc06..6b7f03ca 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -371,6 +371,8 @@ void UTIL_ConsolePrint(const char *fmt, ...) #define GAMEFIX "2.csgo" #elif SOURCE_ENGINE == SE_CONTAGION #define GAMEFIX "2.contagion" +#elif SOURCE_ENGINE == SE_PVKII +#define GAMEFIX "2.pvkii" #else #define GAMEFIX "2.ep1" #endif @@ -495,6 +497,8 @@ const char *CoreProviderImpl::GetSourceEngineName() return "csgo"; #elif SOURCE_ENGINE == SE_MOCK return "mock"; +#elif SOURCE_ENGINE == SE_PVKII + return "pvkii"; #endif } @@ -512,7 +516,8 @@ bool CoreProviderImpl::SymbolsAreHidden() || (SOURCE_ENGINE == SE_INSURGENCY) \ || (SOURCE_ENGINE == SE_DOI) \ || (SOURCE_ENGINE == SE_BLADE) \ - || (SOURCE_ENGINE == SE_CSGO) + || (SOURCE_ENGINE == SE_CSGO) \ + || (SOURCE_ENGINE == SE_PVKII) return true; #else return false; diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index 5e84755a..a2092b8a 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -1458,7 +1458,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params) // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \ || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE + || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; @@ -1577,7 +1577,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params) // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \ || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE + || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; @@ -2508,7 +2508,7 @@ static int32_t SDKEntFlagToSMEntFlag(int flag) case FL_FREEZING: return ENTFLAG_FREEZING; #elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII case FL_EP2V_UNKNOWN: return ENTFLAG_EP2V_UNKNOWN1; #endif @@ -2587,7 +2587,7 @@ static int32_t SMEntFlagToSDKEntFlag(int32_t flag) case ENTFLAG_FREEZING: return FL_FREEZING; #elif SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII case ENTFLAG_EP2V_UNKNOWN1: return FL_EP2V_UNKNOWN; #endif diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index ab0c1989..d07a8a25 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -505,6 +505,7 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params) case SOURCE_ENGINE_TF2: case SOURCE_ENGINE_BMS: case SOURCE_ENGINE_SDK2013: + case SOURCE_ENGINE_PVKII: return 35; case SOURCE_ENGINE_LEFT4DEAD: return 40; diff --git a/core/sourcemm_api.cpp b/core/sourcemm_api.cpp index ab0bf282..a8010799 100644 --- a/core/sourcemm_api.cpp +++ b/core/sourcemm_api.cpp @@ -70,7 +70,7 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen PLUGIN_SAVEVARS(); GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_SDK2013 +#if SOURCE_ENGINE == SE_SDK2013 // Shim to avoid hooking shims engine = (IVEngineServer *)ismm->GetEngineFactory()("VEngineServer023", nullptr); if (!engine) diff --git a/extensions/sdkhooks/extension.cpp b/extensions/sdkhooks/extension.cpp index 8178e714..aeef6e60 100644 --- a/extensions/sdkhooks/extension.cpp +++ b/extensions/sdkhooks/extension.cpp @@ -177,7 +177,7 @@ SH_DECL_MANUALHOOK1_void(StartTouch, 0, 0, 0, CBaseEntity *); SH_DECL_MANUALHOOK0_void(Think, 0, 0, 0); SH_DECL_MANUALHOOK1_void(Touch, 0, 0, 0, CBaseEntity *); #if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_PVKII SH_DECL_MANUALHOOK4_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *, CDmgAccumulator *); #else SH_DECL_MANUALHOOK3_void(TraceAttack, 0, 0, 0, CTakeDamageInfoHack &, const Vector &, CGameTrace *); @@ -1455,7 +1455,7 @@ void SDKHooks::Hook_TouchPost(CBaseEntity *pOther) } #if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_PVKII void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator) #else void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr) @@ -1536,7 +1536,7 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, } #if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_PVKII void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator) #else void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr) diff --git a/extensions/sdkhooks/extension.h b/extensions/sdkhooks/extension.h index 1d0a9968..c4b7e034 100644 --- a/extensions/sdkhooks/extension.h +++ b/extensions/sdkhooks/extension.h @@ -308,7 +308,7 @@ public: void Hook_Touch(CBaseEntity *pOther); void Hook_TouchPost(CBaseEntity *pOther); #if SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_PVKII void Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator); void Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator); #else diff --git a/extensions/sdkhooks/takedamageinfohack.cpp b/extensions/sdkhooks/takedamageinfohack.cpp index 2e210d90..d7a40604 100644 --- a/extensions/sdkhooks/takedamageinfohack.cpp +++ b/extensions/sdkhooks/takedamageinfohack.cpp @@ -70,7 +70,7 @@ CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity * #endif #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII m_iDamagedOtherPlayers = 0; m_iPlayerPenetrationCount = 0; m_flDamageBonus = 0.0f; diff --git a/extensions/sdktools/gamerulesnatives.cpp b/extensions/sdktools/gamerulesnatives.cpp index 0e5059f6..5eb9fc69 100644 --- a/extensions/sdktools/gamerulesnatives.cpp +++ b/extensions/sdktools/gamerulesnatives.cpp @@ -213,7 +213,7 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params) // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE + || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; @@ -287,7 +287,7 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params) FIND_PROP_SEND(DPT_Int, "integer"); #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_TF2 \ - || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE + || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_PVKII if (pProp->GetFlags() & SPROP_VARINT) { bit_count = sizeof(int) * 8; diff --git a/extensions/sdktools/hooks.cpp b/extensions/sdktools/hooks.cpp index f253406c..7fd35e52 100644 --- a/extensions/sdktools/hooks.cpp +++ b/extensions/sdktools/hooks.cpp @@ -52,7 +52,7 @@ static bool PVD_used = false; SH_DECL_MANUALHOOK2_void(PlayerRunCmdHook, 0, 0, 0, CUserCmd *, IMoveHelper *); SH_DECL_HOOK2(IBaseFileSystem, FileExists, SH_NOATTRIB, 0, bool, const char*, const char *); -#if SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2 +#if (SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2) SH_DECL_HOOK3(INetChannel, SendFile, SH_NOATTRIB, 0, bool, const char *, unsigned int, bool); #else SH_DECL_HOOK2(INetChannel, SendFile, SH_NOATTRIB, 0, bool, const char *, unsigned int); @@ -540,7 +540,7 @@ void CHookManager::ProcessPacket_Post(struct netpacket_s* packet, bool bHasHeade RETURN_META(MRES_IGNORED); } -#if SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2 +#if (SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2) bool CHookManager::SendFile(const char *filename, unsigned int transferID, bool isReplayDemo) #else bool CHookManager::SendFile(const char *filename, unsigned int transferID) @@ -572,7 +572,7 @@ bool CHookManager::SendFile(const char *filename, unsigned int transferID) if (res != Pl_Continue) { /* Mimic the Engine. */ -#if SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2 +#if (SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2) pNetChannel->DenyFile(filename, transferID, isReplayDemo); #else pNetChannel->DenyFile(filename, transferID); diff --git a/extensions/sdktools/hooks.h b/extensions/sdktools/hooks.h index 80334c8c..0f535ef7 100644 --- a/extensions/sdktools/hooks.h +++ b/extensions/sdktools/hooks.h @@ -56,7 +56,7 @@ public: void OnMapStart(); public: /* NetChannel/Related Hooks */ bool FileExists(const char *filename, const char *pathID); -#if SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2 +#if (SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2) bool SendFile(const char *filename, unsigned int transferID, bool isReplayDemo); #else bool SendFile(const char *filename, unsigned int transferID); diff --git a/extensions/sdktools/tempents.cpp b/extensions/sdktools/tempents.cpp index 9e5f19e8..55d2ab89 100644 --- a/extensions/sdktools/tempents.cpp +++ b/extensions/sdktools/tempents.cpp @@ -292,7 +292,8 @@ void TempEntityManager::Initialize() || SOURCE_ENGINE == SE_SDK2013 \ || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_BLADE \ - || SOURCE_ENGINE == SE_NUCLEARDAWN + || SOURCE_ENGINE == SE_NUCLEARDAWN \ + || SOURCE_ENGINE == SE_PVKII if (g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr)) { diff --git a/extensions/sdktools/trnatives.cpp b/extensions/sdktools/trnatives.cpp index 3222a2c6..89296d8e 100644 --- a/extensions/sdktools/trnatives.cpp +++ b/extensions/sdktools/trnatives.cpp @@ -1160,7 +1160,7 @@ static cell_t smn_TRGetPointContents(IPluginContext *pContext, const cell_t *par { mask = enginetrace->GetPointContents(pos); } else { -#if SOURCE_ENGINE >= SE_LEFT4DEAD || SOURCE_ENGINE == SE_BMS +#if (SOURCE_ENGINE >= SE_LEFT4DEAD || SOURCE_ENGINE == SE_BMS) mask = enginetrace->GetPointContents(pos, MASK_ALL, &hentity); #else mask = enginetrace->GetPointContents(pos, &hentity); diff --git a/extensions/sdktools/vcaller.cpp b/extensions/sdktools/vcaller.cpp index 23f9d0e1..30dd26a9 100644 --- a/extensions/sdktools/vcaller.cpp +++ b/extensions/sdktools/vcaller.cpp @@ -151,7 +151,8 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p || SOURCE_ENGINE == SE_BLADE \ || SOURCE_ENGINE == SE_INSURGENCY \ || SOURCE_ENGINE == SE_DOI \ - || SOURCE_ENGINE == SE_CSGO + || SOURCE_ENGINE == SE_CSGO \ + || SOURCE_ENGINE == SE_PVKII s_call_addr = memutils->ResolveSymbol(handle, &sig[1]); #else s_call_addr = dlsym(handle, &sig[1]); diff --git a/extensions/sdktools/vglobals.cpp b/extensions/sdktools/vglobals.cpp index 6d9d2c3f..046fe75c 100644 --- a/extensions/sdktools/vglobals.cpp +++ b/extensions/sdktools/vglobals.cpp @@ -235,7 +235,8 @@ void GetIServer() || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_DOI \ || SOURCE_ENGINE == SE_BLADE \ - || SOURCE_ENGINE == SE_INSURGENCY + || SOURCE_ENGINE == SE_INSURGENCY \ + || SOURCE_ENGINE == SE_PVKII #if SOURCE_ENGINE == SE_SDK2013 if (g_SMAPI->GetEngineFactory(false)("VEngineServer022", nullptr)) diff --git a/extensions/sdktools/vhelpers.cpp b/extensions/sdktools/vhelpers.cpp index 13e35afa..7d5c5545 100644 --- a/extensions/sdktools/vhelpers.cpp +++ b/extensions/sdktools/vhelpers.cpp @@ -711,7 +711,8 @@ CEntityFactoryDictionary *GetEntityFactoryDictionary() || SOURCE_ENGINE == SE_SDK2013 \ || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_BLADE \ - || SOURCE_ENGINE == SE_NUCLEARDAWN + || SOURCE_ENGINE == SE_NUCLEARDAWN \ + || SOURCE_ENGINE == SE_PVKII dict = (CEntityFactoryDictionary *) servertools->GetEntityFactoryDictionary(); #else if (dict == NULL) diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 5e48d07c..53389dee 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -731,7 +731,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params) rf.SetToReliable(true); rf.Initialize(player_list, total_players); #if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII 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); @@ -925,7 +925,8 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_SDK2013 \ || SOURCE_ENGINE == SE_BLADE \ - || SOURCE_ENGINE == SE_NUCLEARDAWN + || SOURCE_ENGINE == SE_NUCLEARDAWN \ + || SOURCE_ENGINE == SE_PVKII static bool bHasServerTools3 = !!g_SMAPI->GetServerFactory(false)("VSERVERTOOLS003", nullptr); if (bHasServerTools3) diff --git a/extensions/sdktools/vsound.cpp b/extensions/sdktools/vsound.cpp index 21a39034..9ba9edb9 100644 --- a/extensions/sdktools/vsound.cpp +++ b/extensions/sdktools/vsound.cpp @@ -41,7 +41,7 @@ SH_DECL_HOOK18(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, 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_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII 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 @@ -327,7 +327,7 @@ int SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChanne const Vector *pDirection, CUtlVector *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) #elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII 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, @@ -453,7 +453,7 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); #elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity) #elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII 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, @@ -617,7 +617,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity) ); #elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \ - || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_PVKII RETURN_META_NEWPARAMS( MRES_IGNORED, static_cast *pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity); -#endif // SOURCE_ENGINE == SE_CSS, SE_HL2DM, SE_DODS, SE_SDK2013, SE_BMS, SE_TF2 +#endif // SOURCE_ENGINE == SE_CSS, SE_HL2DM, SE_DODS, SE_SDK2013, SE_BMS, SE_TF2, SE_PVKII #endif // SOURCE_ENGINE >= SE_PORTAL2 private: size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter); diff --git a/gamedata/core.games/engine.pvkii.txt b/gamedata/core.games/engine.pvkii.txt new file mode 100644 index 00000000..da4ee8ad --- /dev/null +++ b/gamedata/core.games/engine.pvkii.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your SourceMod install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after SM's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod) + */ + +"Games" +{ + /* CGlobalEntityList */ + "#default" + { + "Offsets" + { + /* Offset into LevelShutdown */ + "gEntList" + { + "windows" "11" + "linux" "13" + } + } + + "Signatures" + { + "LevelShutdown" + { + "library" "server" + "windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8" + "linux" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8" + } + "gEntList" + { + "library" "server" + "mac" "@gEntList" + } + } + } + + "#default" + { + "Keys" + { + "UseInvalidUniverseInSteam2IDs" "1" + } + + "Offsets" + { + "EntInfo" + { + "windows" "4" + "linux" "4" + "mac" "4" + } + } + } +} diff --git a/gamedata/core.games/master.games.txt b/gamedata/core.games/master.games.txt index b04a92f2..575cbde8 100644 --- a/gamedata/core.games/master.games.txt +++ b/gamedata/core.games/master.games.txt @@ -95,6 +95,11 @@ "engine" "insurgency" "engine" "doi" // #cheating #yolo } + + "engine.pvkii.txt" + { + "engine" "pvkii" + } "game.dinodday.txt" { diff --git a/gamedata/sdktools.games/engine.pvkii.txt b/gamedata/sdktools.games/engine.pvkii.txt new file mode 100644 index 00000000..29c73df1 --- /dev/null +++ b/gamedata/sdktools.games/engine.pvkii.txt @@ -0,0 +1,119 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your SourceMod install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after SM's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod) + */ + +"Games" +{ + /* General Temp Entities */ + "#default" + { + "Offsets" + { + "GetTEName" + { + "windows" "4" + "linux" "4" + "mac" "4" + } + "GetTENext" + { + "windows" "8" + "linux" "8" + "mac" "8" + } + "TE_GetServerClass" + { + "windows" "0" + "linux" "0" + "mac" "0" + } + } + } + + /* IServer interface pointer */ + "#default" + { + "Keys" + { + /* Signature for the beginning of IVEngineServer::CreateFakeClientEx. + * + * The engine binary is not actually scanned in order to look for + * this. SourceHook is used to used to determine the address of the + * function and this signature is used to verify that it contains + * the expected code. A pointer to sv (IServer interface) is used + * here. + */ + "CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x2A\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8" + } + + "Offsets" + { + /* Offset into IVEngineServer::CreateFakeClient */ + "sv" + { + "windows" "8" + } + } + + "Signatures" + { + /* CBaseServer object for IServer interface */ + "sv" + { + "library" "engine" + "linux" "@sv" + "mac" "@sv" + } + } + } + + /* SetUserInfo data */ + "#default" + { + "Offsets" + { + /** + * CBaseClient::SetUserCVar(char const*,char const*); + * Linux offset straight from VTable dump. + * Windows offset is crazy. Found the windows SetName function using string "(%d)%-0.*s" + * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1) + */ + "SetUserCvar" + { + "windows" "18" + "linux" "58" + "mac" "58" + } + /** + * CBaseClient::SetName(char const*); + * Linux offset straight from VTable dump. + * Has string "(%d)%-0.*s" + */ + "SetClientName" + { + "windows" "17" + "linux" "57" + "mac" "57" + } + /** + * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made. + * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end. + * Linux: mov byte ptr [esi+98h], 0 + * Win: mov byte ptr [esi+0A4h], 0 + */ + "InfoChanged" + { + "windows" "140" + "linux" "140" + "mac" "140" + } + } + } +} diff --git a/gamedata/sdktools.games/game.pvkii.txt b/gamedata/sdktools.games/game.pvkii.txt index 1c4197c9..bbe844e2 100644 --- a/gamedata/sdktools.games/game.pvkii.txt +++ b/gamedata/sdktools.games/game.pvkii.txt @@ -24,7 +24,7 @@ { "library" "server" "windows" "\x55\x8B\xEC\x81\xEC\x04\x04\x00\x00\x53\x8B\xD9" - "linux" "\x55\x66\x0F\xEF\xC9\x89\xE5\x57\x56\x53\x81\xEC\x1C\x04\x00\x00" + "linux" "\xE8\x52\xAE\xC7\xFF\x05\x4B\xA8\x5E\x00\x55\x89\xE5\x57\x56\x53" "mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } } diff --git a/gamedata/sdktools.games/master.games.txt b/gamedata/sdktools.games/master.games.txt index 6f8a0e0f..a3f9ea76 100644 --- a/gamedata/sdktools.games/master.games.txt +++ b/gamedata/sdktools.games/master.games.txt @@ -90,6 +90,11 @@ "engine" "insurgency" "engine" "doi" // #cheating #yolo } + + "engine.pvkii.txt" + { + "engine" "pvkii" + } "game.tf.txt" { diff --git a/loader/loader.cpp b/loader/loader.cpp index 10bf02ca..5a627830 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -86,6 +86,7 @@ #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 +#define FILENAME_1_6_PVKII PLATFORM_ARCH_FOLDER "sourcemod.2.pvkii" PLATFORM_EXT HINSTANCE g_hCore = NULL; bool load_attempted = false; @@ -341,6 +342,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co break; } #endif + case SOURCE_ENGINE_PVKII: + { + filename = FILENAME_1_6_PVKII; + break; + } default: { return NULL; diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index 71052d47..9a17e1e2 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -89,7 +89,8 @@ enum EngineVersion Engine_Insurgency, /**< Insurgency (2013 Retail version)*/ Engine_Contagion, /**< Contagion */ Engine_BlackMesa, /**< Black Mesa Multiplayer */ - Engine_DOI /**< Day of Infamy */ + Engine_DOI, /**< Day of Infamy */ + ENGINE_PVKII /**< Pirates, Vikings, and Knights II */ }; enum FindMapResult diff --git a/public/sample_ext/AMBuildScript b/public/sample_ext/AMBuildScript index 192158c6..59a3be3d 100644 --- a/public/sample_ext/AMBuildScript +++ b/public/sample_ext/AMBuildScript @@ -25,21 +25,22 @@ PossibleSDKs = { 'hl2dm': SDK('HL2SDKHL2DM', '2.hl2dm', '7', 'HL2DM', WinLinuxMac, 'hl2dm'), 'dods': SDK('HL2SDKDODS', '2.dods', '8', 'DODS', WinLinuxMac, 'dods'), 'sdk2013': SDK('HL2SDK2013', '2.sdk2013', '9', 'SDK2013', WinLinuxMac, 'sdk2013'), - 'tf2': SDK('HL2SDKTF2', '2.tf2', '11', 'TF2', WinLinuxMac, 'tf2'), - 'l4d': SDK('HL2SDKL4D', '2.l4d', '12', 'LEFT4DEAD', WinLinuxMac, 'l4d'), - 'nucleardawn': SDK('HL2SDKND', '2.nd', '13', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), - 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '15', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), + 'tf2': SDK('HL2SDKTF2', '2.tf2', '12', 'TF2', WinLinuxMac, 'tf2'), + 'l4d': SDK('HL2SDKL4D', '2.l4d', '13', 'LEFT4DEAD', WinLinuxMac, 'l4d'), + 'nucleardawn': SDK('HL2SDKND', '2.nd', '14', 'NUCLEARDAWN', WinLinuxMac, 'nucleardawn'), + 'l4d2': SDK('HL2SDKL4D2', '2.l4d2', '16', 'LEFT4DEAD2', WinLinuxMac, 'l4d2'), 'darkm': SDK('HL2SDK-DARKM', '2.darkm', '2', 'DARKMESSIAH', WinOnly, 'darkm'), - 'swarm': SDK('HL2SDK-SWARM', '2.swarm', '16', 'ALIENSWARM', WinOnly, 'swarm'), + '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', '21', 'CSGO', WinLinuxMac, 'csgo'), - 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'), - 'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'), - 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'), - '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'), + 'csgo': SDK('HL2SDKCSGO', '2.csgo', '22', 'CSGO', WinLinuxMac, 'csgo'), + 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '18', 'PORTAL2', [], 'portal2'), + 'blade': SDK('HL2SDKBLADE', '2.blade', '19', 'BLADE', WinLinux, 'blade'), + 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '20', 'INSURGENCY', WinLinuxMac, 'insurgency'), + 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '15', 'CONTAGION', WinOnly, 'contagion'), + 'bms': SDK('HL2SDKBMS', '2.bms', '11', 'BMS', WinLinux, 'bms'), + 'doi': SDK('HL2SDKDOI', '2.doi', '21', 'DOI', WinLinuxMac, 'doi'), + 'pvkii': SDK('HL2SDKPVKII', '2.pvkii', '10', 'PVKII', WinLinux, 'pvkii'), } def ResolveEnvPath(env, folder): @@ -328,7 +329,7 @@ class ExtensionConfig(object): compiler.defines += ['SOURCE_ENGINE=' + sdk.code] - if sdk.name in ['sdk2013', 'bms'] and compiler.like('gcc'): + if sdk.name in ['sdk2013', 'bms', 'pvkii'] and compiler.like('gcc'): # The 2013 SDK already has these in public/tier0/basetypes.h compiler.defines.remove('stricmp=strcasecmp') compiler.defines.remove('_stricmp=strcasecmp') @@ -345,7 +346,7 @@ class ExtensionConfig(object): if sdk.name in ['blade', 'insurgency', 'doi', 'csgo']: compiler.defines += ['NETWORK_VARS_ENABLED'] - if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2']: + if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'pvkii']: if builder.target_platform in ['linux', 'mac']: compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE'] @@ -358,7 +359,7 @@ class ExtensionConfig(object): if builder.target_platform == 'linux': if sdk.name == 'episode1': lib_folder = os.path.join(sdk.path, 'linux_sdk') - elif sdk.name in ['sdk2013', 'bms']: + elif sdk.name in ['sdk2013', 'bms', 'pvkii']: lib_folder = os.path.join(sdk.path, 'lib', 'public', 'linux32') else: lib_folder = os.path.join(sdk.path, 'lib', 'linux') @@ -369,7 +370,7 @@ class ExtensionConfig(object): lib_folder = os.path.join(sdk.path, 'lib', 'mac') if builder.target_platform in ['linux', 'mac']: - if sdk.name in ['sdk2013', 'bms']: + if sdk.name in ['sdk2013', 'bms', 'pvkii']: compiler.postlink += [ compiler.Dep(os.path.join(lib_folder, 'tier1.a')), compiler.Dep(os.path.join(lib_folder, 'mathlib.a')) @@ -387,7 +388,7 @@ class ExtensionConfig(object): if builder.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 sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo']: + elif sdk.name in ['l4d', 'blade', 'insurgency', 'doi', 'csgo', 'pvkii']: dynamic_libs = ['libtier0.so', 'libvstdlib.so'] else: dynamic_libs = ['tier0_i486.so', 'vstdlib_i486.so'] diff --git a/public/smsdk_ext.cpp b/public/smsdk_ext.cpp index 529ee6d2..bad4dbb4 100644 --- a/public/smsdk_ext.cpp +++ b/public/smsdk_ext.cpp @@ -341,7 +341,7 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); #else GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); -#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_SDK2013 +#if SOURCE_ENGINE == SE_SDK2013 // Shim to avoid hooking shims engine = (IVEngineServer *) ismm->GetEngineFactory()("VEngineServer023", nullptr); if (!engine) diff --git a/tools/checkout-deps.ps1 b/tools/checkout-deps.ps1 index a339eda0..098acd12 100644 --- a/tools/checkout-deps.ps1 +++ b/tools/checkout-deps.ps1 @@ -28,7 +28,8 @@ param( 'bgt', 'eye', 'contagion', - 'doi' + 'doi', + 'pvkii' ) ) diff --git a/tools/checkout-deps.sh b/tools/checkout-deps.sh index c71ad176..fd18b524 100755 --- a/tools/checkout-deps.sh +++ b/tools/checkout-deps.sh @@ -126,7 +126,7 @@ if [ -z ${sdks+x} ]; then if [ $ismac -eq 0 ]; then # Add these SDKs for Windows or Linux - sdks+=( orangebox blade episode1 bms ) + sdks+=( orangebox blade episode1 bms pvkii ) # Add more SDKs for Windows only if [ $iswin -eq 1 ]; then