1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Merge branch 'master' into net5.0

This commit is contained in:
Dean Herbert 2021-01-15 15:23:41 +09:00 committed by GitHub
commit c3049f431a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

View File

@ -52,6 +52,7 @@ namespace osu.Game.Online.Multiplayer
/// <summary>
/// Whether the <see cref="StatefulMultiplayerClient"/> is currently connected.
/// This is NOT thread safe and usage should be scheduled.
/// </summary>
public abstract IBindable<bool> IsConnected { get; }

View File

@ -34,8 +34,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
base.LoadComplete();
isConnected.BindValueChanged(_ => updateState());
operationInProgress.BindValueChanged(_ => updateState(), true);
isConnected.BindValueChanged(_ => Scheduler.AddOnce(updateState));
operationInProgress.BindValueChanged(_ => Scheduler.AddOnce(updateState), true);
}
private void updateState() => Enabled.Value = isConnected.Value && !operationInProgress.Value;

View File

@ -77,14 +77,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
});
isConnected = client.IsConnected.GetBoundCopy();
isConnected.BindValueChanged(connected =>
isConnected.BindValueChanged(connected => Schedule(() =>
{
if (!connected.NewValue)
{
// messaging to the user about this disconnect will be provided by the MultiplayerMatchSubScreen.
failAndBail();
}
}, true);
}), true);
Debug.Assert(client.Room != null);
}

View File

@ -34,10 +34,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
base.LoadComplete();
isConnected.BindTo(multiplayerClient.IsConnected);
isConnected.BindValueChanged(_ => Schedule(updatePolling));
JoinedRoom.BindValueChanged(_ => updatePolling());
updatePolling();
isConnected.BindValueChanged(_ => Scheduler.AddOnce(updatePolling));
JoinedRoom.BindValueChanged(_ => Scheduler.AddOnce(updatePolling), true);
}
public override void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)

View File

@ -500,7 +500,7 @@ namespace osu.Game.Screens.Select
if (beatmap != null)
{
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
if (beatmap.BeatmapSetInfoID == previous?.BeatmapInfo.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
sampleChangeBeatmap.Play();