summaryrefslogtreecommitdiffstats
path: root/src/core/announce_multiplayer_session.cpp
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2022-07-22 16:31:13 +0200
committerFearlessTobi <thm.frey@gmail.com>2022-07-25 21:59:31 +0200
commit7d82e57b91dee30e0fe6fed36550ea7cc9eb778e (patch)
tree4a58f4874083783026dabc0de6a7fb09195cf95b /src/core/announce_multiplayer_session.cpp
parentcommon: multiplayer: Use GameInfo type (diff)
downloadyuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar.gz
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar.bz2
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar.lz
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar.xz
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.tar.zst
yuzu-7d82e57b91dee30e0fe6fed36550ea7cc9eb778e.zip
Diffstat (limited to 'src/core/announce_multiplayer_session.cpp')
-rw-r--r--src/core/announce_multiplayer_session.cpp7
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;
}