diff --git a/client/scenes/lobby.cpp b/client/scenes/lobby.cpp index 0487c1d1..704e6fd4 100644 --- a/client/scenes/lobby.cpp +++ b/client/scenes/lobby.cpp @@ -503,7 +503,10 @@ void scenes::lobby::render(const XrFrameState & frame_state) if (!next_scene->alive()) next_scene.reset(); else if (next_scene->current_state() == scenes::stream::state::streaming) + { + autoconnect_enabled = true; application::push_scene(next_scene); + } } update_server_list(); @@ -514,8 +517,9 @@ void scenes::lobby::render(const XrFrameState & frame_state) const auto & servers = application::get_config().servers; for (auto && [cookie, data]: servers) { - if (data.visible && (data.autoconnect || force_autoconnect) && data.compatible) + if (data.visible && (data.autoconnect || force_autoconnect) && data.compatible && autoconnect_enabled) { + autoconnect_enabled = false; connect(data); break; } diff --git a/client/scenes/lobby.h b/client/scenes/lobby.h index 1089a26d..102c5199 100644 --- a/client/scenes/lobby.h +++ b/client/scenes/lobby.h @@ -55,6 +55,7 @@ class lobby : public scene_impl std::optional async_error; std::shared_ptr next_scene; std::string server_name; + bool autoconnect_enabled = true; std::optional renderer; std::optional lobby_scene;