From 819550c89f9474f4a240a683c1a13754f6922688 Mon Sep 17 00:00:00 2001 From: Lierrmm Date: Fri, 24 Feb 2023 10:56:39 +0000 Subject: [PATCH] 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};