Skip to content

Commit

Permalink
clean and maybe fix profile_infos
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelrau committed Aug 10, 2024
1 parent e2a766b commit b3f7437
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/client/component/profile_infos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace profile_infos
namespace
{
using profile_map = std::unordered_map<std::uint64_t, profile_info>;
utils::concurrency::container<profile_map, std::recursive_mutex> profile_mapping{};
utils::concurrency::container<profile_map, std::mutex> profile_mapping{};

std::optional<profile_info> load_profile_info()
{
Expand All @@ -32,9 +32,9 @@ namespace profile_infos
}

profile_info info{};
info.m_memberplayer_card.assign(data);
info.m_memberplayer_card = std::move(data);

return {std::move(info)};
return info;
}

std::unordered_set<std::uint64_t> get_connected_client_xuids()
Expand Down Expand Up @@ -141,7 +141,7 @@ namespace profile_infos
return load_profile_info();
}

std::optional<profile_info> get_profile_info(const uint64_t user_id)
std::optional<profile_info> get_profile_info(const std::uint64_t user_id)
{
const auto my_xuid = steam::SteamUser()->GetSteamID().bits;
if (user_id == my_xuid)
Expand Down Expand Up @@ -324,6 +324,7 @@ namespace profile_infos
{
if (xuid == 0)
{
i++;
continue;
}
send_xuid(addr, xuid, i++);
Expand Down Expand Up @@ -382,7 +383,9 @@ namespace profile_infos
void post_unpack() override
{
client_connect_hook.create(0x140AFFF10, client_connect_stub);
session_unregister_remote_player_hook.create(0x140C73970, session_unregister_remote_player_stub);

// comment out this, since i think i fixed this indirectly with a patch from party.cpp
//session_unregister_remote_player_hook.create(0x140C73970, session_unregister_remote_player_stub);

dvars::override::register_int("playercard_cache_validity_life", 5000, 0, 3600000, 0x0); // 5sec

Expand All @@ -394,7 +397,7 @@ namespace profile_infos
{
buffer = utils::byte_buffer(final_packet);

const auto user_id = buffer.read<uint64_t>();
const auto user_id = buffer.read<std::uint64_t>();

const profile_info info(buffer);
if (info.m_memberplayer_card.empty())
Expand Down

0 comments on commit b3f7437

Please sign in to comment.