1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Merge pull request #13862 from peppy/fix-multiplayer-create-game-failure-crash

Fix crash when multiplayer server join fails during game creation
This commit is contained in:
Dan Balasescu 2021-07-13 18:00:47 +09:00 committed by GitHub
commit 0557761e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
[Resolved]
private OngoingOperationTracker ongoingOperationTracker { get; set; }
[Resolved]
private Bindable<Room> currentRoom { get; set; }
private MultiplayerMatchSettingsOverlay settingsOverlay;
private readonly IBindable<bool> isConnected = new Bindable<bool>();
@ -273,6 +276,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
if (!connected.NewValue)
Schedule(this.Exit);
}, true);
currentRoom.BindValueChanged(room =>
{
if (room.NewValue == null)
{
// the room has gone away.
// this could mean something happened during the join process, or an external connection issue occurred.
// one specific scenario is where the underlying room is created, but the signalr server returns an error during the join process. this triggers a PartRoom operation (see https://github.com/ppy/osu/blob/7654df94f6f37b8382be7dfcb4f674e03bd35427/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomManager.cs#L97)
Schedule(this.Exit);
}
}, true);
}
protected override void UpdateMods()