diff options
Diffstat (limited to 'src/core/announce_multiplayer_session.cpp')
-rw-r--r-- | src/core/announce_multiplayer_session.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/announce_multiplayer_session.cpp b/src/core/announce_multiplayer_session.cpp index db9eaeac8..8f96b4ee8 100644 --- a/src/core/announce_multiplayer_session.cpp +++ b/src/core/announce_multiplayer_session.cpp @@ -20,7 +20,8 @@ namespace Core { // Time between room is announced to web_service static constexpr std::chrono::seconds announce_time_interval(15); -AnnounceMultiplayerSession::AnnounceMultiplayerSession() { +AnnounceMultiplayerSession::AnnounceMultiplayerSession(Network::RoomNetwork& room_network_) + : room_network{room_network_} { #ifdef ENABLE_WEB_SERVICE backend = std::make_unique<WebService::RoomJson>(Settings::values.web_api_url.GetValue(), Settings::values.yuzu_username.GetValue(), @@ -31,7 +32,7 @@ AnnounceMultiplayerSession::AnnounceMultiplayerSession() { } WebService::WebResult AnnounceMultiplayerSession::Register() { - std::shared_ptr<Network::Room> room = Network::GetRoom().lock(); + std::shared_ptr<Network::Room> room = room_network.GetRoom().lock(); if (!room) { return WebService::WebResult{WebService::WebResult::Code::LibError, "Network is not initialized", ""}; @@ -120,7 +121,7 @@ void AnnounceMultiplayerSession::AnnounceMultiplayerLoop() { std::future<WebService::WebResult> future; while (!shutdown_event.WaitUntil(update_time)) { update_time += announce_time_interval; - std::shared_ptr<Network::Room> room = Network::GetRoom().lock(); + std::shared_ptr<Network::Room> room = room_network.GetRoom().lock(); if (!room) { break; } |