feat: remove color prefixes from server name in console title

This commit is contained in:
Lierrmm 2023-02-24 10:56:39 +00:00
parent f4047555b3
commit 819550c89f
2 changed files with 6 additions and 2 deletions

View File

@ -17,17 +17,18 @@ namespace dedicated_info
{ {
const auto sv_running = game::Dvar_FindVar("sv_running"); const auto sv_running = game::Dvar_FindVar("sv_running");
const auto server_name = game::get_dvar_string("live_steam_server_name"); 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) 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; return;
} }
const auto mapname = game::get_dvar_string("mapname"); const auto mapname = game::get_dvar_string("mapname");
const std::string window_text = utils::string::va("%s on %s [%d/%d] (%d)", const std::string window_text = utils::string::va("%s on %s [%d/%d] (%d)",
server_name.data(), clean_server_name,
mapname.data(), mapname.data(),
getinfo::get_client_count(), getinfo::get_client_count(),
getinfo::get_max_client_count(), getinfo::get_max_client_count(),

View File

@ -131,6 +131,9 @@ namespace game
WEAK symbol<void(client_s* cl_0, svscmd_type type, const char* fmt, ...)> SV_SendServerCommand{0x0, 0x140537F10}; WEAK symbol<void(client_s* cl_0, svscmd_type type, const char* fmt, ...)> SV_SendServerCommand{0x0, 0x140537F10};
WEAK symbol<bool(int clientNum)> SV_IsTestClient{0x14224B5C0, 0x14052FF40}; WEAK symbol<bool(int clientNum)> SV_IsTestClient{0x14224B5C0, 0x14052FF40};
// Utils
WEAK symbol<const char* (const char* str)> I_CleanStr{ 0x1422E9C10, 0x140580E80 };
// Variables // Variables
WEAK symbol<cmd_function_s> cmd_functions{0x15689FF58, 0x14946F860}; WEAK symbol<cmd_function_s> cmd_functions{0x15689FF58, 0x14946F860};