mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 03:07:19 +08:00
Only watch local user to prevent conflict between testers
This commit is contained in:
parent
8508d5f8b9
commit
f5dbaa9b0f
@ -18,6 +18,7 @@ using osu.Framework.Testing;
|
|||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Spectator;
|
using osu.Game.Online.Spectator;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Replays.Legacy;
|
using osu.Game.Replays.Legacy;
|
||||||
@ -48,6 +49,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
private OsuSpriteText latencyDisplay;
|
private OsuSpriteText latencyDisplay;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private SpectatorStreamingClient streamingClient { get; set; }
|
private SpectatorStreamingClient streamingClient { get; set; }
|
||||||
|
|
||||||
@ -63,12 +67,20 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Add:
|
case NotifyCollectionChangedAction.Add:
|
||||||
foreach (int user in args.NewItems)
|
foreach (int user in args.NewItems)
|
||||||
streamingClient.WatchUser(user);
|
{
|
||||||
|
if (user == api.LocalUser.Value.Id)
|
||||||
|
streamingClient.WatchUser(user);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
foreach (int user in args.OldItems)
|
foreach (int user in args.OldItems)
|
||||||
streamingClient.StopWatchingUser(user);
|
{
|
||||||
|
if (user == api.LocalUser.Value.Id)
|
||||||
|
streamingClient.StopWatchingUser(user);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user