From 0bc9aa46e63e03b7e7944a68fec2136682d4f00a Mon Sep 17 00:00:00 2001 From: NotnHeavy <94223272+NotnHeavy@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:30:15 +0000 Subject: [PATCH 01/32] Update checkout-deps files to install hl2sdk-mock (#2102) --- tools/checkout-deps.ps1 | 2 ++ tools/checkout-deps.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tools/checkout-deps.ps1 b/tools/checkout-deps.ps1 index 9e608ab71b..f2d720aa93 100644 --- a/tools/checkout-deps.ps1 +++ b/tools/checkout-deps.ps1 @@ -92,6 +92,8 @@ $SDKS | ForEach-Object { Get-Repository -Name "hl2sdk-$_" -Branch $_ -Repo "hl2sdk-proxy-repo" "https://github.com/alliedmodders/hl2sdk.git" } +Get-Repository -Name "hl2sdk-mock" -Branch "master" -Repo "https://github.com/alliedmodders/hl2sdk-mock.git" + # Find a suitable installation of Python $PYTHON_CMD = Get-Command 'python3' -ErrorAction SilentlyContinue if ($NULL -eq $PYTHON_CMD) diff --git a/tools/checkout-deps.sh b/tools/checkout-deps.sh index 42c30996dc..059bd1776d 100755 --- a/tools/checkout-deps.sh +++ b/tools/checkout-deps.sh @@ -153,6 +153,12 @@ do checkout done +name=hl2sdk-mock +branch=master +repo="https://github.com/alliedmodders/hl2sdk-mock" +origin= +checkout + python_cmd=`command -v python3` if [ -z "$python_cmd" ]; then python_cmd=`command -v python` From 33e869a4e531a3ed193f5baa09c547b2cad01eea Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:30:08 +0100 Subject: [PATCH 02/32] Update gamedata for TF2 x64 (#2105) Co-authored-by: Kenzzer --- gamedata/core.games/engine.ep2valve.txt | 4 +- gamedata/sdkhooks.games/engine.ep2v.txt | 52 ++++++++++----------- gamedata/sdktools.games/engine.ep2valve.txt | 16 +++---- gamedata/sm-tf2.games.txt | 36 +++++++------- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/gamedata/core.games/engine.ep2valve.txt b/gamedata/core.games/engine.ep2valve.txt index 2c92e9a4d5..8f243384d9 100644 --- a/gamedata/core.games/engine.ep2valve.txt +++ b/gamedata/core.games/engine.ep2valve.txt @@ -26,7 +26,7 @@ { "windows" "4" "linux" "4" - "mac" "4" + "linux64" "4" } } @@ -41,7 +41,7 @@ { "library" "server" "linux" "@gEntList" - "mac" "@gEntList" + "linux64" "@gEntList" } } diff --git a/gamedata/sdkhooks.games/engine.ep2v.txt b/gamedata/sdkhooks.games/engine.ep2v.txt index 0a9e4de596..a32101f7b1 100644 --- a/gamedata/sdkhooks.games/engine.ep2v.txt +++ b/gamedata/sdkhooks.games/engine.ep2v.txt @@ -9,157 +9,157 @@ { "windows" "131108" "linux" "131108" - "mac" "131108" + "linux64" "524432" } "CanBeAutobalanced" { "windows" "473" "linux" "474" - "mac" "474" + "linux64" "474" } "EndTouch" { "windows" "105" "linux" "106" - "mac" "106" + "linux64" "106" } "FireBullets" { "windows" "117" "linux" "118" - "mac" "118" + "linux64" "118" } "GetMaxHealth" { "windows" "122" "linux" "123" - "mac" "123" + "linux64" "123" } "GroundEntChanged" { "windows" "183" "linux" "185" - "mac" "185" + "linux64" "185" } "OnTakeDamage" { "windows" "64" "linux" "65" - "mac" "65" + "linux64" "65" } "OnTakeDamage_Alive" { "windows" "282" "linux" "283" - "mac" "283" + "linux64" "283" } "PreThink" { "windows" "343" "linux" "344" - "mac" "344" + "linux64" "344" } "PostThink" { "windows" "344" "linux" "345" - "mac" "345" + "linux64" "345" } "Reload" { "windows" "283" "linux" "289" - "mac" "289" + "linux64" "289" } "SetTransmit" { "windows" "22" "linux" "23" - "mac" "23" + "linux64" "23" } "ShouldCollide" { "windows" "17" "linux" "18" - "mac" "18" + "linux64" "18" } "Spawn" { "windows" "24" "linux" "25" - "mac" "25" + "linux64" "25" } "StartTouch" { "windows" "103" "linux" "104" - "mac" "104" + "linux64" "104" } "Think" { "windows" "49" "linux" "50" - "mac" "50" + "linux64" "50" } "Touch" { "windows" "104" "linux" "105" - "mac" "105" + "linux64" "105" } "TraceAttack" { "windows" "62" "linux" "63" - "mac" "63" + "linux64" "63" } "Use" { "windows" "102" "linux" "103" - "mac" "103" + "linux64" "103" } "VPhysicsUpdate" { "windows" "163" "linux" "164" - "mac" "164" + "linux64" "164" } "Blocked" { "windows" "107" "linux" "108" - "mac" "108" + "linux64" "108" } "Weapon_CanSwitchTo" { "windows" "276" "linux" "277" - "mac" "277" + "linux64" "277" } "Weapon_CanUse" { "windows" "270" "linux" "271" - "mac" "271" + "linux64" "271" } "Weapon_Drop" { "windows" "273" "linux" "274" - "mac" "274" + "linux64" "274" } "Weapon_Equip" { "windows" "271" "linux" "272" - "mac" "272" + "linux64" "272" } "Weapon_Switch" { "windows" "274" "linux" "275" - "mac" "275" + "linux64" "275" } } } diff --git a/gamedata/sdktools.games/engine.ep2valve.txt b/gamedata/sdktools.games/engine.ep2valve.txt index 8f9ad8d777..043f6bfa3e 100644 --- a/gamedata/sdktools.games/engine.ep2valve.txt +++ b/gamedata/sdktools.games/engine.ep2valve.txt @@ -20,19 +20,19 @@ { "windows" "4" "linux" "4" - "mac" "4" + "linux64" "4" } "GetTENext" { "windows" "8" "linux" "8" - "mac" "8" + "linux64" "8" } "TE_GetServerClass" { "windows" "0" "linux" "0" - "mac" "0" + "linux64" "0" } } } @@ -69,7 +69,7 @@ { "library" "engine" "linux" "@sv" - "mac" "@sv" + "linux64" "@sv" } } } @@ -90,7 +90,7 @@ "library" "server" "windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\xC1" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" - "mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" + "linux64" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } } } @@ -117,7 +117,7 @@ { "windows" "18" "linux" "58" - "mac" "58" + "linux64" "58" } /** * CBaseClient::SetName(char const*); @@ -128,7 +128,7 @@ { "windows" "17" "linux" "57" - "mac" "57" + "linux64" "57" } /** * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made. @@ -140,7 +140,7 @@ { "windows" "140" "linux" "140" - "mac" "140" + "linux64" "160" } } } diff --git a/gamedata/sm-tf2.games.txt b/gamedata/sm-tf2.games.txt index 695e3b05a3..ed0ecb1c1a 100644 --- a/gamedata/sm-tf2.games.txt +++ b/gamedata/sm-tf2.games.txt @@ -20,84 +20,84 @@ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x8E\x8C\x01\x00\x00\x8B\x01" "linux" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBasef" - "mac" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBasef" + "linux64" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBasef" } "RemoveDisguise" { "library" "server" "windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\x57\xF7\x86\xD0\x00\x00\x00\x00\x00\x02\x00" "linux" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" - "mac" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" + "linux64" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" } "Disguise" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x24\x56\x57\x8B\xF9\x8B\x8F\x8C\x01\x00\x00" "linux" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb" - "mac" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb" + "linux64" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb" } "Regenerate" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x24\x53\x56\x57\x8B\xF9\x8B\x07\xFF\x90" "linux" "@_ZN9CTFPlayer10RegenerateEb" - "mac" "@_ZN9CTFPlayer10RegenerateEb" + "linux64" "@_ZN9CTFPlayer10RegenerateEb" } "AddCondition" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x85\xC9\x0F\x84\x2A\x2A\x2A\x2A\x8B\x01\x8B" "linux" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity" - "mac" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity" + "linux64" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity" } "RemoveCondition" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x53\x8B\x5D\x08\x56\x53" "linux" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb" - "mac" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb" + "linux64" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb" } "SetPowerplayEnabled" { "library" "server" "windows" "\x55\x8B\xEC\x80\x7D\x08\x00\x56\x57\x8B\xF9" "linux" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" - "mac" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" + "linux64" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" } "SetInWaitingForPlayers" { "library" "server" "windows" "\x55\x8B\xEC\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A" "linux" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" - "mac" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" + "linux64" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" } "StunPlayer" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x20\x57\x8B\xF9\x8B\x87\xDC\x04\x00\x00" "linux" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" - "mac" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" + "linux64" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" } "MakeBleed" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x2C\x57\x8B\xF9\x89\x7D\xF0" "linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" - "mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" + "linux64" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" } "IsPlayerInDuel" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x81\x65\x2A\x2A\x2A\x2A\x2A\x8D\x45\xF8\x8B\x4D\x08\xC6\x45\xFF\x00\x81\x65\x2A\x2A\x2A\x2A\x2A\x50\xC7\x45\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0\x75\x04" "linux" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer" - "mac" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer" + "linux64" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer" } "CanPlayerTeleport" { "library" "server" "windows" "\x55\x8B\xEC\x53\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x75\x2A\x5F\x32\xC0\x5B\x5D\xC2\x04\x00" "linux" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" - "mac" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" + "linux64" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" } // Obsolete @@ -106,7 +106,7 @@ "library" "server" "windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x83\x78\x30\x00\x74\x04\x32\xC0" "linux" "@_Z18TF_IsHolidayActivei" - "mac" "@_Z18TF_IsHolidayActivei" + "linux64" "@_Z18TF_IsHolidayActivei" } } "Offsets" @@ -115,19 +115,19 @@ { "windows" "336" "linux" "337" - "mac" "337" + "linux64" "337" } "CalcIsAttackCriticalHelper" { "windows" "398" "linux" "405" - "mac" "405" + "linux64" "405" } "CalcIsAttackCriticalHelperNoCrits" { "windows" "399" "linux" "406" - "mac" "406" + "linux64" "406" } // CTFGameRules::IsHolidayActive @@ -135,14 +135,14 @@ { "windows" "139" "linux" "140" - "mac" "140" + "linux64" "140" } "RemoveWearable" { "windows" "439" "linux" "440" - "mac" "440" + "linux64" "440" } } } From e7e92d4e40cee9a2b5efbef56ea1fdbe4d37d60d Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Fri, 26 Jan 2024 22:18:14 +0100 Subject: [PATCH 03/32] update manifests (#2106) Co-authored-by: Kenzzer --- hl2sdk-manifests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl2sdk-manifests b/hl2sdk-manifests index fb0d3ed7ba..22f699a941 160000 --- a/hl2sdk-manifests +++ b/hl2sdk-manifests @@ -1 +1 @@ -Subproject commit fb0d3ed7ba27fb27abd4a44c058f5c3c2c33be15 +Subproject commit 22f699a941093d9d68c1f647c7c545ec346d0ee3 From b5b9b8388c9195781037e16ed2c7af5bfc2234c8 Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Mon, 29 Jan 2024 02:08:33 +0100 Subject: [PATCH 04/32] Fixup entinfo offset + sdktools tf2 x64 gamedata (#2108) * fixup entinfo offset * added missing tf gamedata --------- Co-authored-by: Kenzzer --- gamedata/core.games/engine.ep2valve.txt | 2 +- gamedata/sdktools.games/game.tf.txt | 38 ++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gamedata/core.games/engine.ep2valve.txt b/gamedata/core.games/engine.ep2valve.txt index 8f243384d9..c69fb1e7bd 100644 --- a/gamedata/core.games/engine.ep2valve.txt +++ b/gamedata/core.games/engine.ep2valve.txt @@ -26,7 +26,7 @@ { "windows" "4" "linux" "4" - "linux64" "4" + "linux64" "8" } } diff --git a/gamedata/sdktools.games/game.tf.txt b/gamedata/sdktools.games/game.tf.txt index 9cb2a7c476..74c49cb5f7 100644 --- a/gamedata/sdktools.games/game.tf.txt +++ b/gamedata/sdktools.games/game.tf.txt @@ -20,103 +20,103 @@ { "windows" "18" "linux" "19" - "mac" "19" + "linux64" "19" } "GiveNamedItem" { "windows" "412" "linux" "413" - "mac" "413" + "linux64" "413" } "RemovePlayerItem" { "windows" "280" "linux" "281" - "mac" "281" + "linux64" "281" } "Weapon_GetSlot" { "windows" "278" "linux" "279" - "mac" "279" + "linux64" "279" } "Ignite" { "windows" "219" "linux" "220" - "mac" "220" + "linux64" "220" } "Extinguish" { "windows" "223" "linux" "224" - "mac" "224" + "linux64" "224" } "Teleport" { "windows" "113" "linux" "114" - "mac" "114" + "linux64" "114" } "CommitSuicide" { "windows" "453" "linux" "453" - "mac" "453" + "linux64" "453" } "GetVelocity" { "windows" "146" "linux" "147" - "mac" "147" + "linux64" "147" } "EyeAngles" { "windows" "137" "linux" "138" - "mac" "138" + "linux64" "138" } "SetEntityModel" { "windows" "26" "linux" "27" - "mac" "27" + "linux64" "27" } "AcceptInput" { "windows" "38" "linux" "39" - "mac" "39" + "linux64" "39" } "WeaponEquip" { "windows" "271" "linux" "272" - "mac" "272" + "linux64" "272" } "Activate" { "windows" "35" "linux" "36" - "mac" "36" + "linux64" "36" } "PlayerRunCmd" { "windows" "430" "linux" "431" - "mac" "431" + "linux64" "431" } "GiveAmmo" { "windows" "262" "linux" "263" - "mac" "263" + "linux64" "263" } "GetAttachment" { "windows" "215" "linux" "216" - "mac" "216" + "linux64" "216" } } @@ -137,7 +137,7 @@ "library" "server" "windows" "\x55\x8B\xEC\x81\xEC\x24\x01\x00\x00\x53\x8B\xC1" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" - "mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" + "linux64" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } } } @@ -152,7 +152,7 @@ "library" "server" "windows" "\x55\x8B\xEC\x56\x8B\xF1\x80\xBE\x2A\x03\x00\x00\x00\x75\x2A\x83\xBE\x2A\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x2A\x04\x00\x00\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x40" "linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" - "mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" + "linux64" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" } } } From 7bb9da2a26fd7df81e52dcca64c6df9ba1d10a23 Mon Sep 17 00:00:00 2001 From: Ryan Blackham <40574343+RyanBlackham@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:36:28 +0000 Subject: [PATCH 05/32] Fixed typo in reservedslots.sp (#2109) --- plugins/reservedslots.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/reservedslots.sp b/plugins/reservedslots.sp index 077c45adb7..fb43fdd19f 100644 --- a/plugins/reservedslots.sp +++ b/plugins/reservedslots.sp @@ -82,7 +82,7 @@ public void OnPluginStart() LoadTranslations("reservedslots.phrases"); sm_reserved_slots = CreateConVar("sm_reserved_slots", "0", "Number of reserved player slots", 0, true, 0.0); - sm_hide_slots = CreateConVar("sm_hide_slots", "0", "If set to 1, reserved slots will hidden (subtracted from the max slot count)", 0, true, 0.0, true, 1.0); + sm_hide_slots = CreateConVar("sm_hide_slots", "0", "If set to 1, reserved slots will be hidden (subtracted from the max slot count)", 0, true, 0.0, true, 1.0); sm_reserve_type = CreateConVar("sm_reserve_type", "0", "Method of reserving slots", 0, true, 0.0, true, 2.0); sm_reserve_maxadmins = CreateConVar("sm_reserve_maxadmins", "1", "Maximum amount of admins to let in the server with reserve type 2", 0, true, 0.0); sm_reserve_kicktype = CreateConVar("sm_reserve_kicktype", "0", "How to select a client to kick (if appropriate)", 0, true, 0.0, true, 2.0); From 35ac74c7a7243e17a3aa2338b116eaa8a0a9ccdc Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:10:42 +0100 Subject: [PATCH 06/32] Update gamedata for l4d2 (#2111) * update gamedata for l4d2 * undo findentitybyclassname sig change * update gEntList offset accordingly --------- Co-authored-by: Kenzzer --- gamedata/core.games/engine.l4d2.txt | 8 ++++---- gamedata/sdktools.games/engine.l4d2.txt | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gamedata/core.games/engine.l4d2.txt b/gamedata/core.games/engine.l4d2.txt index 59579a3f3b..8f2a1d3919 100644 --- a/gamedata/core.games/engine.l4d2.txt +++ b/gamedata/core.games/engine.l4d2.txt @@ -25,14 +25,14 @@ /* Offset into LevelShutdown */ "gEntList" { - "windows" "11" + "windows" "40" } "EntInfo" { "windows" "4" "linux" "4" - "mac" "4" + "mac" "4" } } @@ -41,13 +41,13 @@ "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" + "windows" "\x56\x8B\x35\x2A\x2A\x2A\x2A\x8B\x06\x8B\x50\x68\x8B\xCE\xFF\xD2\x68\x2A\x2A\x2A\x2A" } "gEntList" { "library" "server" "linux" "@gEntList" - "mac" "@gEntList" + "mac" "@gEntList" } } } diff --git a/gamedata/sdktools.games/engine.l4d2.txt b/gamedata/sdktools.games/engine.l4d2.txt index d3a28af8d4..5db7896893 100644 --- a/gamedata/sdktools.games/engine.l4d2.txt +++ b/gamedata/sdktools.games/engine.l4d2.txt @@ -81,9 +81,9 @@ */ "InfoChanged" { - "windows" "176" - "linux" "176" - "mac" "176" + "windows" "180" + "linux" "180" + "mac" "180" } } } From 638aae0040e2f35f016bb8f120d804448e0dacf5 Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Thu, 8 Feb 2024 01:02:01 +0100 Subject: [PATCH 07/32] Fix sdktools gamedata (#2113) Co-authored-by: Kenzzer --- gamedata/sdktools.games/engine.ep2valve.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamedata/sdktools.games/engine.ep2valve.txt b/gamedata/sdktools.games/engine.ep2valve.txt index 043f6bfa3e..f9b93eed5c 100644 --- a/gamedata/sdktools.games/engine.ep2valve.txt +++ b/gamedata/sdktools.games/engine.ep2valve.txt @@ -20,13 +20,13 @@ { "windows" "4" "linux" "4" - "linux64" "4" + "linux64" "8" } "GetTENext" { "windows" "8" "linux" "8" - "linux64" "8" + "linux64" "16" } "TE_GetServerClass" { From a80b9c5c0f5a7afeeac85880e0392b49e108f60c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:01:26 +0100 Subject: [PATCH 08/32] Bump actions/cache from 3 to 4 (#2103) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61598b0ce7..0edb697bb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: path: sourcemod - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: hl2sdk-mysql-mmsource with: From e262064fd89f69216e317168a9f46bc99750d481 Mon Sep 17 00:00:00 2001 From: Mart Date: Wed, 14 Feb 2024 20:22:26 -0300 Subject: [PATCH 09/32] Update game.nucleardawn.txt (#2116) add missing GetAttachment offset for ND --- gamedata/sdktools.games/game.nucleardawn.txt | 32 ++++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/gamedata/sdktools.games/game.nucleardawn.txt b/gamedata/sdktools.games/game.nucleardawn.txt index 719b14015e..8d5f5e8da4 100644 --- a/gamedata/sdktools.games/game.nucleardawn.txt +++ b/gamedata/sdktools.games/game.nucleardawn.txt @@ -102,19 +102,19 @@ } /* CBaseAnimating::LookupAttachment */ - "#default" - { - "Signatures" - { - "LookupAttachment" - { - "library" "server" - "windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\x2A\x2A\x2A\x2A\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x2A\x2A\x2A\x2A\x5E\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75" - "linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" - "mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" - } - } - } + "#default" + { + "Signatures" + { + "LookupAttachment" + { + "library" "server" + "windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\x2A\x2A\x2A\x2A\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x2A\x2A\x2A\x2A\x5E\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75" + "linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" + "mac" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" + } + } + } /* SetUserInfo data */ "#default" @@ -250,6 +250,12 @@ "linux" "467" "mac" "467" } + "GetAttachment" + { + "windows" "230" + "linux" "231" + "mac" "231" + } } "Keys" From 06dcb991e823e013b0b4708f782396a4dfbde4b3 Mon Sep 17 00:00:00 2001 From: Peak <48360696+PeakKS@users.noreply.github.com> Date: Sun, 18 Feb 2024 05:46:48 -0500 Subject: [PATCH 10/32] Allow topmenu config file to sort with subcategories (#1757) --- extensions/topmenus/TopMenu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/topmenus/TopMenu.cpp b/extensions/topmenus/TopMenu.cpp index 28a173913e..db5ead6f23 100644 --- a/extensions/topmenus/TopMenu.cpp +++ b/extensions/topmenus/TopMenu.cpp @@ -1179,6 +1179,11 @@ SMCResult TopMenu::ReadSMC_NewSection(const SMCStates *states, const char *name) } } } + else if (current_parse_state == PARSE_STATE_CATEGORY) + { + cur_cat->commands.push_back(m_Config.strings.AddString(name)); + ignore_parse_level++; + } else { ignore_parse_level = 1; From 8dcbe14ea0bb562d04a8fde57a7b3d4759ddaefa Mon Sep 17 00:00:00 2001 From: CookieCat <81494827+CookieCat45@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:14:00 -0500 Subject: [PATCH 11/32] Throw an error when attempting to remove worldspawn in RemoveEntity/RemoveEdict (#2104) * Check for worldspawn in RemoveEntity and RemoveEdict * A little more info --- core/smn_entities.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index 139da9cc1d..d2986ca437 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -285,6 +285,11 @@ static cell_t RemoveEdict(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("Edict %d (%d) is not a valid edict", g_HL2.ReferenceToIndex(params[1]), params[1]); } + if (g_HL2.ReferenceToIndex(params[1]) == 0) + { + return pContext->ThrowNativeError("Cannot remove worldspawn (edict 0)"); + } + engine->RemoveEdict(pEdict); return 1; @@ -298,6 +303,11 @@ static cell_t RemoveEntity(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("Entity %d (%d) is not a valid entity", g_HL2.ReferenceToIndex(params[1]), params[1]); } + if (g_HL2.ReferenceToIndex(params[1]) == 0) + { + return pContext->ThrowNativeError("Cannot remove worldspawn (entity 0)"); + } + // Some games have UTIL_Remove exposed on IServerTools, but for consistence, we'll // use this method for all. Results in DeathNotice( this ) being called on parent, // and parent being cleared (both if any parent) before UTIL_Remove is called. From 4e8b66bf998cc1b0d40afd49a14856fde6a2e773 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Tue, 5 Mar 2024 02:20:40 +0100 Subject: [PATCH 12/32] fix: sorted alphabetically, remove duplicate 'ko' (#2121) * fix: sorted alphabetically, remove duplicate 'ko' * 'KoreanA' is a valid value --- configs/languages.cfg | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/configs/languages.cfg b/configs/languages.cfg index ed21be9732..d4d39073f7 100644 --- a/configs/languages.cfg +++ b/configs/languages.cfg @@ -1,37 +1,38 @@ "Languages" { - "en" "English" // English "ar" "Arabic" // Arabic - "pt" "Brazilian" // Brazilian Portuguese "bg" "Bulgarian" // Bulgarian - "cze" "Czech" // Czech + "chi" "SChinese" // Chinese (Simplified) + "cze" "Czech" // Czech "da" "Danish" // Danish - "nl" "Dutch" // Dutch + "de" "German" // German + "el" "Greek" // Greek + "en" "English" // English + "es" "Spanish" // Spanish "fi" "Finnish" // Finnish "fr" "French" // French - "de" "German" // German - "el" "Greek" // Greek "he" "Hebrew" // Hebrew "hu" "Hungarian" // Hungarian "it" "Italian" // Italian "jp" "Japanese" // Japanese - "ko" "KoreanA" // Korean "ko" "Korean" // Korean - "las" "LatAm" // Latin American Spanish - "lv" "Latvian" // Latvian + "ko" "KoreanA" // Korean (https://bugs.alliedmods.net/show_bug.cgi?id=4667) + "las" "LatAm" // Latin American Spanish "lt" "Lithuanian" // Lithuanian + "lv" "Latvian" // Latvian + "nl" "Dutch" // Dutch "no" "Norwegian" // Norwegian "pl" "Polish" // Polish + "pt" "Brazilian" // Brazilian Portuguese "pt_p" "Portuguese" // Portuguese "ro" "Romanian" // Romanian "ru" "Russian" // Russian - "chi" "SChinese" // Chinese (Simplified) "sk" "Slovak" // Slovak - "es" "Spanish" // Spanish "sv" "Swedish" // Swedish - "zho" "TChinese" // Chinese (Traditional) - "th" "Thai" // Thai + "th" "Thai" // Thai "tr" "Turkish" // Turkish "ua" "Ukrainian" // Ukrainian "vi" "Vietnamese" // Vietnamese + "zho" "TChinese" // Chinese (Traditional) + } From dbec0b165c7ed70acdbb03b3b471de8a25f3ec2b Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 21 Mar 2024 00:11:59 +0000 Subject: [PATCH 13/32] Neotokyo: Add "SetOwnerEntity" gamedata (#2126) This adds game support for `SetOwnerEntity`, `SetEntityCollisionGroup`. --- gamedata/sdktools.games/game.neotokyo.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamedata/sdktools.games/game.neotokyo.txt b/gamedata/sdktools.games/game.neotokyo.txt index 947975e4c5..cdab578b01 100644 --- a/gamedata/sdktools.games/game.neotokyo.txt +++ b/gamedata/sdktools.games/game.neotokyo.txt @@ -76,6 +76,10 @@ { "windows" "185" } + "SetOwnerEntity" + { + "windows" "18" + } } "Signatures" { From 5c507cc35c84b5211ee695eb186e31d2ba0dc8f3 Mon Sep 17 00:00:00 2001 From: Peak <48360696+PeakKS@users.noreply.github.com> Date: Sat, 13 Apr 2024 14:14:52 -0400 Subject: [PATCH 14/32] Implement File.Size (#2131) * Implement file size method for already open files * Switch from fseek/ftell to fileno/fstat size reading --- bridge/include/IFileSystemBridge.h | 1 + core/logic/smn_filesystem.cpp | 39 ++++++++++++++++++++++++++++++ core/logic_bridge.cpp | 4 +++ plugins/include/files.inc | 5 ++++ 4 files changed, 49 insertions(+) diff --git a/bridge/include/IFileSystemBridge.h b/bridge/include/IFileSystemBridge.h index 73fdec8d60..4c62506f76 100644 --- a/bridge/include/IFileSystemBridge.h +++ b/bridge/include/IFileSystemBridge.h @@ -44,6 +44,7 @@ class IFileSystemBridge virtual char *ReadLine(char *pOutput, int maxChars, FileHandle_t file) = 0; virtual bool EndOfFile(FileHandle_t file) = 0; virtual bool FileExists(const char *pFileName, const char *pPathID = 0) = 0; + virtual unsigned int Size(FileHandle_t file) = 0; virtual unsigned int Size(const char *pFileName, const char *pPathID = 0) = 0; virtual int Read(void* pOutput, int size, FileHandle_t file) = 0; virtual int Write(void const* pInput, int size, FileHandle_t file) = 0; diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index 032f951e60..3d9b302d62 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -73,6 +73,7 @@ class FileObject public: virtual ~FileObject() {} + virtual size_t Size() = 0; virtual size_t Read(void *pOut, int size) = 0; virtual char *ReadLine(char *pOut, int size) = 0; virtual size_t Write(const void *pData, int size) = 0; @@ -119,6 +120,10 @@ class ValveFile : public FileObject return true; } + size_t Size() override { + return (size_t)bridge->filesystem->Size(handle_); + } + size_t Read(void *pOut, int size) override { return (size_t)bridge->filesystem->Read(pOut, size, handle_); } @@ -183,6 +188,30 @@ class SystemFile : public FileObject return unlink(path) == 0; } + size_t Size() override { +#ifdef PLATFORM_WINDOWS + struct _stat s; + int fd = _fileno(fp_); + if (fd == -1) + return -1; + if (_fstat(fd, &s) != 0) + return -1; + if (s.st_mode & S_IFREG) + return static_cast(s.st_size); + return -1; +#elif defined PLATFORM_POSIX + struct stat s; + int fd = fileno(fp_); + if (fd == -1) + return -1; + if (fstat(fd, &s) != 0) + return -1; + if (S_ISREG(s.st_mode)) + return static_cast(s.st_size); + return -1; +#endif + } + size_t Read(void *pOut, int size) override { return fread(pOut, 1, size, fp_); } @@ -1125,6 +1154,15 @@ static cell_t sm_RemoveGameLogHook(IPluginContext *pContext, const cell_t *param return 1; } +static cell_t File_Size(IPluginContext *pContext, const cell_t *params) +{ + OpenHandle file(pContext, params[1], g_FileType); + if (!file.Ok()) + return -1; + + return file->Size(); +} + template static cell_t File_ReadTyped(IPluginContext *pContext, const cell_t *params) { @@ -1197,6 +1235,7 @@ REGISTER_NATIVES(filesystem) {"File.Seek", sm_FileSeek}, {"File.Flush", sm_FlushFile}, {"File.Position.get", sm_FilePosition}, + {"File.Size", File_Size}, {"File.ReadInt8", File_ReadTyped}, {"File.ReadUint8", File_ReadTyped}, {"File.ReadInt16", File_ReadTyped}, diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index a718c32345..4cc1128a78 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -138,6 +138,10 @@ class VFileSystem_Logic : public IFileSystemBridge { return filesystem->FileExists(pFileName, pPathID); } + unsigned int Size(FileHandle_t file) override + { + return filesystem->Size(file); + } unsigned int Size(const char *pFileName, const char *pPathID = 0) override { return filesystem->Size(pFileName, pPathID); diff --git a/plugins/include/files.inc b/plugins/include/files.inc index 1d8fd3b309..78efd65cc2 100644 --- a/plugins/include/files.inc +++ b/plugins/include/files.inc @@ -112,6 +112,11 @@ methodmap File < Handle CloseHandle(this); } + // Get the file size in bytes. + // + // @return File size in bytes, -1 on error. + public native int Size(); + // Reads a line of text from a file. // // @param buffer String buffer to hold the line. From 6cac489fce5ef2b3400fd92d3781aac21331d4e7 Mon Sep 17 00:00:00 2001 From: ojlanders <143576142+ojlanders@users.noreply.github.com> Date: Thu, 18 Apr 2024 07:42:37 -0400 Subject: [PATCH 15/32] Prevent recursion in sm_ServerCommandEx (fixes #967) (#2133) * Prevent recursion in sm_ServerCommandEx (fixes #967) * Update core/smn_console.cpp to fix style Co-authored-by: Erin --------- Co-authored-by: Odin Landers Co-authored-by: Erin --- core/smn_console.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index dc03668412..29b830a865 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -979,11 +979,14 @@ static cell_t sm_ServerCommandEx(IPluginContext *pContext, const cell_t *params) } engine->ServerExecute(); - - g_ShouldCatchSpew = true; - engine->ServerCommand("sm_conhook_start\n"); - engine->ServerCommand(buffer); - engine->ServerCommand("sm_conhook_stop\n"); + if (!g_ShouldCatchSpew) { + g_ShouldCatchSpew = true; + engine->ServerCommand("sm_conhook_start\n"); + engine->ServerCommand(buffer); + engine->ServerCommand("sm_conhook_stop\n"); + } else { + engine->ServerCommand(buffer); + } engine->ServerExecute(); From d426d1f04f336db433ec873000817ebbba391be1 Mon Sep 17 00:00:00 2001 From: CookieCat <81494827+CookieCat45@users.noreply.github.com> Date: Fri, 19 Apr 2024 21:00:30 -0400 Subject: [PATCH 16/32] x32 Windows Gamedata Fixes for 4/18/2024 TF2 Update (#2137) * sm-tf2-games * FireOutput --- gamedata/sdktools.games/game.tf.txt | 2 +- gamedata/sm-tf2.games.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gamedata/sdktools.games/game.tf.txt b/gamedata/sdktools.games/game.tf.txt index 74c49cb5f7..fc896b6fa5 100644 --- a/gamedata/sdktools.games/game.tf.txt +++ b/gamedata/sdktools.games/game.tf.txt @@ -135,7 +135,7 @@ "FireOutput" { "library" "server" - "windows" "\x55\x8B\xEC\x81\xEC\x24\x01\x00\x00\x53\x8B\xC1" + "windows" "\x55\x8B\xEC\x81\xEC\x40\x01\x00\x00\x8B\xC1" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" "linux64" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } diff --git a/gamedata/sm-tf2.games.txt b/gamedata/sm-tf2.games.txt index ed0ecb1c1a..903e28410f 100644 --- a/gamedata/sm-tf2.games.txt +++ b/gamedata/sm-tf2.games.txt @@ -39,7 +39,7 @@ "Regenerate" { "library" "server" - "windows" "\x55\x8B\xEC\x83\xEC\x24\x53\x56\x57\x8B\xF9\x8B\x07\xFF\x90" + "windows" "\x55\x8B\xEC\x83\xEC\x5C\x53\x56\x57\x8B\xF9\x8B\x07" "linux" "@_ZN9CTFPlayer10RegenerateEb" "linux64" "@_ZN9CTFPlayer10RegenerateEb" } @@ -60,28 +60,28 @@ "SetPowerplayEnabled" { "library" "server" - "windows" "\x55\x8B\xEC\x80\x7D\x08\x00\x56\x57\x8B\xF9" + "windows" "\x55\x8B\xEC\x51\x80\x7D\x08\x00\x56\x57" "linux" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" "linux64" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" } "SetInWaitingForPlayers" { "library" "server" - "windows" "\x55\x8B\xEC\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A" + "windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A" "linux" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" "linux64" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" } "StunPlayer" { "library" "server" - "windows" "\x55\x8B\xEC\x83\xEC\x20\x57\x8B\xF9\x8B\x87\xDC\x04\x00\x00" + "windows" "\x55\x8B\xEC\x83\xEC\x24\x57\x8B\xF9\x8B\x87\xDC\x04\x00\x00" "linux" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" "linux64" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" } "MakeBleed" { "library" "server" - "windows" "\x55\x8B\xEC\x83\xEC\x2C\x57\x8B\xF9\x89\x7D\xF0" + "windows" "\x55\x8B\xEC\x83\xEC\x10\x53\x8B\xD9\x89\x5D\xF8\x8B\x8B\x8C\x01\x00\x00" "linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" "linux64" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" } @@ -95,7 +95,7 @@ "CanPlayerTeleport" { "library" "server" - "windows" "\x55\x8B\xEC\x53\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x75\x2A\x5F\x32\xC0\x5B\x5D\xC2\x04\x00" + "windows" "\x55\x8B\xEC\x53\x56\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x0F\x84\x2A\x2A\x2A\x2A" "linux" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" "linux64" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" } From af93d819c62a930cf3ed2061355b422c5ce4e7c3 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares <36161392+adriansmares@users.noreply.github.com> Date: Sat, 20 Apr 2024 03:56:48 +0200 Subject: [PATCH 17/32] Handle `INVALID_FUNCTION` mismatches at plugin boundaries, redux (#2136) --- core/logic/smn_datapacks.cpp | 21 +++++++++++++++++++-- core/logic/smn_fakenatives.cpp | 29 ++++++++++++++++++++++++++++- core/logic/smn_functions.cpp | 30 +++++++++++++++++++++--------- 3 files changed, 68 insertions(+), 12 deletions(-) diff --git a/core/logic/smn_datapacks.cpp b/core/logic/smn_datapacks.cpp index 3276c30086..9cf2a4a323 100644 --- a/core/logic/smn_datapacks.cpp +++ b/core/logic/smn_datapacks.cpp @@ -244,7 +244,19 @@ static cell_t smn_WritePackFunction(IPluginContext *pContext, const cell_t *para pDataPack->RemoveItem(); } - pDataPack->PackFunction(params[2]); + cell_t funcid = params[2]; + if (pContext->IsNullFunctionId(funcid)) + { + pDataPack->PackFunction(0); + } + else if (funcid <= 0) + { + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); + } + else + { + pDataPack->PackFunction(funcid); + } return 1; } @@ -365,7 +377,12 @@ static cell_t smn_ReadPackFunction(IPluginContext *pContext, const cell_t *param return pContext->ThrowNativeError("Invalid data pack type (got %d / expected %d).", pDataPack->GetCurrentType(), CDataPackType::Function); } - return pDataPack->ReadFunction(); + cell_t funcid = pDataPack->ReadFunction(); + if (!funcid) + { + return pContext->GetNullFunctionValue(); + } + return funcid; } static cell_t smn_ReadPackCellArray(IPluginContext *pContext, const cell_t *params) diff --git a/core/logic/smn_fakenatives.cpp b/core/logic/smn_fakenatives.cpp index cbbca65e86..e68e527a6d 100644 --- a/core/logic/smn_fakenatives.cpp +++ b/core/logic/smn_fakenatives.cpp @@ -366,6 +366,33 @@ static cell_t SetNativeArray(IPluginContext *pContext, const cell_t *params) return SP_ERROR_NONE; } +static cell_t GetNativeFunction(IPluginContext *pContext, const cell_t *params) +{ + if (!s_curnative || (s_curnative->ctx != pContext)) + { + return pContext->ThrowNativeError("Not called from inside a native function"); + } + + cell_t param = params[1]; + if (param < 1 || param > s_curparams[0]) + { + return pContext->ThrowNativeErrorEx(SP_ERROR_PARAM, "Invalid parameter number: %d", param); + } + + cell_t funcid = s_curparams[param]; + if (s_curcaller->IsNullFunctionId(funcid)) + { + // see alliedmodders/sourcepawn#912, alliedmodders/sourcemod#2068 + // convert null function to receiver's expected value so equality checks against INVALID_FUNCTION pass + return pContext->GetNullFunctionValue(); + } + else if (funcid <= 0) + { + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); + } + return funcid; +} + static cell_t FormatNativeString(IPluginContext *pContext, const cell_t *params) { if (!s_curnative || (s_curnative->ctx != pContext)) @@ -483,7 +510,7 @@ REGISTER_NATIVES(nativeNatives) {"GetNativeArray", GetNativeArray}, {"GetNativeCell", GetNativeCell}, {"GetNativeCellRef", GetNativeCellRef}, - {"GetNativeFunction", GetNativeCell}, + {"GetNativeFunction", GetNativeFunction}, {"GetNativeString", GetNativeString}, {"GetNativeStringLength", GetNativeStringLength}, {"FormatNativeString", FormatNativeString}, diff --git a/core/logic/smn_functions.cpp b/core/logic/smn_functions.cpp index ea1acaba78..41349f96ee 100644 --- a/core/logic/smn_functions.cpp +++ b/core/logic/smn_functions.cpp @@ -228,11 +228,15 @@ static cell_t sm_AddToForward(IPluginContext *pContext, const cell_t *params) } } - IPluginFunction *pFunction = pPlugin->GetBaseContext()->GetFunctionById(params[3]); - + cell_t funcid = params[3]; + if (funcid <= 0) + { + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); + } + IPluginFunction *pFunction = pPlugin->GetBaseContext()->GetFunctionById(funcid); if (!pFunction) { - return pContext->ThrowNativeError("Invalid function id (%X)", params[3]); + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); } return pForward->AddFunction(pFunction); @@ -265,11 +269,15 @@ static cell_t sm_RemoveFromForward(IPluginContext *pContext, const cell_t *param } } - IPluginFunction *pFunction = pPlugin->GetBaseContext()->GetFunctionById(params[3]); - + cell_t funcid = params[3]; + if (funcid <= 0) + { + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); + } + IPluginFunction *pFunction = pPlugin->GetBaseContext()->GetFunctionById(funcid); if (!pFunction) { - return pContext->ThrowNativeError("Invalid function id (%X)", params[3]); + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); } return pForward->RemoveFunction(pFunction); @@ -327,11 +335,15 @@ static cell_t sm_CallStartFunction(IPluginContext *pContext, const cell_t *param } } - s_pFunction = pPlugin->GetBaseContext()->GetFunctionById(params[2]); - + cell_t funcid = params[2]; + if (funcid <= 0) + { + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); + } + s_pFunction = pPlugin->GetBaseContext()->GetFunctionById(funcid); if (!s_pFunction) { - return pContext->ThrowNativeError("Invalid function id (%X)", params[2]); + return pContext->ThrowNativeError("Invalid function id (%X)", funcid); } s_pCallable = static_cast(s_pFunction); From ee51162c3fa7affaddd54a5f242e514d6f7c94ef Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Sat, 20 Apr 2024 14:04:26 -0400 Subject: [PATCH 18/32] Trigger build for hl2sdk-tf2 changes https://github.com/alliedmodders/hl2sdk/issues/231 --- pushbuild.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pushbuild.txt b/pushbuild.txt index 5f22b0b1e6..cc9c95828d 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -69,6 +69,7 @@ Beads. snakesssssssss; maple R.I.P. Wade Boggs Your tier1 tower is under attack.. +Your mathlib tower has been destroyed by the Radiant Christmas!!! the mousse angles are smooth spoilers From 123ad7aab1b4ce9c05437d1ab16ac802a1ffc793 Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Sun, 21 Apr 2024 12:04:44 -0400 Subject: [PATCH 19/32] Trigger build for hl2sdk-tf2 changes (https://github.com/alliedmodders/hl2sdk/issues/231) --- pushbuild.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pushbuild.txt b/pushbuild.txt index cc9c95828d..266c1da6b4 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -48,7 +48,7 @@ that thing clobber build because amx.h changed (sigh) a dead fish ten clams, ten of them -🐌🐌🐌🐌🐌🐌 +πŸŒπŸŒπŸŒπŸŒπŸ”πŸŒ rum ham scrambled eggs EXCEPTION From 7d78c141e78c34b2df2268a00dce9e077107061f Mon Sep 17 00:00:00 2001 From: Alienmario Date: Sun, 21 Apr 2024 21:21:47 +0200 Subject: [PATCH 20/32] Fix SDKHooks IEntityListener (#2138) --- extensions/sdkhooks/extension.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/sdkhooks/extension.h b/extensions/sdkhooks/extension.h index 89576098da..0a9b326bad 100644 --- a/extensions/sdkhooks/extension.h +++ b/extensions/sdkhooks/extension.h @@ -139,11 +139,15 @@ class IEntityListener { public: #if SOURCE_ENGINE == SE_BMS + virtual ~IEntityListener() {}; virtual void OnEntityPreSpawned( CBaseEntity *pEntity ) {}; #endif virtual void OnEntityCreated( CBaseEntity *pEntity ) {}; virtual void OnEntitySpawned( CBaseEntity *pEntity ) {}; virtual void OnEntityDeleted( CBaseEntity *pEntity ) {}; +#if SOURCE_ENGINE == SE_BMS + virtual void OnEntityFlagsChanged( CBaseEntity *pEntity, int nAddedFlags, int nRemovedFlags ) {}; +#endif }; class SDKHooks : From 00f3970036ef2da6f08917cea9f2f33b8fe720dc Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Mon, 22 Apr 2024 18:24:19 -0400 Subject: [PATCH 21/32] Revert "Trigger build for hl2sdk-tf2 changes" This reverts commit 123ad7aab1b4ce9c05437d1ab16ac802a1ffc793. --- pushbuild.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pushbuild.txt b/pushbuild.txt index 266c1da6b4..cc9c95828d 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -48,7 +48,7 @@ that thing clobber build because amx.h changed (sigh) a dead fish ten clams, ten of them -πŸŒπŸŒπŸŒπŸŒπŸ”πŸŒ +🐌🐌🐌🐌🐌🐌 rum ham scrambled eggs EXCEPTION From 60b6a8dfb0afbd9e3936d7b7395ed73c5ff9fab6 Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Mon, 22 Apr 2024 21:31:14 -0400 Subject: [PATCH 22/32] Revert "Trigger build for hl2sdk-tf2 changes" This reverts commit ee51162c3fa7affaddd54a5f242e514d6f7c94ef. --- pushbuild.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/pushbuild.txt b/pushbuild.txt index cc9c95828d..5f22b0b1e6 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -69,7 +69,6 @@ Beads. snakesssssssss; maple R.I.P. Wade Boggs Your tier1 tower is under attack.. -Your mathlib tower has been destroyed by the Radiant Christmas!!! the mousse angles are smooth spoilers From f9ad35badf2effb36cdaadb4fd990ef3a1b012e4 Mon Sep 17 00:00:00 2001 From: Oliver John Hitchcock Date: Fri, 26 Apr 2024 00:19:04 +0100 Subject: [PATCH 23/32] Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323) * Stop EntRefToEntIndex returning garbage if a bad parameter is passed Seen multiple bad usage of this function that works only because whatever was passed in was returned as it wasnt an entity reference. This code should have worked and would be expected to have returned something invalid but instead the the input was returned which allowed the code to work when really it is bad code. See for one such case https://discordapp.com/channels/335290997317697536/335290997317697536/736518488314871868 * Update documentation of EntRefToEntIndex Added the error text saying what shall be returned when a invalid parameter is passed. * Validate entity index instead of just returning INVALID_EHANDLE_INDEX Not sure if it needs this much validation but this just mirrors how IsValidEntity works, so the entity index returned should be valid else INVALID_EHANDLE_INDEX is returned. * EntRefToEntIndex improve doc comments to better represent functionality --------- Co-authored-by: Kyle Sanderson --- core/HalfLife2.cpp | 20 +++++++++++++++++++- plugins/include/halflife.inc | 7 ++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 53af3dc891..7600917b40 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -1099,8 +1099,26 @@ int CHalfLife2::ReferenceToIndex(cell_t entRef) return hndl.GetEntryIndex(); } + else + { + CEntInfo *pInfo = LookupEntity(entRef); + if (!pInfo) + { + return INVALID_EHANDLE_INDEX; + } + IServerUnknown *pUnk = static_cast(pInfo->m_pEntity); + if (!pUnk) + { + return INVALID_EHANDLE_INDEX; + } + CBaseEntity *pEntity = pUnk->GetBaseEntity(); + if (!pEntity) + { + return INVALID_EHANDLE_INDEX; + } - return entRef; + return entRef; + } } cell_t CHalfLife2::EntityToBCompatRef(CBaseEntity *pEntity) diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index ccb5bf9086..38626f2342 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -667,10 +667,11 @@ stock void DisplayAskConnectBox(int client, float time, const char[] ip, const c native int EntIndexToEntRef(int entity); /** - * Retrieves the entity index from a reference. + * Retrieves the entity index from a reference or validates an entity index. + * The input ref is checked that it is still valid and refers to the same entity. * - * @param ref Entity reference. - * @return Entity index or -1 on invalid reference. + * @param ref Entity reference or index. + * @return Entity index or returns INVALID_ENT_REFERENCE if ref is invalid. */ native int EntRefToEntIndex(int ref); From 343f64f6b7d7d5a14214fd865c6a9c1d4402eaaf Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares <36161392+adriansmares@users.noreply.github.com> Date: Mon, 29 Apr 2024 01:17:10 +0200 Subject: [PATCH 24/32] Fix IsClientSourceTV in L4D2 with a custom tv_name (#2143) --- core/PlayerManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 3a5c193279..3feb79478e 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_PVKII) + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || SOURCE_ENGINE == SE_PVKII) static ConVar *tv_name = icvar->FindVar("tv_name"); #endif #if SOURCE_ENGINE == SE_TF2 @@ -675,7 +675,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_PVKII) + || SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_NUCLEARDAWN || 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 From 5a6b2c8ebf6bb2707345cc6c5d4421c78eb1c31f Mon Sep 17 00:00:00 2001 From: Artvin <76885107+artvin01@users.noreply.github.com> Date: Sun, 5 May 2024 18:13:39 +0200 Subject: [PATCH 25/32] 64bit gamedata fixes (#2141) * save as of now * save as of now * progress * hint towards comments Please for the love of god, put comments for updating these in the future will be even more annoying. i dont even know what LevelShutdown it wants. * forgot * fix * fixes * Update engine.ep2v.txt * Update engine.ep2v.txt * Update sm-tf2.games.txt --------- Co-authored-by: Benoist <14257866+Kenzzer@users.noreply.github.com> Co-authored-by: Nicholas Hastings --- gamedata/core.games/engine.ep2valve.txt | 9 +++++ gamedata/sdkhooks.games/engine.ep2v.txt | 29 ++++++++++++++- gamedata/sdktools.games/engine.ep2valve.txt | 9 +++++ gamedata/sdktools.games/game.tf.txt | 25 ++++++++++++- gamedata/sm-tf2.games.txt | 41 +++++++++++++++++++++ 5 files changed, 110 insertions(+), 3 deletions(-) diff --git a/gamedata/core.games/engine.ep2valve.txt b/gamedata/core.games/engine.ep2valve.txt index c69fb1e7bd..8d745c4266 100644 --- a/gamedata/core.games/engine.ep2valve.txt +++ b/gamedata/core.games/engine.ep2valve.txt @@ -20,11 +20,13 @@ "gEntList" { "windows" "11" + "windows64" "81" } "EntInfo" { "windows" "4" + "windows64" "8" "linux" "4" "linux64" "8" } @@ -34,8 +36,15 @@ { "LevelShutdown" { + /* not confirmed to be : CServerGameDLL:: LevelShutdown */ + /* This comment is for 64xBit */ + /* if you know the exact level shutdown function, please comment.*/ + /* String : "VDebugOverlay003" -> one call up.*/ + /* it only needs to know when the server shuts down, not the absolute correct signature.*/ + /* incase it needs the exact function, please notify.*/ "library" "server" "windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8" + "windows64" "\x40\x53\x48\x83\xEC\x20\xE8\x2A\x2A\x2A\x2A\x48\x8B\x05\x1E\x04\x9E\x00" } "gEntList" { diff --git a/gamedata/sdkhooks.games/engine.ep2v.txt b/gamedata/sdkhooks.games/engine.ep2v.txt index a32101f7b1..9a764cf4bb 100644 --- a/gamedata/sdkhooks.games/engine.ep2v.txt +++ b/gamedata/sdkhooks.games/engine.ep2v.txt @@ -5,159 +5,186 @@ { "Offsets" { + //This sucks, this comment HAS to stay, if you remove it, sourcemod WILl crash, why? Ask god. "EntityListeners" { "windows" "131108" + "windows64" "262200" "linux" "131108" - "linux64" "524432" + "linux64" "262200" } "CanBeAutobalanced" { "windows" "473" + "windows64" "473" "linux" "474" "linux64" "474" } "EndTouch" { "windows" "105" + "windows64" "105" "linux" "106" "linux64" "106" } "FireBullets" { "windows" "117" + "windows64" "117" "linux" "118" "linux64" "118" } "GetMaxHealth" { "windows" "122" + "windows64" "123" "linux" "123" "linux64" "123" } "GroundEntChanged" { "windows" "183" + "windows64" "183" "linux" "185" "linux64" "185" } "OnTakeDamage" { "windows" "64" + "windows64" "64" "linux" "65" "linux64" "65" } "OnTakeDamage_Alive" { "windows" "282" + "windows64" "282" "linux" "283" "linux64" "283" } "PreThink" { "windows" "343" + "windows64" "343" "linux" "344" "linux64" "344" } "PostThink" { "windows" "344" + "windows64" "344" "linux" "345" "linux64" "345" } "Reload" { "windows" "283" + "windows64" "283" "linux" "289" "linux64" "289" } "SetTransmit" { "windows" "22" + "windows64" "22" "linux" "23" "linux64" "23" } "ShouldCollide" { "windows" "17" + "windows64" "17" "linux" "18" "linux64" "18" } "Spawn" { "windows" "24" + "windows64" "24" "linux" "25" "linux64" "25" } "StartTouch" { "windows" "103" + "windows64" "103" "linux" "104" "linux64" "104" } "Think" { "windows" "49" + "windows64" "49" "linux" "50" "linux64" "50" } "Touch" { "windows" "104" + "windows64" "104" "linux" "105" "linux64" "105" } "TraceAttack" { "windows" "62" + "windows64" "62" "linux" "63" "linux64" "63" } "Use" { "windows" "102" + "windows64" "102" "linux" "103" "linux64" "103" } "VPhysicsUpdate" { "windows" "163" + "windows64" "163" "linux" "164" "linux64" "164" } "Blocked" { "windows" "107" + "windows64" "107" "linux" "108" "linux64" "108" } "Weapon_CanSwitchTo" { "windows" "276" + "windows64" "276" "linux" "277" "linux64" "277" } "Weapon_CanUse" { "windows" "270" + "windows64" "270" "linux" "271" "linux64" "271" } "Weapon_Drop" { "windows" "273" + "windows64" "273" "linux" "274" "linux64" "274" } "Weapon_Equip" { "windows" "271" + "windows64" "271" "linux" "272" "linux64" "272" } "Weapon_Switch" { "windows" "274" + "windows64" "274" "linux" "275" "linux64" "275" } diff --git a/gamedata/sdktools.games/engine.ep2valve.txt b/gamedata/sdktools.games/engine.ep2valve.txt index f9b93eed5c..721f56c25d 100644 --- a/gamedata/sdktools.games/engine.ep2valve.txt +++ b/gamedata/sdktools.games/engine.ep2valve.txt @@ -19,18 +19,21 @@ "GetTEName" { "windows" "4" + "windows64" "8" "linux" "4" "linux64" "8" } "GetTENext" { "windows" "8" + "windows64" "16" "linux" "8" "linux64" "16" } "TE_GetServerClass" { "windows" "0" + "windows64" "0" "linux" "0" "linux64" "0" } @@ -59,6 +62,7 @@ "sv" { "windows" "7" + "windows64" "7" } } @@ -87,8 +91,10 @@ { "FireOutput" { + /* String: "(%0.2f) output: (%s,%s) -> (%s,%s)(%s)" */ "library" "server" "windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\xC1" + "windows64" "\x48\x8B\xC4\x48\x89\x50\x10\x48\x89\x48\x08\x41\x54" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" "linux64" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } @@ -116,6 +122,7 @@ "SetUserCvar" { "windows" "18" + "windows64" "18" "linux" "58" "linux64" "58" } @@ -127,6 +134,7 @@ "SetClientName" { "windows" "17" + "windows64" "17" "linux" "57" "linux64" "57" } @@ -139,6 +147,7 @@ "InfoChanged" { "windows" "140" + "windows64" "140" "linux" "140" "linux64" "160" } diff --git a/gamedata/sdktools.games/game.tf.txt b/gamedata/sdktools.games/game.tf.txt index fc896b6fa5..5eec1ad615 100644 --- a/gamedata/sdktools.games/game.tf.txt +++ b/gamedata/sdktools.games/game.tf.txt @@ -19,102 +19,119 @@ "SetOwnerEntity" { "windows" "18" + "windows64" "18" "linux" "19" "linux64" "19" } "GiveNamedItem" { "windows" "412" + "windows64" "412" "linux" "413" "linux64" "413" } "RemovePlayerItem" { "windows" "280" + "windows64" "280" "linux" "281" "linux64" "281" } "Weapon_GetSlot" { "windows" "278" + "windows64" "278" "linux" "279" "linux64" "279" } "Ignite" { "windows" "219" + "windows64" "219" "linux" "220" "linux64" "220" } "Extinguish" { "windows" "223" + "windows64" "223" "linux" "224" "linux64" "224" } "Teleport" { "windows" "113" + "windows64" "113" "linux" "114" "linux64" "114" } "CommitSuicide" { "windows" "453" + "windows64" "453" "linux" "453" "linux64" "453" } "GetVelocity" { "windows" "146" + "windows64" "146" "linux" "147" "linux64" "147" } "EyeAngles" { "windows" "137" + "windows64" "137" "linux" "138" "linux64" "138" } "SetEntityModel" { "windows" "26" + "windows64" "26" "linux" "27" "linux64" "27" } "AcceptInput" { "windows" "38" + "windows64" "38" "linux" "39" "linux64" "39" } "WeaponEquip" { "windows" "271" + "windows64" "271" "linux" "272" "linux64" "272" } "Activate" { "windows" "35" + "windows64" "35" "linux" "36" "linux64" "36" } "PlayerRunCmd" { "windows" "430" + "windows64" "430" "linux" "431" "linux64" "431" } "GiveAmmo" { "windows" "262" + "windows64" "262" "linux" "263" "linux64" "263" } "GetAttachment" { "windows" "215" + "windows64" "215" "linux" "216" "linux64" "216" } @@ -127,30 +144,34 @@ } } - /* CBaseEntityOutput::FireOutput */ "#default" { "Signatures" { "FireOutput" { + /* CBaseEntityOutput::FireOutput */ + /* String: "(%0.2f) output: (%s,%s) -> (%s,%s,%.1f)" */ "library" "server" "windows" "\x55\x8B\xEC\x81\xEC\x40\x01\x00\x00\x8B\xC1" + "windows64" "\x48\x8B\xC4\x48\x89\x50\x10\x48\x89\x48\x08\x41\x54" "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" "linux64" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" } } } - /* CBaseAnimating::LookupAttachment */ "#default" { "Signatures" { "LookupAttachment" { + /* CBaseAnimating::LookupAttachment */ + /* String: "vehicle_driver_eyes", middle length top function, with 4 calls, pick the first one. */ "library" "server" "windows" "\x55\x8B\xEC\x56\x8B\xF1\x80\xBE\x2A\x03\x00\x00\x00\x75\x2A\x83\xBE\x2A\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x2A\x04\x00\x00\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x40" + "windows64" "\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x20\x80\xB9\x65\x04\x00\x00\x00\x48\x8B\xFA\x48\x8B\xD9\x75\x2A\x48\x83\xB9\xC0\x05\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x48\x85\xC0\x74\x2A\x48\x8B\xCB\xE8\x2A\x2A\x2A\x2A\x48\x8B\x8B\xC0\x05\x00\x00\x48\x85\xC9\x74\x2A\x48\x83\x39\x00\x74\x2A\x48\x8B\xD7\xE8\x2A\x2A\x2A\x2A" "linux" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" "linux64" "@_ZN14CBaseAnimating16LookupAttachmentEPKc" } diff --git a/gamedata/sm-tf2.games.txt b/gamedata/sm-tf2.games.txt index 903e28410f..0bd44aee22 100644 --- a/gamedata/sm-tf2.games.txt +++ b/gamedata/sm-tf2.games.txt @@ -17,85 +17,121 @@ { "Burn" { + /* CTFPlayerShared::Burn (No clone.)*/ + /* String : -> "afterburn_immunity"*/ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x8E\x8C\x01\x00\x00\x8B\x01" + "windows64" "\x40\x53\x41\x54\x41\x56\x48\x83\xEC\x60" "linux" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBasef" "linux64" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBasef" } "RemoveDisguise" { + /* CTFPlayerShared::RemoveDisguise*/ + /* String : "reveal_disguised_victim_on_hit", follow the xref, RemoveDisguise is the subroutine that's called if the return value of CALL_ATTRIB_HOOK_INT( iRevealDisguisedSpyOnHit, reveal_disguised_victim_on_hit ); was true */ + "library" "server" "windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\x57\xF7\x86\xD0\x00\x00\x00\x00\x00\x02\x00" + "windows64" "\x48\x89\x5C\x24\x10\x48\x89\x74\x24\x18\x57\x48\x83\xEC\x20\x48\x8B\xD9\xBA\x03\x00\x00\x00" "linux" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" "linux64" "@_ZN15CTFPlayerShared14RemoveDisguiseEv" } "Disguise" { + /* CTFPlayerShared::Disguise */ + /* String : "disguise", follow the xref to function that involves a lot of other commands "uncloak", "taunt", "despawn"... CTFPlayerShared::Disguise is the only subroutine that is called with the return value of RandomInt */ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x24\x56\x57\x8B\xF9\x8B\x8F\x8C\x01\x00\x00" + "windows64" "\x40\x53\x55\x56\x57\x41\x54\x48\x81\xEC\x90\x00\x00\x00" "linux" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb" "linux64" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb" } "Regenerate" { + /* CTFPlayer::Regenerate */ + /* String : "item_meter_resupply_denied" -> guessing game on which one, should be the one with "player_regenerate"*/ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x5C\x53\x56\x57\x8B\xF9\x8B\x07" + "windows64" "\x48\x8B\xC4\x88\x50\x10\x48\x81\xEC\xE8\x00\x00\x00" "linux" "@_ZN9CTFPlayer10RegenerateEb" "linux64" "@_ZN9CTFPlayer10RegenerateEb" } "AddCondition" { + /* CTFPlayerShared::AddCond */ + /* String: "mult_medigun_overheal_decay" -> most bottom function, its called twice in the same "cube" of function*/ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x85\xC9\x0F\x84\x2A\x2A\x2A\x2A\x8B\x01\x8B" + "windows64" "\x48\x89\x5C\x24\x18\x48\x89\x7C\x24\x20\x41\x56\x48\x83\xEC\x40" "linux" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity" "linux64" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity" } "RemoveCondition" { + /* CTFPlayerShared::RemoveCond */ + /* String: "damage_prevented" */ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x53\x8B\x5D\x08\x56\x53" + "windows64" "\x40\x53\x57\x41\x56\x48\x83\xEC\x20" "linux" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb" "linux64" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb" } "SetPowerplayEnabled" { + /* CTFPlayer::SetPowerplayEnabled */ + /* String: "scenes/player/pyro/low/1485.vcd" -> Main fuction -> That main function again.*/ "library" "server" "windows" "\x55\x8B\xEC\x51\x80\x7D\x08\x00\x56\x57" + "windows64" "\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x20\x48\x8D\x99\x60\x28\x00\x00" "linux" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" "linux64" "@_ZN9CTFPlayer19SetPowerplayEnabledEb" } "SetInWaitingForPlayers" { + /* CTeamplayRoundBasedRules::SetInWaitingForPlayers */ + /* String: "teamplay_restart_round" -> first call on the most bottom "cube" of function */ "library" "server" "windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A" + "windows64" "\x48\x89\x5C\x24\x08\x57\x48\x83\xEC\x20\x0F\xB6\xFA\x48\x8B\xD9\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A" "linux" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" "linux64" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb" } "StunPlayer" { + /* CTFPlayerShared::StunPlayer */ + /* String: "player_stunned" */ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x24\x57\x8B\xF9\x8B\x87\xDC\x04\x00\x00" + "windows64" "\x40\x57\x41\x57\x48\x81\xEC\x98\x00\x00\x00" "linux" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" "linux64" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer" } "MakeBleed" { + /* CTFPlayerShared::MakeBleed */ + /* String: "spell_batball_red" follow the xref to the function that also has "spell_batball_blue", in graph view, pick the node that validates the dynamic cast, MakeBleed is the only subroutine called in that node.*/ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x10\x53\x8B\xD9\x89\x5D\xF8\x8B\x8B\x8C\x01\x00\x00" + "windows64" "\x40\x56\x41\x55\x41\x57" "linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" "linux64" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefibi" } "IsPlayerInDuel" { + /* DuelMiniGame_IsInDuel */ + /* String: "CTFPlayer::ForceChangeTeam( %d ) - invalid team index.\n", follow the xref, go back to the top of the subroutine, DuelMiniGame_IsInDuel is the subroutine that is called with 3 arguments and a constant value of 1.*/ "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x08\x81\x65\x2A\x2A\x2A\x2A\x2A\x8D\x45\xF8\x8B\x4D\x08\xC6\x45\xFF\x00\x81\x65\x2A\x2A\x2A\x2A\x2A\x50\xC7\x45\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0\x75\x04" + "windows64" "\x48\x83\xEC\x28\x81\x64\x24\x3C\xFF\xFF\x0F\xFF" "linux" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer" "linux64" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer" } "CanPlayerTeleport" { + /* String: "bidirectional_teleport" follow the xref, pick the function that doesn't involve another attribute, follow the graph view after 2 virtual function call, the first subroutine call is CanPlayerTeleport*/ "library" "server" "windows" "\x55\x8B\xEC\x53\x56\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x0F\x84\x2A\x2A\x2A\x2A" + "windows64" "\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x83\xEC\x20\x48\x8B\xFA\x48\x8B\xF1\x48\x85\xD2\x0F\x84\x2A\x2A\x2A\x2A\x45\x33\xC0" "linux" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" "linux64" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer" } @@ -114,18 +150,21 @@ "ForceRespawn" { "windows" "336" + "windows64" "336" "linux" "337" "linux64" "337" } "CalcIsAttackCriticalHelper" { "windows" "398" + "windows64" "398" "linux" "405" "linux64" "405" } "CalcIsAttackCriticalHelperNoCrits" { "windows" "399" + "windows64" "399" "linux" "406" "linux64" "406" } @@ -134,6 +173,7 @@ "IsHolidayActive" { "windows" "139" + "windows64" "139" "linux" "140" "linux64" "140" } @@ -141,6 +181,7 @@ "RemoveWearable" { "windows" "439" + "windows64" "439" "linux" "440" "linux64" "440" } From 96d0959db1f38e2439dbbcfd2ce4fc96d0357c07 Mon Sep 17 00:00:00 2001 From: caxanga334 <10157643+caxanga334@users.noreply.github.com> Date: Sun, 5 May 2024 14:14:15 -0300 Subject: [PATCH 26/32] Update HL2SDK Manifests Submodule (#2150) --- hl2sdk-manifests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl2sdk-manifests b/hl2sdk-manifests index 22f699a941..a57b3095a6 160000 --- a/hl2sdk-manifests +++ b/hl2sdk-manifests @@ -1 +1 @@ -Subproject commit 22f699a941093d9d68c1f647c7c545ec346d0ee3 +Subproject commit a57b3095a6fc31a98b13e2d73ebb668dac4f1300 From 5cb2d68fd706d8716c85a6229f8de5216bb443b7 Mon Sep 17 00:00:00 2001 From: bottiger1 <55270538+bottiger1@users.noreply.github.com> Date: Sun, 5 May 2024 13:06:06 -0700 Subject: [PATCH 27/32] AcceptEntityInput 64bit fix (#2149) * Fix AcceptEntityInput on 64 bit by using struct from SDK instead of pointer math. * Fix from Malifox. Not sure what it does but it is supposedly related to the AcceptEntityInput crash. * Fix episode1 and darkm sdk paths --- extensions/bintools/jit_call_x64.cpp | 2 +- extensions/sdktools/AMBuilder | 12 ++++ extensions/sdktools/variant-t.cpp | 97 ++++++---------------------- extensions/sdktools/variant-t.h | 14 ++-- 4 files changed, 37 insertions(+), 88 deletions(-) diff --git a/extensions/bintools/jit_call_x64.cpp b/extensions/bintools/jit_call_x64.cpp index a2a47fad02..a867aa2b78 100644 --- a/extensions/bintools/jit_call_x64.cpp +++ b/extensions/bintools/jit_call_x64.cpp @@ -725,7 +725,7 @@ inline void Write_PushObject(JitWriter *jit, const SourceHook::PassInfo *info, u ObjectClass classes[MAX_CLASSES]; int numWords = ClassifyObject(smInfo, classes); - if (classes[0] == ObjectClass::Pointer) + if (classes[0] == ObjectClass::Pointer || classes[0] == ObjectClass::Memory) goto push_byref; int neededIntRegs = 0; diff --git a/extensions/sdktools/AMBuilder b/extensions/sdktools/AMBuilder index 9f024b5dce..0b5dca0164 100644 --- a/extensions/sdktools/AMBuilder +++ b/extensions/sdktools/AMBuilder @@ -49,6 +49,18 @@ for sdk_name in SM.sdks: os.path.join(builder.sourcePath, 'public', 'jit'), os.path.join(builder.sourcePath, 'public', 'jit', 'x86'), ] + + if sdk['name'] in ('episode1', 'darkm'): + binary.compiler.cxxincludes += [os.path.join(builder.options.hl2sdk_root, sdk['path'], 'game_shared')] + binary.compiler.cxxincludes += [os.path.join(builder.options.hl2sdk_root, sdk['path'], 'dlls')] + else: + binary.compiler.cxxincludes += [ + os.path.join(builder.options.hl2sdk_root, sdk['path'], 'game', 'shared'), + os.path.join(builder.options.hl2sdk_root, sdk['path'], 'game', 'server'), + ] + + #binary.sources += [os.path.join(builder.options.hl2sdk_root, sdk['path'], 'game', 'server', 'variant_t.cpp')] + binary.compiler.defines += ['HAVE_STRING_H'] if sdk['name'] != 'episode1': diff --git a/extensions/sdktools/variant-t.cpp b/extensions/sdktools/variant-t.cpp index 5c9aecab45..adb8b0f8cf 100644 --- a/extensions/sdktools/variant-t.cpp +++ b/extensions/sdktools/variant-t.cpp @@ -33,7 +33,14 @@ #include "variant-t.h" #include -unsigned char g_Variant_t[SIZEOF_VARIANT_T] = {0}; +variant_t g_Variant_t; + +// copy this definition as the original file includes cbase.h which explodes in a shower of compile errors +void variant_t::SetEntity( CBaseEntity *val ) +{ + eVal = val; + fieldType = FIELD_EHANDLE; +} #define ENTINDEX_TO_CBASEENTITY(ref, buffer) \ buffer = gamehelpers->ReferenceToEntity(ref); \ @@ -42,132 +49,66 @@ unsigned char g_Variant_t[SIZEOF_VARIANT_T] = {0}; return pContext->ThrowNativeError("Entity %d (%d) is not a CBaseEntity", gamehelpers->ReferenceToIndex(ref), ref); \ } -/* Hack to init the variant_t object for the first time */ -class VariantFirstTimeInit -{ -public: - VariantFirstTimeInit() - { - *(unsigned int *)(&g_Variant_t[12]) = INVALID_EHANDLE_INDEX; - } -} g_VariantFirstTimeInit; - static cell_t SetVariantBool(IPluginContext *pContext, const cell_t *params) { - unsigned char *vptr = g_Variant_t; - - *(bool *)vptr = (params[1]) ? true : false; - vptr += sizeof(int)*3 + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_BOOLEAN; - + g_Variant_t.SetBool((params[1]) ? true : false); return 1; } static cell_t SetVariantString(IPluginContext *pContext, const cell_t *params) { char *str; - unsigned char *vptr = g_Variant_t; - pContext->LocalToString(params[1], &str); - - *(string_t *)vptr = MAKE_STRING(str); - vptr += sizeof(int)*3 + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_STRING; - + g_Variant_t.SetString(MAKE_STRING(str)); return 1; } static cell_t SetVariantInt(IPluginContext *pContext, const cell_t *params) { - unsigned char *vptr = g_Variant_t; - - *(int *)vptr = params[1]; - vptr += sizeof(int)*3 + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_INTEGER; - + g_Variant_t.SetInt(params[1]); return 1; } static cell_t SetVariantFloat(IPluginContext *pContext, const cell_t *params) { - unsigned char *vptr = g_Variant_t; - - *(float *)vptr = sp_ctof(params[1]); - vptr += sizeof(int)*3 + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_FLOAT; - + g_Variant_t.SetFloat(sp_ctof(params[1])); return 1; } static cell_t SetVariantVector3D(IPluginContext *pContext, const cell_t *params) { cell_t *val; - unsigned char *vptr = g_Variant_t; - pContext->LocalToPhysAddr(params[1], &val); - *(float *)vptr = sp_ctof(val[0]); - vptr += sizeof(float); - *(float *)vptr = sp_ctof(val[1]); - vptr += sizeof(float); - *(float *)vptr = sp_ctof(val[2]); - vptr += sizeof(float) + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_VECTOR; - + Vector v(sp_ctof(val[0]), sp_ctof(val[1]), sp_ctof(val[2])); + g_Variant_t.SetVector3D(v); return 1; } static cell_t SetVariantPosVector3D(IPluginContext *pContext, const cell_t *params) { cell_t *val; - unsigned char *vptr = g_Variant_t; - pContext->LocalToPhysAddr(params[1], &val); - *(float *)vptr = sp_ctof(val[0]); - vptr += sizeof(float); - *(float *)vptr = sp_ctof(val[1]); - vptr += sizeof(float); - *(float *)vptr = sp_ctof(val[2]); - vptr += sizeof(float) + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_POSITION_VECTOR; - + Vector v(sp_ctof(val[0]), sp_ctof(val[1]), sp_ctof(val[2])); + g_Variant_t.SetPositionVector3D(v); return 1; } static cell_t SetVariantColor(IPluginContext *pContext, const cell_t *params) { cell_t *val; - unsigned char *vptr = g_Variant_t; - pContext->LocalToPhysAddr(params[1], &val); - *(unsigned char *)vptr = val[0]; - vptr += sizeof(unsigned char); - *(unsigned char *)vptr = val[1]; - vptr += sizeof(unsigned char); - *(unsigned char *)vptr = val[2]; - vptr += sizeof(unsigned char); - *(unsigned char *)vptr = val[3]; - vptr += sizeof(unsigned char) + sizeof(int)*2 + sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_COLOR32; - + g_Variant_t.SetColor32(val[0], val[1], val[2], val[3]); return 1; } static cell_t SetVariantEntity(IPluginContext *pContext, const cell_t *params) { CBaseEntity *pEntity; - unsigned char *vptr = g_Variant_t; - CBaseHandle bHandle; - ENTINDEX_TO_CBASEENTITY(params[1], pEntity); - bHandle = reinterpret_cast(pEntity)->GetRefEHandle(); - - vptr += sizeof(int)*3; - *(unsigned long *)vptr = (unsigned long)(bHandle.ToInt()); - vptr += sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_EHANDLE; + g_Variant_t.SetEntity(pEntity); return 1; } @@ -183,4 +124,4 @@ sp_nativeinfo_t g_VariantTNatives[] = {"SetVariantColor", SetVariantColor}, {"SetVariantEntity", SetVariantEntity}, {NULL, NULL}, -}; \ No newline at end of file +}; diff --git a/extensions/sdktools/variant-t.h b/extensions/sdktools/variant-t.h index 3e5f174914..4ce759dc59 100644 --- a/extensions/sdktools/variant-t.h +++ b/extensions/sdktools/variant-t.h @@ -32,26 +32,22 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_VARIANT_T_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_VARIANT_T_H_ -#define SIZEOF_VARIANT_T 20 +#include "variant_t.h" + +#define SIZEOF_VARIANT_T sizeof(variant_t) /** * @file variant-t.h * @brief SDK Tools extension gamerules natives header. */ -extern unsigned char g_Variant_t[SIZEOF_VARIANT_T]; +extern variant_t g_Variant_t; extern sp_nativeinfo_t g_VariantTNatives[]; inline void _init_variant_t() { - unsigned char *vptr = g_Variant_t; - - *(int *)vptr = 0; - vptr += sizeof(int)*3; - *(unsigned long *)vptr = INVALID_EHANDLE_INDEX; - vptr += sizeof(unsigned long); - *(fieldtype_t *)vptr = FIELD_VOID; + memset(&g_Variant_t, 0, sizeof(g_Variant_t)); } #endif //_INCLUDE_SOURCEMOD_EXTENSION_VARIANT_T_H_ \ No newline at end of file From f08f1ef0d646fd46f02f8b30fb269a30a8425c05 Mon Sep 17 00:00:00 2001 From: Kit o' Rifty Date: Sun, 5 May 2024 14:17:59 -0700 Subject: [PATCH 28/32] Fix passing variant_t parameters + fix codegen stack on Win64 (#2117) * Fix 64-bit JIT not allocating stack space for params on stack Fix wrong cond check for passing objects by value * Fix wrong FireOutput detour proto on win64 --- extensions/bintools/jit_call_x64.cpp | 10 +++++++++- extensions/sdktools/output.cpp | 2 +- extensions/sdktools/outputnatives.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/extensions/bintools/jit_call_x64.cpp b/extensions/bintools/jit_call_x64.cpp index a867aa2b78..d404498015 100644 --- a/extensions/bintools/jit_call_x64.cpp +++ b/extensions/bintools/jit_call_x64.cpp @@ -787,7 +787,7 @@ inline void Write_PushObject(JitWriter *jit, const SourceHook::PassInfo *info, u return; #elif defined PLATFORM_WINDOWS - if (info->size < 64 && (info->size & (info->size - 1)) == 0) + if (info->size > 8 || (info->size & (info->size - 1)) != 0) goto push_byref; else { SourceHook::PassInfo podInfo; @@ -1055,7 +1055,11 @@ void *JIT_CallCompile(CallWrapper *pWrapper, FuncAddrMethod method) int numWords; #endif +#ifdef PLATFORM_POSIX g_StackUsage = 0; +#elif defined PLATFORM_WINDOWS + g_StackUsage = 32; // Shadow space +#endif writer.outbase = NULL; writer.outptr = NULL; @@ -1155,8 +1159,12 @@ void *JIT_CallCompile(CallWrapper *pWrapper, FuncAddrMethod method) #endif /* Clean up the calling stack */ +#ifdef PLATFORM_POSIX if (hasParams && g_StackUsage) +#endif + { Write_RectifyStack(jit, g_StackAlign); + } /* Copy the return type to the return buffer if the function is not void */ if (pRet && !Needs_Retbuf) diff --git a/extensions/sdktools/output.cpp b/extensions/sdktools/output.cpp index 25e44dbca9..0daee96922 100644 --- a/extensions/sdktools/output.cpp +++ b/extensions/sdktools/output.cpp @@ -73,7 +73,7 @@ bool EntityOutputManager::IsEnabled() return enabled; } -#ifdef PLATFORM_WINDOWS +#if defined PLATFORM_WINDOWS && defined PLATFORM_X86 DETOUR_DECL_MEMBER8(FireOutput, void, int, what, int, the, int, hell, int, msvc, void *, variant_t, CBaseEntity *, pActivator, CBaseEntity *, pCaller, float, fDelay) { bool fireOutput = g_OutputManager.FireEventDetour((void *)this, pActivator, pCaller, fDelay); diff --git a/extensions/sdktools/outputnatives.cpp b/extensions/sdktools/outputnatives.cpp index 823cdfc250..fb16deed23 100644 --- a/extensions/sdktools/outputnatives.cpp +++ b/extensions/sdktools/outputnatives.cpp @@ -311,7 +311,7 @@ static cell_t FireEntityOutput(IPluginContext *pContext, const cell_t *params) { return pContext->ThrowNativeError("\"FireEntityOutput\" not supported by this mod"); } -#ifdef PLATFORM_WINDOWS +#if defined PLATFORM_WINDOWS && defined PLATFORM_X86 int iMaxParam = 8; //Instead of being one param, MSVC broke variant_t param into 5 params.. PassInfo pass[8]; From d56dc62e03fb2fe14a46ed7d76ae760f01323ff1 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Sun, 5 May 2024 23:19:11 +0200 Subject: [PATCH 29/32] i18n: Czech Translations (#2120) --- translations/cze/basetriggers.phrases.txt | 5 +++++ translations/cze/nominations.phrases.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/translations/cze/basetriggers.phrases.txt b/translations/cze/basetriggers.phrases.txt index 54bc1650e8..8cf191685f 100644 --- a/translations/cze/basetriggers.phrases.txt +++ b/translations/cze/basetriggers.phrases.txt @@ -20,6 +20,11 @@ "cze" "Friendly Fire je vypnut." } + "Friendly Fire Percent" + { + "cze" "Friendly Fire je {1}%." + } + "Current Map" { "cze" "Aktualni mapa je {1}." diff --git a/translations/cze/nominations.phrases.txt b/translations/cze/nominations.phrases.txt index a107970a28..e951a8e50f 100644 --- a/translations/cze/nominations.phrases.txt +++ b/translations/cze/nominations.phrases.txt @@ -65,4 +65,9 @@ "cze" "Nominovana" } + "Map Not In Pool" + { + "cze" "Mapa '{1}' nenΓ­ v bazΓ©nu" + } + } From 908ffdb523dda77ded9c383ea1862a813bb8d35e Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Sun, 5 May 2024 22:20:46 +0000 Subject: [PATCH 30/32] make RenameFile() on Windows also replace the file (#2060) * make RenameFile() on Windows also replace the file * Add MOVEFILE_COPY_ALLOWED to MoveFileExA --- core/logic/smn_filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index 3d9b302d62..0577bf4d59 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -639,7 +639,7 @@ static cell_t sm_RenameFile(IPluginContext *pContext, const cell_t *params) g_pSM->BuildPath(Path_Game, old_realpath, sizeof(old_realpath), "%s", oldpath); #ifdef PLATFORM_WINDOWS - return (MoveFileA(old_realpath, new_realpath)) ? 1 : 0; + return (MoveFileExA(old_realpath, new_realpath, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) ? 1 : 0; #elif defined PLATFORM_POSIX return (rename(old_realpath, new_realpath)) ? 0 : 1; #endif From e60c6724858ccd32e4df21cac5b8faee581ba329 Mon Sep 17 00:00:00 2001 From: ojlanders <143576142+ojlanders@users.noreply.github.com> Date: Mon, 6 May 2024 21:44:56 -0400 Subject: [PATCH 31/32] Add OnServerHibernationUpdate forward (closes #1483) (#2151) * Add OnServerHibernationUpdate forward (closes #1483) * Clarify hibernation state * make it 2 forwards instead of 1 --------- Co-authored-by: Odin Landers --- core/PlayerManager.cpp | 11 +++++++++++ plugins/include/clients.inc | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 3feb79478e..1d541daa36 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -59,6 +59,8 @@ bool g_OnMapStarted = false; IForward *PreAdminCheck = NULL; IForward *PostAdminCheck = NULL; IForward *PostAdminFilter = NULL; +IForward *ServerEnterHibernation = NULL; +IForward *ServerExitHibernation = NULL; const unsigned int *g_NumPlayersToAuth = NULL; int lifestate_offset = -1; @@ -203,6 +205,8 @@ void PlayerManager::OnSourceModAllInitialized() PreAdminCheck = forwardsys->CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1); PostAdminCheck = forwardsys->CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1); PostAdminFilter = forwardsys->CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1); + ServerEnterHibernation = forwardsys->CreateForward("OnServerEnterHibernation", ET_Ignore, 0, NULL); + ServerExitHibernation = forwardsys->CreateForward("OnServerExitHibernation", ET_Ignore, 0, NULL); m_bIsListenServer = !engine->IsDedicatedServer(); m_ListenClient = 0; @@ -254,6 +258,8 @@ void PlayerManager::OnSourceModShutdown() forwardsys->ReleaseForward(PreAdminCheck); forwardsys->ReleaseForward(PostAdminCheck); forwardsys->ReleaseForward(PostAdminFilter); + forwardsys->ReleaseForward(ServerEnterHibernation); + forwardsys->ReleaseForward(ServerExitHibernation); delete [] m_Players; @@ -778,6 +784,11 @@ void PlayerManager::OnSourceModLevelEnd() void PlayerManager::OnServerHibernationUpdate(bool bHibernating) { + cell_t res; + if (bHibernating) + ServerEnterHibernation->Execute(&res); + else + ServerExitHibernation->Execute(&res); /* If bots were added at map start, but not fully inited before hibernation, there will * be no OnClientDisconnect for them, despite them getting booted right before this. */ diff --git a/plugins/include/clients.inc b/plugins/include/clients.inc index d88262f1c1..51ed0bb1ef 100644 --- a/plugins/include/clients.inc +++ b/plugins/include/clients.inc @@ -215,6 +215,18 @@ forward Action OnClientPreAdminCheck(int client); */ forward void OnClientPostAdminFilter(int client); +/** + * Called directly before the server enters hibernation. + * This is your last chance to do anything in the plugin before + * hibernation occurs, as SV_Frame will no longer be called. + */ +forward void OnServerEnterHibernation(); + +/** + * Called directly before the server leaves hibernation. + */ +forward void OnServerExitHibernation(); + /** * Called once a client is authorized and fully in-game, and * after all post-connection authorizations have been performed. From c5425def7f90ab50aa2e89ab87c69b3397c341d9 Mon Sep 17 00:00:00 2001 From: sappho Date: Tue, 14 May 2024 20:09:03 -0400 Subject: [PATCH 32/32] Trigger build for L4D2 changes (#2155) --- pushbuild.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pushbuild.txt b/pushbuild.txt index 5f22b0b1e6..356be3572b 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -77,3 +77,4 @@ well, ok rude travis stole my shoe, once. I love my anime wife. Make the world your clam +you guys ever have gay thoughts