From 819550c89f9474f4a240a683c1a13754f6922688 Mon Sep 17 00:00:00 2001 From: Lierrmm Date: Fri, 24 Feb 2023 10:56:39 +0000 Subject: [PATCH 1/4] feat: remove color prefixes from server name in console title --- src/client/component/dedicated_info.cpp | 5 +++-- src/client/game/symbols.hpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/component/dedicated_info.cpp b/src/client/component/dedicated_info.cpp index a15cf369..87094662 100644 --- a/src/client/component/dedicated_info.cpp +++ b/src/client/component/dedicated_info.cpp @@ -17,17 +17,18 @@ namespace dedicated_info { const auto sv_running = game::Dvar_FindVar("sv_running"); const auto server_name = game::get_dvar_string("live_steam_server_name"); + const auto clean_server_name = game::I_CleanStr(server_name.data()); if (!sv_running || !sv_running->current.enabled) { - console::set_title(server_name + " - not running"); + console::set_title(utils::string::va("%s - not running", clean_server_name)); return; } const auto mapname = game::get_dvar_string("mapname"); const std::string window_text = utils::string::va("%s on %s [%d/%d] (%d)", - server_name.data(), + clean_server_name, mapname.data(), getinfo::get_client_count(), getinfo::get_max_client_count(), diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 128f8364..98e136a1 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -131,6 +131,9 @@ namespace game WEAK symbol SV_SendServerCommand{0x0, 0x140537F10}; WEAK symbol SV_IsTestClient{0x14224B5C0, 0x14052FF40}; + // Utils + WEAK symbol I_CleanStr{ 0x1422E9C10, 0x140580E80 }; + // Variables WEAK symbol cmd_functions{0x15689FF58, 0x14946F860}; From cdcb1f474b6c3ea298e6386c5e3762cc9a44cad9 Mon Sep 17 00:00:00 2001 From: Lierrmm Date: Fri, 24 Feb 2023 12:13:12 +0000 Subject: [PATCH 2/4] feat: remove whitespace --- src/client/game/symbols.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 98e136a1..6d36ace0 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -132,7 +132,7 @@ namespace game WEAK symbol SV_IsTestClient{0x14224B5C0, 0x14052FF40}; // Utils - WEAK symbol I_CleanStr{ 0x1422E9C10, 0x140580E80 }; + WEAK symbol I_CleanStr{0x1422E9C10, 0x140580E80}; // Variables From 17eca76f0ae2f93de0c1d2bf68e83f66cbc3150e Mon Sep 17 00:00:00 2001 From: Lierrmm Date: Fri, 24 Feb 2023 12:14:16 +0000 Subject: [PATCH 3/4] feat: change const char* to char* --- src/client/game/symbols.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 6d36ace0..4cc58b9e 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -132,7 +132,7 @@ namespace game WEAK symbol SV_IsTestClient{0x14224B5C0, 0x14052FF40}; // Utils - WEAK symbol I_CleanStr{0x1422E9C10, 0x140580E80}; + WEAK symbol I_CleanStr{0x1422E9C10, 0x140580E80}; // Variables From 2b26b507aa8364b68d7f18c564ed275b4daef20f Mon Sep 17 00:00:00 2001 From: Lierrmm Date: Fri, 24 Feb 2023 12:24:08 +0000 Subject: [PATCH 4/4] fix: replace const auto with auto --- src/client/component/dedicated_info.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/dedicated_info.cpp b/src/client/component/dedicated_info.cpp index 87094662..1e36c58b 100644 --- a/src/client/component/dedicated_info.cpp +++ b/src/client/component/dedicated_info.cpp @@ -16,8 +16,8 @@ namespace dedicated_info void set_server_info_in_console_title() { const auto sv_running = game::Dvar_FindVar("sv_running"); - const auto server_name = game::get_dvar_string("live_steam_server_name"); - const auto clean_server_name = game::I_CleanStr(server_name.data()); + auto server_name = game::get_dvar_string("live_steam_server_name"); + auto clean_server_name = game::I_CleanStr(server_name.data()); if (!sv_running || !sv_running->current.enabled) {