mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Revert user state back to idle upon availability change
This commit is contained in:
@ -184,7 +184,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Playlist.BindCollectionChanged(onPlaylistChanged, true);
|
Playlist.BindCollectionChanged(onPlaylistChanged, true);
|
||||||
BeatmapAvailability.BindValueChanged(updateClientAvailability, true);
|
BeatmapAvailability.BindValueChanged(updateBeatmapAvailability, true);
|
||||||
|
|
||||||
client.RoomUpdated += onRoomUpdated;
|
client.RoomUpdated += onRoomUpdated;
|
||||||
client.LoadRequested += onLoadRequested;
|
client.LoadRequested += onLoadRequested;
|
||||||
@ -210,10 +210,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
private void onPlaylistChanged(object sender, NotifyCollectionChangedEventArgs e) => SelectedItem.Value = Playlist.FirstOrDefault();
|
private void onPlaylistChanged(object sender, NotifyCollectionChangedEventArgs e) => SelectedItem.Value = Playlist.FirstOrDefault();
|
||||||
|
|
||||||
private void updateClientAvailability(ValueChangedEvent<BeatmapAvailability> _ = null)
|
private void updateBeatmapAvailability(ValueChangedEvent<BeatmapAvailability> _ = null)
|
||||||
{
|
{
|
||||||
if (client.Room != null)
|
if (client.Room == null)
|
||||||
client.ChangeBeatmapAvailability(BeatmapAvailability.Value).CatchUnobservedExceptions(true);
|
return;
|
||||||
|
|
||||||
|
client.ChangeBeatmapAvailability(BeatmapAvailability.Value).CatchUnobservedExceptions(true);
|
||||||
|
|
||||||
|
if (client.LocalUser?.State == MultiplayerUserState.Ready)
|
||||||
|
client.ChangeState(MultiplayerUserState.Idle).CatchUnobservedExceptions(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRoomUpdated()
|
private void onRoomUpdated()
|
||||||
@ -222,7 +227,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (client.LocalUser?.BeatmapAvailability.Equals(BeatmapAvailability.Value) == false)
|
if (client.LocalUser?.BeatmapAvailability.Equals(BeatmapAvailability.Value) == false)
|
||||||
updateClientAvailability();
|
updateBeatmapAvailability();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onReadyClick()
|
private void onReadyClick()
|
||||||
|
Reference in New Issue
Block a user