mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Change MultiplayerMatchSubScreen
to not immediately leave the room on connection loss
Instead, we can rely on `MultiplayerClient.Room` going `null`.
This commit is contained in:
@ -21,7 +21,6 @@ using osu.Game.Online.Rooms.RoomStatuses;
|
|||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
|
||||||
|
|
||||||
namespace osu.Game.Online.Multiplayer
|
namespace osu.Game.Online.Multiplayer
|
||||||
{
|
{
|
||||||
@ -91,7 +90,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The joined <see cref="MultiplayerRoom"/>.
|
/// The joined <see cref="MultiplayerRoom"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual MultiplayerRoom? Room
|
public virtual MultiplayerRoom? Room // virtual for moq
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -150,7 +149,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
// clean up local room state on server disconnect.
|
// clean up local room state on server disconnect.
|
||||||
if (!connected.NewValue && Room != null)
|
if (!connected.NewValue && Room != null)
|
||||||
{
|
{
|
||||||
Logger.Log("Connection to multiplayer server was lost.", LoggingTarget.Runtime, LogLevel.Important);
|
Logger.Log("Clearing room due to multiplayer server connection loss.", LoggingTarget.Runtime, LogLevel.Important);
|
||||||
LeaveRoom();
|
LeaveRoom();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -70,12 +70,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
client.LoadRequested += onLoadRequested;
|
client.LoadRequested += onLoadRequested;
|
||||||
client.RoomUpdated += onRoomUpdated;
|
client.RoomUpdated += onRoomUpdated;
|
||||||
|
|
||||||
isConnected.BindTo(client.IsConnected);
|
if (!client.IsConnected.Value)
|
||||||
isConnected.BindValueChanged(connected =>
|
handleRoomLost();
|
||||||
{
|
|
||||||
if (!connected.NewValue)
|
|
||||||
handleRoomLost();
|
|
||||||
}, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateMainContent() => new Container
|
protected override Drawable CreateMainContent() => new Container
|
||||||
|
Reference in New Issue
Block a user