Refactorings

This commit is contained in:
Dan Balasescu 2022-02-08 21:20:33 +09:00
parent c1766d8a41
commit 886d1d2df6
5 changed files with 16 additions and 13 deletions

View File

@ -160,7 +160,8 @@ namespace osu.Game.Tests.Visual.Gameplay
finish(SpectatingUserState.Failed); finish(SpectatingUserState.Failed);
checkPaused(false); // Should continue playing until out of frames checkPaused(false); // Should continue playing until out of frames
checkPaused(true); checkPaused(true); // And eventually stop after running out of frames and fail.
// Todo: Should check for + display a failed message.
} }
[Test] [Test]

View File

@ -98,8 +98,8 @@ namespace osu.Game.Online.Spectator
} }
else else
{ {
watchingUserStates.Clear();
playingUsers.Clear(); playingUsers.Clear();
watchingUserStates.Clear();
} }
}), true); }), true);
} }

View File

@ -69,17 +69,17 @@ namespace osu.Game.Overlays.Dashboard
{ {
var user = task.GetResultSafely(); var user = task.GetResultSafely();
if (user != null) if (user == null)
{ return;
Schedule(() =>
{
// user may no longer be playing.
if (!playingUsers.Contains(user.Id))
return;
userFlow.Add(createUserPanel(user)); Schedule(() =>
}); {
} // user may no longer be playing.
if (!playingUsers.Contains(user.Id))
return;
userFlow.Add(createUserPanel(user));
});
}); });
} }

View File

@ -216,6 +216,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
protected override void EndGameplay(int userId, SpectatorState state) protected override void EndGameplay(int userId, SpectatorState state)
{ {
// Allowed passed/failed users to complete their remaining replay frames.
// The failed state isn't really possible in multiplayer (yet?) but is added here just for safety in case it starts being used.
if (state.State == SpectatingUserState.Passed || state.State == SpectatingUserState.Failed) if (state.State == SpectatingUserState.Passed || state.State == SpectatingUserState.Failed)
return; return;

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play
public bool HasFailed { get; set; } public bool HasFailed { get; set; }
/// <summary> /// <summary>
/// Whether the user quit gameplay without either having either passed or failed. /// Whether the user quit gameplay without having either passed or failed.
/// </summary> /// </summary>
public bool HasQuit { get; set; } public bool HasQuit { get; set; }