Skip to content

Add better support for handling disconnection at the ranked play queue screen#37658

Merged
smoogipoo merged 1 commit intoppy:masterfrom
peppy:ranked-play-queue-screen-disconnect-handling
May 7, 2026
Merged

Add better support for handling disconnection at the ranked play queue screen#37658
smoogipoo merged 1 commit intoppy:masterfrom
peppy:ranked-play-queue-screen-disconnect-handling

Conversation

@peppy
Copy link
Copy Markdown
Member

@peppy peppy commented May 7, 2026

Until now the queue screen basically did nothing to let the user knowing they were disconnected from the server. Now the various components will correctly clear state and show a roughly competent "i'm trying to reconnect" state.

osu.2026-05-07.at.06.15.02.mp4

Can be tested using the following patch (hit F7 to reconnect, with a 5 second delay to show the disconnected state too):

diff --git a/osu.Game/Online/PersistentEndpointClientConnector.cs b/osu.Game/Online/PersistentEndpointClientConnector.cs
index 7064906be4..ae539aba8d 100644
--- a/osu.Game/Online/PersistentEndpointClientConnector.cs
+++ b/osu.Game/Online/PersistentEndpointClientConnector.cs
@@ -99,6 +99,8 @@ private async Task connect()
                     // this will also create a new cancellation token source.
                     await disconnect(false).ConfigureAwait(false);
 
+                    await Task.Delay(5000).ConfigureAwait(false);
+
                     // this token will be valid for the scope of this connection.
                     // if cancelled, we can be sure that a disconnect or reconnect is handled elsewhere.
                     var cancellationToken = connectCancelSource.Token;
diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs
index 703444a92f..fb467472d3 100644
--- a/osu.Game/OsuGameBase.cs
+++ b/osu.Game/OsuGameBase.cs
@@ -22,6 +22,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Textures;
 using osu.Framework.Input;
+using osu.Framework.Input.Events;
 using osu.Framework.Input.Handlers;
 using osu.Framework.Input.Handlers.Joystick;
 using osu.Framework.Input.Handlers.Midi;
@@ -65,6 +66,7 @@
 using osu.Game.Scoring;
 using osu.Game.Skinning;
 using osu.Game.Utils;
+using osuTK.Input;
 using RuntimeInfo = osu.Framework.RuntimeInfo;
 
 namespace osu.Game
@@ -104,7 +106,7 @@ public partial class OsuGameBase : Framework.Game, ICanAcceptFiles, IBeatSyncPro
         /// </summary>
         private const double global_track_volume_adjust = 0.8;
 
-        public virtual bool UseDevelopmentServer => DebugUtils.IsDebugBuild;
+        public virtual bool UseDevelopmentServer => false;
 
         public virtual EndpointConfiguration CreateEndpoints() =>
             UseDevelopmentServer ? new DevelopmentEndpointConfiguration() : new ProductionEndpointConfiguration();
@@ -466,6 +468,20 @@ private void addFilesWarning()
             }
         }
 
+        protected override bool OnKeyDown(KeyDownEvent e)
+        {
+            if (e.Key == Key.F7)
+            {
+                Logger.Log("Forcing reconnect!", level: LogLevel.Important);
+
+                ((IStatefulUserHubClient)MultiplayerClient).ServerShuttingDown();
+                ((IStatefulUserHubClient)SpectatorClient).ServerShuttingDown();
+                ((IStatefulUserHubClient)metadataClient).ServerShuttingDown();
+            }
+
+            return base.OnKeyDown(e);
+        }
+
         private void onTrackChanged(WorkingBeatmap beatmap, TrackChangeDirection direction) => beatmapClock.ChangeSource(beatmap.Track);
 
         protected virtual void InitialiseFonts()

@peppy peppy requested review from a team and smoogipoo May 7, 2026 06:15
@smoogipoo smoogipoo merged commit 7f385c7 into ppy:master May 7, 2026
10 checks passed
Copilot AI pushed a commit to winnerspiros/osu that referenced this pull request May 7, 2026
…e screen (ppy#37658)

Until now the queue screen basically did nothing to let the user knowing
they were disconnected from the server. Now the various components will
correctly clear state and show a roughly competent "i'm trying to
reconnect" state.

https://github.com/user-attachments/assets/bff1b241-a6a2-445a-9ffa-b5682f2a3656

---

Can be tested using the following patch (hit `F7` to reconnect, with a 5
second delay to show the disconnected state too):

```diff
diff --git a/osu.Game/Online/PersistentEndpointClientConnector.cs b/osu.Game/Online/PersistentEndpointClientConnector.cs
index 7064906..ae539aba8d 100644
--- a/osu.Game/Online/PersistentEndpointClientConnector.cs
+++ b/osu.Game/Online/PersistentEndpointClientConnector.cs
@@ -99,6 +99,8 @@ private async Task connect()
                     // this will also create a new cancellation token source.
                     await disconnect(false).ConfigureAwait(false);

+                    await Task.Delay(5000).ConfigureAwait(false);
+
                     // this token will be valid for the scope of this connection.
                     // if cancelled, we can be sure that a disconnect or reconnect is handled elsewhere.
                     var cancellationToken = connectCancelSource.Token;
diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs
index 703444a..fb467472d3 100644
--- a/osu.Game/OsuGameBase.cs
+++ b/osu.Game/OsuGameBase.cs
@@ -22,6 +22,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Textures;
 using osu.Framework.Input;
+using osu.Framework.Input.Events;
 using osu.Framework.Input.Handlers;
 using osu.Framework.Input.Handlers.Joystick;
 using osu.Framework.Input.Handlers.Midi;
@@ -65,6 +66,7 @@
 using osu.Game.Scoring;
 using osu.Game.Skinning;
 using osu.Game.Utils;
+using osuTK.Input;
 using RuntimeInfo = osu.Framework.RuntimeInfo;

 namespace osu.Game
@@ -104,7 +106,7 @@ public partial class OsuGameBase : Framework.Game, ICanAcceptFiles, IBeatSyncPro
         /// </summary>
         private const double global_track_volume_adjust = 0.8;

-        public virtual bool UseDevelopmentServer => DebugUtils.IsDebugBuild;
+        public virtual bool UseDevelopmentServer => false;

         public virtual EndpointConfiguration CreateEndpoints() =>
             UseDevelopmentServer ? new DevelopmentEndpointConfiguration() : new ProductionEndpointConfiguration();
@@ -466,6 +468,20 @@ private void addFilesWarning()
             }
         }

+        protected override bool OnKeyDown(KeyDownEvent e)
+        {
+            if (e.Key == Key.F7)
+            {
+                Logger.Log("Forcing reconnect!", level: LogLevel.Important);
+
+                ((IStatefulUserHubClient)MultiplayerClient).ServerShuttingDown();
+                ((IStatefulUserHubClient)SpectatorClient).ServerShuttingDown();
+                ((IStatefulUserHubClient)metadataClient).ServerShuttingDown();
+            }
+
+            return base.OnKeyDown(e);
+        }
+
         private void onTrackChanged(WorkingBeatmap beatmap, TrackChangeDirection direction) => beatmapClock.ChangeSource(beatmap.Track);

         protected virtual void InitialiseFonts()

```

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot AI added a commit to winnerspiros/osu that referenced this pull request May 7, 2026
…) — prioritize fork

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants