diff --git a/src/client/component/server_list.cpp b/src/client/component/server_list.cpp index 83debbf3..14ae7112 100644 --- a/src/client/component/server_list.cpp +++ b/src/client/component/server_list.cpp @@ -175,9 +175,9 @@ namespace server_list write_favorite_servers(); } - std::unordered_set* get_favorite_servers() + std::unordered_set& get_favorite_servers() { - return &favorite_servers; + return favorite_servers; } struct component final : client_component diff --git a/src/client/component/server_list.hpp b/src/client/component/server_list.hpp index b02acac3..a41ad1d4 100644 --- a/src/client/component/server_list.hpp +++ b/src/client/component/server_list.hpp @@ -10,5 +10,5 @@ namespace server_list void add_favorite_server(game::netadr_t addr); void remove_favorite_server(game::netadr_t addr); - std::unordered_set* get_favorite_servers(); + std::unordered_set& get_favorite_servers(); } diff --git a/src/client/steam/interfaces/matchmaking_servers.cpp b/src/client/steam/interfaces/matchmaking_servers.cpp index c44a4c46..91191e90 100644 --- a/src/client/steam/interfaces/matchmaking_servers.cpp +++ b/src/client/steam/interfaces/matchmaking_servers.cpp @@ -74,12 +74,12 @@ namespace steam } void handle_server_respone(const bool success, const game::netadr_t& host, const ::utils::info_string& info, - const uint32_t ping, ::utils::concurrency::container* server_list, - std::atomic* response, void* request) + const uint32_t ping, ::utils::concurrency::container& server_list, + std::atomic& response, void* request) { bool all_handled = false; std::optional index{}; - server_list->access([&](servers& srvs) + server_list.access([&](servers& srvs) { size_t i = 0; for (; i < srvs.size(); ++i) @@ -113,7 +113,7 @@ namespace steam all_handled = true; }); - const auto res = response->load(); + const auto res = response.load(); if (!index || !res) { return; @@ -137,14 +137,14 @@ namespace steam void handle_internet_server_response(const bool success, const game::netadr_t& host, const ::utils::info_string& info, const uint32_t ping) { - handle_server_respone(success, host, info, ping, &internet_servers, &internet_response, internet_request); + handle_server_respone(success, host, info, ping, internet_servers, internet_response, internet_request); } void handle_favorites_server_response(const bool success, const game::netadr_t& host, const ::utils::info_string& info, const uint32_t ping) { - handle_server_respone(success, host, info, ping, &favorites_servers, &favorites_response, favorites_request); + handle_server_respone(success, host, info, ping, favorites_servers, favorites_response, favorites_request); } void ping_server(const game::netadr_t& server, party::query_callback callback) @@ -227,7 +227,7 @@ namespace steam auto s = server_list::get_favorite_servers(); - if (s->empty()) + if (s.empty()) { res->RefreshComplete(favorites_request, eNoServersListedOnMasterServer); return favorites_request; @@ -236,9 +236,9 @@ namespace steam favorites_servers.access([s](servers& srvs) { srvs = {}; - srvs.reserve(s->size()); + srvs.reserve(s.size()); - for (auto& address : *s) + for (auto& address : s) { server new_server{}; new_server.address = address; @@ -248,7 +248,7 @@ namespace steam } }); - for (auto& srv : *s) + for (auto& srv : s) { ping_server(srv, handle_favorites_server_response); }