From c9a75a71bad7144c3411f59192b3a052159bb1f2 Mon Sep 17 00:00:00 2001 From: Dv4L Date: Sat, 8 Aug 2020 12:19:55 +0200 Subject: [PATCH 1/2] - Make mod-specific stats toggleable via a dvar and disable it by default - Disable D3D9Ex by default as it causes the client to not vid_restart correctly for many people - Add more guids from shitty repacks that include a guid --- src/Components/Modules/Auth.cpp | 4 +++- src/Components/Modules/D3D9Ex.cpp | 2 +- src/Components/Modules/QuickPatch.cpp | 3 +++ src/Components/Modules/Stats.cpp | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/Auth.cpp b/src/Components/Modules/Auth.cpp index 9e47b0fb..e090e1bb 100644 --- a/src/Components/Modules/Auth.cpp +++ b/src/Components/Modules/Auth.cpp @@ -9,7 +9,9 @@ namespace Components Utils::Cryptography::ECC::Key Auth::GuidKey; std::vector Auth::BannedUids = { - 0xf4d2c30b712ac6e3 + 0xf4d2c30b712ac6e3, + 0xf7e33c4081337fa3, + 0x6f5597f103cc50e9 }; void Auth::Frame() diff --git a/src/Components/Modules/D3D9Ex.cpp b/src/Components/Modules/D3D9Ex.cpp index b1028c2b..d15f66b9 100644 --- a/src/Components/Modules/D3D9Ex.cpp +++ b/src/Components/Modules/D3D9Ex.cpp @@ -748,7 +748,7 @@ namespace Components { if (Dedicated::IsEnabled()) return; - Dvar::Register("r_useD3D9Ex", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Use extended d3d9 interface!"); + Dvar::Register("r_useD3D9Ex", false, Game::dvar_flag::DVAR_FLAG_SAVED, "Use extended d3d9 interface!"); // Hook Interface creation Utils::Hook::Set(0x6D74D0, D3D9Ex::Direct3DCreate9Stub); diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 61ffe52f..187d0d91 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -326,6 +326,9 @@ namespace Components // Intermission time dvar Game::Dvar_RegisterFloat("scr_intermissionTime", 10, 0, 120, Game::DVAR_FLAG_REPLICATED | Game::DVAR_FLAG_SAVED | Game::DVAR_FLAG_DEDISAVED, "Time in seconds before match server loads the next map"); + //Dvar for enabling mod-specific stats + Game::Dvar_RegisterBool("scr_modStats", false, Game::DVAR_FLAG_REPLICATED, "Saves stats separately for the loaded mod"); + // Disallow invalid player names Utils::Hook(0x401983, QuickPatch::InvalidNameStub, HOOK_JUMP).install()->quick(); diff --git a/src/Components/Modules/Stats.cpp b/src/Components/Modules/Stats.cpp index 9f9260ff..f05dfa1c 100644 --- a/src/Components/Modules/Stats.cpp +++ b/src/Components/Modules/Stats.cpp @@ -66,7 +66,8 @@ namespace Components int Stats::SaveStats(char* dest, const char* folder, const char* buffer, size_t length) { const auto fs_game = Game::Dvar_FindVar("fs_game"); - if (fs_game && fs_game->current.string && strlen(fs_game->current.string) && !strncmp(fs_game->current.string, "mods/", 5)) + + if (Dvar::Var("scr_modStats").get() && fs_game && fs_game->current.string && strlen(fs_game->current.string) && !strncmp(fs_game->current.string, "mods/", 5)) { folder = fs_game->current.string; } From 9d8fe54681cf00239106f129d5657a2c2f804249 Mon Sep 17 00:00:00 2001 From: Dv4L Date: Sat, 8 Aug 2020 23:13:46 +0200 Subject: [PATCH 2/2] Reverted these modifications.. --- src/Components/Modules/QuickPatch.cpp | 3 --- src/Components/Modules/Stats.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 187d0d91..61ffe52f 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -326,9 +326,6 @@ namespace Components // Intermission time dvar Game::Dvar_RegisterFloat("scr_intermissionTime", 10, 0, 120, Game::DVAR_FLAG_REPLICATED | Game::DVAR_FLAG_SAVED | Game::DVAR_FLAG_DEDISAVED, "Time in seconds before match server loads the next map"); - //Dvar for enabling mod-specific stats - Game::Dvar_RegisterBool("scr_modStats", false, Game::DVAR_FLAG_REPLICATED, "Saves stats separately for the loaded mod"); - // Disallow invalid player names Utils::Hook(0x401983, QuickPatch::InvalidNameStub, HOOK_JUMP).install()->quick(); diff --git a/src/Components/Modules/Stats.cpp b/src/Components/Modules/Stats.cpp index f05dfa1c..b2621760 100644 --- a/src/Components/Modules/Stats.cpp +++ b/src/Components/Modules/Stats.cpp @@ -67,7 +67,7 @@ namespace Components { const auto fs_game = Game::Dvar_FindVar("fs_game"); - if (Dvar::Var("scr_modStats").get() && fs_game && fs_game->current.string && strlen(fs_game->current.string) && !strncmp(fs_game->current.string, "mods/", 5)) + if (fs_game && fs_game->current.string && strlen(fs_game->current.string) && !strncmp(fs_game->current.string, "mods/", 5)) { folder = fs_game->current.string; }