Skip to content

Commit

Permalink
Revert "Merge pull request #20047 from smoogipoo/multiplayer-auto-skip"
Browse files Browse the repository at this point in the history
This reverts commit db9970b, reversing
changes made to a4dc3fe.
  • Loading branch information
peppy committed Sep 1, 2022
1 parent 7eaa4c5 commit d108ec2
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 34 deletions.
5 changes: 1 addition & 4 deletions osu.Game/Online/Multiplayer/MultiplayerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ public Task LeaveRoom()
/// <param name="matchType">The type of the match, if any.</param>
/// <param name="queueMode">The new queue mode, if any.</param>
/// <param name="autoStartDuration">The new auto-start countdown duration, if any.</param>
/// <param name="autoSkip">The new auto-skip setting.</param>
public Task ChangeSettings(Optional<string> name = default, Optional<string> password = default, Optional<MatchType> matchType = default, Optional<QueueMode> queueMode = default,
Optional<TimeSpan> autoStartDuration = default, Optional<bool> autoSkip = default)
Optional<TimeSpan> autoStartDuration = default)
{
if (Room == null)
throw new InvalidOperationException("Must be joined to a match to change settings.");
Expand All @@ -279,7 +278,6 @@ public Task ChangeSettings(Optional<string> name = default, Optional<string> pas
MatchType = matchType.GetOr(Room.Settings.MatchType),
QueueMode = queueMode.GetOr(Room.Settings.QueueMode),
AutoStartDuration = autoStartDuration.GetOr(Room.Settings.AutoStartDuration),
AutoSkip = autoSkip.GetOr(Room.Settings.AutoSkip)
});
}

Expand Down Expand Up @@ -741,7 +739,6 @@ private void updateLocalRoomSettings(MultiplayerRoomSettings settings)
APIRoom.QueueMode.Value = Room.Settings.QueueMode;
APIRoom.AutoStartDuration.Value = Room.Settings.AutoStartDuration;
APIRoom.CurrentPlaylistItem.Value = APIRoom.Playlist.Single(item => item.ID == settings.PlaylistItemId);
APIRoom.AutoSkip.Value = Room.Settings.AutoSkip;

RoomUpdated?.Invoke();
}
Expand Down
9 changes: 2 additions & 7 deletions osu.Game/Online/Multiplayer/MultiplayerRoomSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public class MultiplayerRoomSettings : IEquatable<MultiplayerRoomSettings>
[Key(5)]
public TimeSpan AutoStartDuration { get; set; }

[Key(6)]
public bool AutoSkip { get; set; }

[IgnoreMember]
public bool AutoStartEnabled => AutoStartDuration != TimeSpan.Zero;

Expand All @@ -45,16 +42,14 @@ public bool Equals(MultiplayerRoomSettings? other)
&& PlaylistItemId == other.PlaylistItemId
&& MatchType == other.MatchType
&& QueueMode == other.QueueMode
&& AutoStartDuration == other.AutoStartDuration
&& AutoSkip == other.AutoSkip;
&& AutoStartDuration == other.AutoStartDuration;
}

public override string ToString() => $"Name:{Name}"
+ $" Password:{(string.IsNullOrEmpty(Password) ? "no" : "yes")}"
+ $" Type:{MatchType}"
+ $" Item:{PlaylistItemId}"
+ $" Queue:{QueueMode}"
+ $" Start:{AutoStartDuration}"
+ $" AutoSkip:{AutoSkip}";
+ $" Start:{AutoStartDuration}";
}
}
5 changes: 0 additions & 5 deletions osu.Game/Online/Rooms/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ private int? maxAttempts
set => MaxAttempts.Value = value;
}

[Cached]
[JsonProperty("auto_skip")]
public readonly Bindable<bool> AutoSkip = new Bindable<bool>();

