Remove PlayingUsers list from SpectatorClient

This commit is contained in:
Dan Balasescu
2022-01-26 00:21:54 +09:00
parent aa492270dd
commit 502e6af008
5 changed files with 19 additions and 68 deletions

View File

@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -42,7 +41,7 @@ namespace osu.Game.Tests.Visual.Spectator
{
OnNewFrames += (i, bundle) =>
{
if (PlayingUsers.Contains(i))
if (PlayingUserStates.ContainsKey(i))
lastReceivedUserFrames[i] = bundle.Frames[^1];
};
}
@ -65,7 +64,7 @@ namespace osu.Game.Tests.Visual.Spectator
/// <param name="userId">The user to end play for.</param>
public void EndPlay(int userId)
{
if (!PlayingUsers.Contains(userId))
if (!PlayingUserStates.ContainsKey(userId))
return;
((ISpectatorClient)this).UserFinishedPlaying(userId, new SpectatorState
@ -131,7 +130,7 @@ namespace osu.Game.Tests.Visual.Spectator
protected override Task WatchUserInternal(int userId)
{
// When newly watching a user, the server sends the playing state immediately.
if (PlayingUsers.Contains(userId))
if (PlayingUserStates.ContainsKey(userId))
sendPlayingState(userId);
return Task.CompletedTask;