mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 13:02:54 +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:
commit
0557761e51
@ -48,6 +48,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OngoingOperationTracker ongoingOperationTracker { get; set; }
|
private OngoingOperationTracker ongoingOperationTracker { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<Room> currentRoom { get; set; }
|
||||||
|
|
||||||
private MultiplayerMatchSettingsOverlay settingsOverlay;
|
private MultiplayerMatchSettingsOverlay settingsOverlay;
|
||||||
|
|
||||||
private readonly IBindable<bool> isConnected = new Bindable<bool>();
|
private readonly IBindable<bool> isConnected = new Bindable<bool>();
|
||||||
@ -273,6 +276,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
if (!connected.NewValue)
|
if (!connected.NewValue)
|
||||||
Schedule(this.Exit);
|
Schedule(this.Exit);
|
||||||
}, true);
|
}, 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()
|
protected override void UpdateMods()
|
||||||
|
Loading…
Reference in New Issue
Block a user