public Room()
{
Password.BindValueChanged(p => HasPassword.Value = !string.IsNullOrEmpty(p.NewValue));
Expand Down Expand Up @@ -199,7 +195,6 @@ public void CopyFrom(Room other)
DifficultyRange.Value = other.DifficultyRange.Value;
PlaylistItemStats.Value = other.PlaylistItemStats.Value;
CurrentPlaylistItem.Value = other.CurrentPlaylistItem.Value;
AutoSkip.Value = other.AutoSkip.Value;

if (EndDate.Value != null && DateTimeOffset.Now >= EndDate.Value)
Status.Value = new RoomStatusEnded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ protected class MatchSettings : OnlinePlayComposite
public MatchTypePicker TypePicker;
public OsuEnumDropdown<QueueMode> QueueModeDropdown;
public OsuTextBox PasswordTextBox;
public OsuCheckbox AutoSkipCheckbox;
public TriangleButton ApplyButton;

public OsuSpriteText ErrorText;
Expand Down Expand Up @@ -250,13 +249,6 @@ private void load(OverlayColourProvider colourProvider, OsuColour colours)
LengthLimit = 255,
},
},
new Section("Other")
{
Child = AutoSkipCheckbox = new OsuCheckbox
{
LabelText = "Automatically skip the beatmap intro"
}
}
}
}
},
Expand Down Expand Up @@ -351,7 +343,6 @@ private void load(OverlayColourProvider colourProvider, OsuColour colours)
Password.BindValueChanged(password => PasswordTextBox.Text = password.NewValue ?? string.Empty, true);
QueueMode.BindValueChanged(mode => QueueModeDropdown.Current.Value = mode.NewValue, true);
AutoStartDuration.BindValueChanged(duration => startModeDropdown.Current.Value = (StartMode)(int)duration.NewValue.TotalSeconds, true);
AutoSkip.BindValueChanged(autoSkip => AutoSkipCheckbox.Current.Value = autoSkip.NewValue, true);

operationInProgress.BindTo(ongoingOperationTracker.InProgress);
operationInProgress.BindValueChanged(v =>
Expand Down Expand Up @@ -399,8 +390,7 @@ private void apply()
password: PasswordTextBox.Text,
matchType: TypePicker.Current.Value,
queueMode: QueueModeDropdown.Current.Value,
autoStartDuration: autoStartDuration,
autoSkip: AutoSkipCheckbox.Current.Value)
autoStartDuration: autoStartDuration)
.ContinueWith(t => Schedule(() =>
{
if (t.IsCompletedSuccessfully)
Expand All @@ -416,7 +406,6 @@ private void apply()
room.Password.Value = PasswordTextBox.Current.Value;
room.QueueMode.Value = QueueModeDropdown.Current.Value;
room.AutoStartDuration.Value = autoStartDuration;
room.AutoSkip.Value = AutoSkipCheckbox.Current.Value;

if (int.TryParse(MaxParticipantsField.Text, out int max))
room.MaxParticipants.Value = max;
Expand Down
3 changes: 1 addition & 2 deletions osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public MultiplayerPlayer(Room room, PlaylistItem playlistItem, MultiplayerRoomUs
{
AllowPause = false,
AllowRestart = false,
AllowSkipping = room.AutoSkip.Value,
AutomaticallySkipIntro = room.AutoSkip.Value
AllowSkipping = false,
})
{
this.users = users;
Expand Down
3 changes: 0 additions & 3 deletions osu.Game/Screens/OnlinePlay/OnlinePlayComposite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ public class OnlinePlayComposite : CompositeDrawable
[Resolved(typeof(Room))]
protected Bindable<TimeSpan> AutoStartDuration { get; private set; }

[Resolved(typeof(Room))]
protected Bindable<bool> AutoSkip { get; private set; }

[Resolved(CanBeNull = true)]
private IBindable<PlaylistItem> subScreenSelectedItem { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/PlayerLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private void prepareNewPlayer()
return;

CurrentPlayer = createPlayer();
CurrentPlayer.Configuration.AutomaticallySkipIntro |= quickRestart;
CurrentPlayer.Configuration.AutomaticallySkipIntro = quickRestart;
CurrentPlayer.RestartCount = restartCount++;
CurrentPlayer.RestartRequested = restartRequested;

Expand Down

0 comments on commit d108ec2

Please sign in to comment.