mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Remove lots of unnecessary client side logic
This commit is contained in:
parent
1368d55152
commit
9ba5ae3db7
@ -270,7 +270,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
BeatmapAvailability.BindValueChanged(updateBeatmapAvailability, true);
|
||||
UserMods.BindValueChanged(onUserModsChanged);
|
||||
|
||||
client.RoomUpdated += onRoomUpdated;
|
||||
client.LoadRequested += onLoadRequested;
|
||||
|
||||
isConnected = client.IsConnected.GetBoundCopy();
|
||||
@ -323,24 +322,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
client.ChangeUserMods(mods.NewValue);
|
||||
}
|
||||
|
||||
private void updateBeatmapAvailability(ValueChangedEvent<BeatmapAvailability> _ = null)
|
||||
private void updateBeatmapAvailability(ValueChangedEvent<BeatmapAvailability> availability)
|
||||
{
|
||||
if (client.Room == null)
|
||||
return;
|
||||
|
||||
client.ChangeBeatmapAvailability(BeatmapAvailability.Value);
|
||||
|
||||
if (client.LocalUser?.State == MultiplayerUserState.Ready)
|
||||
client.ChangeState(MultiplayerUserState.Idle);
|
||||
}
|
||||
|
||||
private void onRoomUpdated()
|
||||
{
|
||||
if (client.Room == null)
|
||||
return;
|
||||
|
||||
if (client.LocalUser?.BeatmapAvailability.Equals(BeatmapAvailability.Value) == false)
|
||||
updateBeatmapAvailability();
|
||||
client.ChangeBeatmapAvailability(availability.NewValue);
|
||||
}
|
||||
|
||||
private void onReadyClick()
|
||||
@ -392,10 +379,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (client != null)
|
||||
{
|
||||
client.LoadRequested -= onLoadRequested;
|
||||
client.RoomUpdated -= onRoomUpdated;
|
||||
}
|
||||
}
|
||||
|
||||
private class UserModSelectOverlay : ModSelectOverlay
|
||||
|
Loading…
Reference in New Issue
Block a user