mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 04:57:38 +09:00
Ensure the current room is left at a mutliplayer client level on client disconnection
This commit is contained in:
parent
b632e44bac
commit
00d50150de
@ -130,7 +130,11 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
public override async Task LeaveRoom()
|
public override async Task LeaveRoom()
|
||||||
{
|
{
|
||||||
if (!isConnected.Value)
|
if (!isConnected.Value)
|
||||||
|
{
|
||||||
|
// even if not connected, make sure the local room state can be cleaned up.
|
||||||
|
await base.LeaveRoom();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Room == null)
|
if (Room == null)
|
||||||
return;
|
return;
|
||||||
|
@ -75,6 +75,16 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
// Todo: This is temporary, until the multiplayer server returns the item id on match start or otherwise.
|
// Todo: This is temporary, until the multiplayer server returns the item id on match start or otherwise.
|
||||||
private int playlistItemId;
|
private int playlistItemId;
|
||||||
|
|
||||||
|
protected StatefulMultiplayerClient()
|
||||||
|
{
|
||||||
|
IsConnected.BindValueChanged(connected =>
|
||||||
|
{
|
||||||
|
// clean up local room state on server disconnect.
|
||||||
|
if (!connected.NewValue)
|
||||||
|
LeaveRoom();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Joins the <see cref="MultiplayerRoom"/> for a given API <see cref="Room"/>.
|
/// Joins the <see cref="MultiplayerRoom"/> for a given API <see cref="Room"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user