mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
Move all endpoint information to a configuration class
This commit is contained in:
@ -30,6 +30,7 @@ using osu.Game.Database;
|
||||
using osu.Game.Input;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.RealtimeMultiplayer;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Overlays;
|
||||
@ -54,6 +55,8 @@ namespace osu.Game
|
||||
|
||||
public const int SAMPLE_CONCURRENCY = 6;
|
||||
|
||||
public bool UseDevelopmentServer { get; }
|
||||
|
||||
protected OsuConfigManager LocalConfig;
|
||||
|
||||
protected BeatmapManager BeatmapManager;
|
||||
@ -132,6 +135,7 @@ namespace osu.Game
|
||||
|
||||
public OsuGameBase()
|
||||
{
|
||||
UseDevelopmentServer = DebugUtils.IsDebugBuild;
|
||||
Name = @"osu!lazer";
|
||||
}
|
||||
|
||||
@ -170,7 +174,7 @@ namespace osu.Game
|
||||
dependencies.Cache(largeStore);
|
||||
|
||||
dependencies.CacheAs(this);
|
||||
dependencies.Cache(LocalConfig);
|
||||
dependencies.CacheAs(LocalConfig);
|
||||
|
||||
AddFont(Resources, @"Fonts/osuFont");
|
||||
|
||||
@ -210,10 +214,12 @@ namespace osu.Game
|
||||
}
|
||||
});
|
||||
|
||||
dependencies.CacheAs(API ??= new APIAccess(LocalConfig));
|
||||
EndpointConfiguration endpoints = UseDevelopmentServer ? (EndpointConfiguration)new DevelopmentEndpointConfiguration() : new ProductionEndpointConfiguration();
|
||||
|
||||
dependencies.CacheAs(spectatorStreaming = new SpectatorStreamingClient());
|
||||
dependencies.CacheAs(multiplayerClient = new RealtimeMultiplayerClient());
|
||||
dependencies.CacheAs(API ??= new APIAccess(LocalConfig, endpoints));
|
||||
|
||||
dependencies.CacheAs(spectatorStreaming = new SpectatorStreamingClient(endpoints));
|
||||
dependencies.CacheAs(multiplayerClient = new RealtimeMultiplayerClient(endpoints));
|
||||
|
||||
var defaultBeatmap = new DummyWorkingBeatmap(Audio, Textures);
|
||||
|
||||
@ -369,7 +375,9 @@ namespace osu.Game
|
||||
// may be non-null for certain tests
|
||||
Storage ??= host.Storage;
|
||||
|
||||
LocalConfig ??= new OsuConfigManager(Storage);
|
||||
LocalConfig ??= UseDevelopmentServer
|
||||
? new DevelopmentOsuConfigManager(Storage)
|
||||
: new OsuConfigManager(Storage);
|
||||
}
|
||||
|
||||
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
|
||||
|
Reference in New Issue
Block a user