Add better support for handling disconnection at the ranked play queue screen#37658
Merged
smoogipoo merged 1 commit intoppy:masterfrom May 7, 2026
Merged
Conversation
smoogipoo
approved these changes
May 7, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
F7to reconnect, with a 5 second delay to show the disconnected state too):