From a0ead38496b9dcb9ead023729765c437e7902f95 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 9 Feb 2021 08:02:51 +0300 Subject: [PATCH] Prevent test spectator clients from attempting hub connections --- osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs | 7 +++++++ .../Multiplayer/TestSceneMultiplayerGameplayLeaderboard.cs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs index 4a0e1282c4..1e499f20cb 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs @@ -12,6 +12,7 @@ using osu.Framework.Testing; using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Online; +using osu.Game.Online.API; using osu.Game.Online.Spectator; using osu.Game.Replays.Legacy; using osu.Game.Rulesets.Osu; @@ -243,6 +244,12 @@ namespace osu.Game.Tests.Visual.Gameplay { } + protected override HubClientConnector CreateConnector(string name, string endpoint, IAPIProvider api) + { + // do not pass API to prevent attempting failing connections on an actual hub. + return base.CreateConnector(name, endpoint, null); + } + public void StartPlay(int beatmapId) { this.beatmapId = beatmapId; diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerGameplayLeaderboard.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerGameplayLeaderboard.cs index aab69d687a..b459cebdd7 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerGameplayLeaderboard.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerGameplayLeaderboard.cs @@ -13,6 +13,7 @@ using osu.Framework.Testing; using osu.Framework.Utils; using osu.Game.Database; using osu.Game.Online; +using osu.Game.Online.API; using osu.Game.Online.Spectator; using osu.Game.Replays.Legacy; using osu.Game.Rulesets.Osu.Scoring; @@ -105,6 +106,12 @@ namespace osu.Game.Tests.Visual.Multiplayer this.totalUsers = totalUsers; } + protected override HubClientConnector CreateConnector(string name, string endpoint, IAPIProvider api) + { + // do not pass API to prevent attempting failing connections on an actual hub. + return base.CreateConnector(name, endpoint, null); + } + public void Start(int beatmapId) { for (int i = 0; i < totalUsers; i++)