From 96b676f17363abeb35b737eba1262d276aece807 Mon Sep 17 00:00:00 2001 From: sappho Date: Sun, 15 Oct 2023 20:29:44 -0400 Subject: [PATCH] Add support for open fortress (#2057) * Run timers every tick instead of arbitrarily on 100ms thinks, adding a significantly higher amount of precision * undo force push * add open fortress support * undo leftover timersys changes * Add fireoutput sig and remove engine gamedata * Update master.games.txt * Update master.games.txt (cherry picked from commit b090aa36bfe2a1c27a4ef07e7e15c7c5b626a4a3) --- gamedata/core.games/common.games.txt | 3 + gamedata/sdkhooks.games/game.openfortress.txt | 209 ++++++++++++++++++ gamedata/sdkhooks.games/master.games.txt | 4 + gamedata/sdktools.games/game.openfortress.txt | 168 ++++++++++++++ gamedata/sdktools.games/master.games.txt | 4 + 5 files changed, 388 insertions(+) create mode 100644 gamedata/sdkhooks.games/game.openfortress.txt create mode 100644 gamedata/sdktools.games/game.openfortress.txt diff --git a/gamedata/core.games/common.games.txt b/gamedata/core.games/common.games.txt index 8be9d24f9b..7a1ab613cd 100644 --- a/gamedata/core.games/common.games.txt +++ b/gamedata/core.games/common.games.txt @@ -189,6 +189,7 @@ "game" "doi" "game" "bms" "game" "iosoccer" + "game" "open_fortress" } "Keys" @@ -240,6 +241,7 @@ "game" "bms" "game" "iosoccer" "game" "reactivedrop" + "game" "open_fortress" } "Keys" @@ -300,6 +302,7 @@ "game" "csgo" "game" "reactivedrop" "game" "FortressForever" + "game" "open_fortress" } "Keys" diff --git a/gamedata/sdkhooks.games/game.openfortress.txt b/gamedata/sdkhooks.games/game.openfortress.txt new file mode 100644 index 0000000000..2fd9d2683b --- /dev/null +++ b/gamedata/sdkhooks.games/game.openfortress.txt @@ -0,0 +1,209 @@ +"Games" +{ + "#default" + { + "Offsets" + { + /* CBaseMultiplayerPlayer::CanBeAutobalanced()*/ + "CanBeAutobalanced" + { + "linux" "487" + "mac" "487" + "windows" "486" + } + + /* CBaseEntity::EndTouch(CBaseEntity*) */ + "EndTouch" + { + "linux" "103" + "mac" "103" + "windows" "102" + } + + /* CBaseEntity::FireBullets(FireBulletsInfo_t const&) */ + "FireBullets" + { + "linux" "115" + "mac" "115" + "windows" "114" + } + + /* CBaseEntity::GetMaxHealth() const */ + "GetMaxHealth" + { + "linux" "120" + "mac" "120" + "windows" "119" + } + + // NOTE: https://asherkin.github.io/vtable/ provides the correct windows offset, GDC does not appear to. + /* CBaseEntity::NetworkStateChanged_m_hGroundEntity(void*) */ + "GroundEntChanged" + { + "linux" "181" + "mac" "181" + "windows" "179" + } + + /* CBaseEntity::OnTakeDamage(CTakeDamageInfo const&) */ + "OnTakeDamage" + { + "linux" "64" + "mac" "64" + "windows" "63" + } + + /* CBasePlayer::OnTakeDamage_Alive(CTakeDamageInfo const&) */ + "OnTakeDamage_Alive" + { + "linux" "290" + "mac" "290" + "windows" "289" + } + + /* CBasePlayer::PreThink() */ + "PreThink" + { + "linux" "362" + "mac" "362" + "windows" "361" + } + + /* CBasePlayer::PostThink() */ + "PostThink" + { + "linux" "363" + "mac" "363" + "windows" "362" + } + + /* CBaseCombatWeapon::Reload() */ + "Reload" + { + "linux" "275" + "mac" "274" + "windows" "274" + } + + /* CBaseEntity::SetTransmit(CCheckTransmitInfo*, bool) */ + "SetTransmit" + { + "linux" "22" + "mac" "21" + "windows" "21" + } + + /* CBaseEntity::ShouldCollide(int, int) const */ + "ShouldCollide" + { + "linux" "18" + "mac" "16" + "windows" "16" + } + + /* CBaseEntity::Spawn() */ + "Spawn" + { + "linux" "24" + "mac" "23" + "windows" "23" + } + + /* CBaseEntity::StartTouch(CBaseEntity*) */ + "StartTouch" + { + "linux" "101" + "mac" "100" + "windows" "100" + } + + /* CBaseEntity::Think() */ + "Think" + { + "linux" "49" + "mac" "48" + "windows" "48" + } + + /* CBaseEntity::Touch(CBaseEntity*) */ + "Touch" + { + "linux" "102" + "mac" "101" + "windows" "101" + } + + /* CBaseEntity::TraceAttack(CTakeDamageInfo const&, Vector const&, CGameTrace*, CDmgAccumulator*) */ + "TraceAttack" + { + "linux" "62" + "mac" "61" + "windows" "61" + } + + /* CBaseEntity::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */ + "Use" + { + "linux" "100" + "mac" "99" + "windows" "99" + } + + /* CBaseEntity::VPhysicsUpdate(IPhysicsObject*) */ + "VPhysicsUpdate" + { + "linux" "160" + "mac" "159" + "windows" "159" + } + + /* CBaseEntity::Blocked(CBaseEntity*) */ + "Blocked" + { + "linux" "105" + "mac" "104" + "windows" "104" + } + + /* CBaseCombatCharacter::Weapon_CanSwitchTo(CBaseCombatWeapon*) */ + "Weapon_CanSwitchTo" + { + "linux" "284" + "mac" "283" + "windows" "283" + } + + /* CBaseCombatCharacter::Weapon_CanUse(CBaseCombatWeapon*) */ + "Weapon_CanUse" + { + "linux" "278" + "mac" "277" + "windows" "277" + } + + /* CBaseCombatCharacter::Weapon_Drop(CBaseCombatWeapon*, Vector const*, Vector const*) */ + "Weapon_Drop" + { + "linux" "281" + "mac" "280" + "windows" "280" + } + + /* CBaseCombatCharacter::Weapon_Equip(CBaseCombatWeapon*) */ + "Weapon_Equip" + { + "linux" "279" + "mac" "278" + "windows" "278" + } + + /* CBaseCombatCharacter::Weapon_Switch(CBaseCombatWeapon*, int) */ + "Weapon_Switch" + { + "linux" "282" + "mac" "281" + "windows" "281" + } + } + } +} \ No newline at end of file diff --git a/gamedata/sdkhooks.games/master.games.txt b/gamedata/sdkhooks.games/master.games.txt index 70d45eefb8..14db419c0d 100644 --- a/gamedata/sdkhooks.games/master.games.txt +++ b/gamedata/sdkhooks.games/master.games.txt @@ -199,4 +199,8 @@ { "game" "reactivedrop" } + "game.openfortress.txt" + { + "game" "open_fortress" + } } diff --git a/gamedata/sdktools.games/game.openfortress.txt b/gamedata/sdktools.games/game.openfortress.txt new file mode 100644 index 0000000000..aea7da6682 --- /dev/null +++ b/gamedata/sdktools.games/game.openfortress.txt @@ -0,0 +1,168 @@ +"Games" +{ + "#default" + { + "Offsets" + { + /* CBaseTempEntity::GetName() */ + "GetTEName" + { + "windows" "4" + "linux" "4" + "mac" "4" + } + + /* CBaseTempEntity::GetNext() */ + "GetTENext" + { + "windows" "8" + "linux" "8" + "mac" "8" + } + + /* CBaseTempEntity::GetServerClass() */ + "TE_GetServerClass" + { + "windows" "0" + "linux" "0" + "mac" "0" + } + + /* CBasePlayer::GiveNamedItem(char const*, int) */ + "GiveNamedItem" + { + "windows" "429" + "linux" "430" + "mac" "429" + } + + /* CBaseCombatCharacter::RemovePlayerItem(CBaseCombatWeapon*) */ + "RemovePlayerItem" + { + "windows" "287" + "linux" "288" + "mac" "287" + } + + /* CBaseCombatCharacter::Weapon_GetSlot(int) const */ + "Weapon_GetSlot" + { + "windows" "285" + "linux" "286" + "mac" "285" + } + + /* CBaseAnimating::Ignite(float, bool, float, bool) */ + "Ignite" + { + "windows" "211" + "linux" "212" + "mac" "212" + } + + /* CBaseAnimating::Extinguish() */ + "Extinguish" + { + "windows" "215" + "linux" "216" + "mac" "215" + } + + /* CBaseEntity::Teleport(Vector const*, QAngle const*, Vector const*) */ + "Teleport" + { + "windows" "110" + "linux" "111" + "mac" "110" + } + + /* CBasePlayer::CommitSuicide(bool, bool) */ + "CommitSuicide" + { + "windows" "469" + "linux" "469" + "mac" "469" + } + + /* CBaseEntity::GetVelocity(Vector*, Vector*) */ + "GetVelocity" + { + "windows" "142" + "linux" "143" + "mac" "142" + } + + /* CBaseEntity::EyeAngles() */ + "EyeAngles" + { + "windows" "133" + "linux" "134" + "mac" "133" + } + + /* CBaseEntity::SetModel(char const*) */ + "SetEntityModel" + { + "windows" "25" + "linux" "26" + "mac" "25" + } + + /* CBaseEntity::AcceptInput(char const*, CBaseEntity*, CBaseEntity*, variant_t, int) */ + "AcceptInput" + { + "windows" "37" + "linux" "38" + "mac" "37" + } + + /* CBaseCombatCharacter::Weapon_Equip(CBaseCombatWeapon*) */ + "WeaponEquip" + { + "windows" "278" + "linux" "279" + "mac" "279" + } + + /* CBaseEntity::Activate() */ + "Activate" + { + "windows" "34" + "linux" "35" + "mac" "34" + } + + /* CBasePlayer::PlayerRunCommand(CUserCmd*, IMoveHelper*) */ + "PlayerRunCmd" + { + "windows" "448" + "linux" "449" + "mac" "448" + } + + /* CBaseCombatCharacter::GiveAmmo(int, int, bool) */ + "GiveAmmo" + { + "windows" "269" + "linux" "270" + "mac" "269" + } + } + + "Keys" + { + "GameRulesProxy" "CTFGameRulesProxy" + "GameRulesDataTable" "tf_gamerules_data" + } + + "Signatures" + { + "FireOutput" + { + "library" "server" + "windows" "@?FireOutput@COutputEvent@@QAEXPAVCBaseEntity@@0M@Z" + "linux" "@_ZN12COutputEvent10FireOutputEP11CBaseEntityS1_f" + } + } + } +} diff --git a/gamedata/sdktools.games/master.games.txt b/gamedata/sdktools.games/master.games.txt index 6f8a0e0fb7..71cd0d390d 100644 --- a/gamedata/sdktools.games/master.games.txt +++ b/gamedata/sdktools.games/master.games.txt @@ -259,4 +259,8 @@ { "game" "reactivedrop" } + "game.openfortress.txt" + { + "game" "open_fortress" + } }