mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Simplify method of marking players as playing in test scenes
This commit is contained in:
@ -12,6 +12,7 @@ using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer.Spectate;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Beatmaps.IO;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -47,8 +48,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("start players silently", () =>
|
||||
{
|
||||
Client.CurrentMatchPlayingUserIds.Add(PLAYER_1_ID);
|
||||
Client.CurrentMatchPlayingUserIds.Add(PLAYER_2_ID);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_1_ID }, true);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_2_ID }, true);
|
||||
|
||||
playingUserIds.Add(PLAYER_1_ID);
|
||||
playingUserIds.Add(PLAYER_2_ID);
|
||||
});
|
||||
@ -264,7 +266,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
foreach (int id in userIds)
|
||||
{
|
||||
Client.CurrentMatchPlayingUserIds.Add(id);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = id }, true);
|
||||
|
||||
SpectatorClient.StartPlay(id, beatmapId ?? importedBeatmapId);
|
||||
playingUserIds.Add(id);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -53,10 +54,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
var playable = Beatmap.Value.GetPlayableBeatmap(Ruleset.Value);
|
||||
|
||||
foreach (var user in users)
|
||||
{
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
|
||||
|
||||
// Todo: This is REALLY bad.
|
||||
Client.CurrentMatchPlayingUserIds.AddRange(users);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true);
|
||||
}
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
Reference in New Issue
Block a user