fix up discord rpc

This commit is contained in:
m 2022-03-01 18:07:22 -06:00
parent 954543228f
commit 2a79fe000e

View File

@ -52,15 +52,17 @@ namespace discord
char clean_hostname[0x100] = {0};
utils::string::strip(game::Dvar_FindVar("sv_hostname")->current.string,
clean_hostname, sizeof(clean_hostname));
auto max_clients = game::Dvar_FindVar("sv_maxclients")->current.integer;
auto max_clients = party::server_client_count();
auto clients = party::get_client_count();
// When true, we are in Private Match
if (game::SV_Loaded())
{
strcpy_s(clean_hostname, "Private Match");
max_clients = party::server_client_count();
max_clients = game::Dvar_FindVar("sv_maxclients")->current.integer;
clients = *reinterpret_cast<int*>(0x14621BE00);
}
auto clients = *reinterpret_cast<int*>(0x14621BE00);
discord_presence.partySize = clients;
discord_presence.partyMax = max_clients;
discord_presence.state = clean_hostname;