Move all endpoint information to a configuration class

This commit is contained in:
Dean Herbert
2020-12-24 17:58:38 +09:00
parent e89583d732
commit eb795a2127
10 changed files with 124 additions and 29 deletions

View File

@ -81,6 +81,13 @@ namespace osu.Game.Online.Spectator
/// </summary>
public event Action<int, SpectatorState> OnUserFinishedPlaying;
private readonly string endpoint;
public SpectatorStreamingClient(EndpointConfiguration endpoints)
{
endpoint = endpoints.SpectatorEndpoint;
}
[BackgroundDependencyLoader]
private void load()
{
@ -104,12 +111,6 @@ namespace osu.Game.Online.Spectator
}
}
#if DEBUG
private const string endpoint = "https://dev.ppy.sh/spectator";
#else
private const string endpoint = "https://spectator.ppy.sh/spectator";
#endif
protected virtual async Task Connect()
{
if (connection != null)