mirror of
https://github.com/ppy/osu.git
synced 2026-05-30 01:10:58 +08:00
Merge pull request #35909 from smoogipoo/fix-vote-to-skip
Adjust vote-to-skip messaging flow to be explicit about states
This commit is contained in:
@@ -153,7 +153,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
/// <summary>
|
||||
/// Signals that a user has requested to skip the beatmap intro.
|
||||
/// </summary>
|
||||
Task UserVotedToSkipIntro(int userId);
|
||||
Task UserVotedToSkipIntro(int userId, bool voted);
|
||||
|
||||
/// <summary>
|
||||
/// Signals that the vote to skip the beatmap intro has passed.
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
public event Action<int, long>? MatchmakingItemDeselected;
|
||||
public event Action<MatchRoomState>? MatchRoomStateChanged;
|
||||
|
||||
public event Action<int>? UserVotedToSkipIntro;
|
||||
public event Action<int, bool>? UserVotedToSkipIntro;
|
||||
public event Action? VoteToSkipIntroPassed;
|
||||
|
||||
public event Action<MultiplayerRoomUser, BeatmapAvailability>? BeatmapAvailabilityChanged;
|
||||
@@ -854,10 +854,6 @@ namespace osu.Game.Online.Multiplayer
|
||||
handleRoomRequest(() =>
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
foreach (var user in Room.Users)
|
||||
user.VotedToSkipIntro = false;
|
||||
|
||||
GameplayStarted?.Invoke();
|
||||
});
|
||||
|
||||
@@ -928,7 +924,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Task IMultiplayerClient.UserVotedToSkipIntro(int userId)
|
||||
Task IMultiplayerClient.UserVotedToSkipIntro(int userId, bool voted)
|
||||
{
|
||||
handleRoomRequest(() =>
|
||||
{
|
||||
@@ -940,9 +936,8 @@ namespace osu.Game.Online.Multiplayer
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
user.VotedToSkipIntro = true;
|
||||
|
||||
UserVotedToSkipIntro?.Invoke(userId);
|
||||
user.VotedToSkipIntro = voted;
|
||||
UserVotedToSkipIntro?.Invoke(userId, voted);
|
||||
});
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
connection.On<MultiplayerPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemAdded), ((IMultiplayerClient)this).PlaylistItemAdded);
|
||||
connection.On<long>(nameof(IMultiplayerClient.PlaylistItemRemoved), ((IMultiplayerClient)this).PlaylistItemRemoved);
|
||||
connection.On<MultiplayerPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemChanged), ((IMultiplayerClient)this).PlaylistItemChanged);
|
||||
connection.On<int>(nameof(IMultiplayerClient.UserVotedToSkipIntro), ((IMultiplayerClient)this).UserVotedToSkipIntro);
|
||||
connection.On<int, bool>(nameof(IMultiplayerClient.UserVotedToSkipIntro), ((IMultiplayerClient)this).UserVotedToSkipIntro);
|
||||
connection.On(nameof(IMultiplayerClient.VoteToSkipIntroPassed), ((IMultiplayerClient)this).VoteToSkipIntroPassed);
|
||||
|
||||
connection.On(nameof(IMatchmakingClient.MatchmakingQueueJoined), ((IMatchmakingClient)this).MatchmakingQueueJoined);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
private void onUserStateChanged(MultiplayerRoomUser user, MultiplayerUserState state) => Schedule(updateCount);
|
||||
|
||||
private void onUserVotedToSkipIntro(int userId) => Schedule(() =>
|
||||
private void onUserVotedToSkipIntro(int userId, bool voted) => Schedule(() =>
|
||||
{
|
||||
FadingContent.TriggerShow();
|
||||
updateCount();
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public async Task UserVoteToSkipIntro(int userId)
|
||||
{
|
||||
await ((IMultiplayerClient)this).UserVotedToSkipIntro(userId).ConfigureAwait(false);
|
||||
await ((IMultiplayerClient)this).UserVotedToSkipIntro(userId, true).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
protected override Task<MultiplayerRoom> CreateRoomInternal(MultiplayerRoom room)
|
||||
|
||||
Reference in New Issue
Block a user