Fix discord player count

This commit is contained in:
Federico Cecchetto 2022-05-24 22:36:17 +02:00
parent a88f117c6e
commit 3117baa69b
3 changed files with 19 additions and 1 deletions

View File

@ -101,7 +101,16 @@ namespace discord
discord_presence.partyPrivacy = DISCORD_PARTY_PUBLIC; discord_presence.partyPrivacy = DISCORD_PARTY_PUBLIC;
} }
discord_presence.partySize = 1; //*reinterpret_cast<int*>(0x1429864C4); const auto client_state = *game::mp::client_state;
if (client_state != nullptr)
{
discord_presence.partySize = client_state->num_players;
}
else
{
discord_presence.partySize = 0;
}
discord_presence.partyMax = max_clients; discord_presence.partyMax = max_clients;
discord_presence.state = clean_hostname; discord_presence.state = clean_hostname;
discord_presence.largeImageKey = map; discord_presence.largeImageKey = map;

View File

@ -1448,6 +1448,13 @@ namespace game
{ {
}; };
// made up
struct client_state_t
{
char __pad0[0x4A5C];
int num_players;
};
enum PlayerHandIndex enum PlayerHandIndex
{ {
WEAPON_HAND_DEFAULT = 0x0, WEAPON_HAND_DEFAULT = 0x0,

View File

@ -257,6 +257,8 @@ namespace game
WEAK symbol<int> sv_serverId_value{0x0, 0x0}; WEAK symbol<int> sv_serverId_value{0x0, 0x0};
WEAK symbol<bool> virtualLobby_loaded{0x0, 0x2E6EC9D}; WEAK symbol<bool> virtualLobby_loaded{0x0, 0x2E6EC9D};
WEAK symbol<client_state_t*> client_state{0x0, 0x2EC84F0};
} }
namespace sp namespace sp