mirror of https://github.com/ppy/osu
Move stablestorage check to path selection screen
Also forced stablepath to be empty during auto detection so it checks other sources to load ipc from
This commit is contained in:
parent
59b006f9ac
commit
9bfdfbea43
|
@ -232,16 +232,15 @@ private string findFromEnvVar()
|
|||
|
||||
private string findFromJsonConfig()
|
||||
{
|
||||
Logger.Log("Trying to find stable through the json config");
|
||||
|
||||
if (tournamentStorage.Exists(stable_config))
|
||||
try
|
||||
{
|
||||
using (Stream stream = tournamentStorage.GetStream(stable_config, FileAccess.Read, FileMode.Open))
|
||||
using (var sr = new StreamReader(stream))
|
||||
{
|
||||
stableInfo = JsonConvert.DeserializeObject<StableInfo>(sr.ReadToEnd());
|
||||
Logger.Log("Trying to find stable through the json config");
|
||||
|
||||
if (!string.IsNullOrEmpty(stableInfo.StablePath.Value))
|
||||
return stableInfo.StablePath.Value;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -84,7 +84,6 @@ private void reload()
|
|||
{
|
||||
stableInfo.StablePath.BindValueChanged(_ =>
|
||||
{
|
||||
fileBasedIpc?.LocateStableStorage();
|
||||
Schedule(reload);
|
||||
});
|
||||
sceneManager.SetScreen(new StablePathSelectScreen());
|
||||
|
|
|
@ -142,6 +142,7 @@ private void load(Storage storage, OsuColour colours)
|
|||
private void changePath(Storage storage)
|
||||
{
|
||||
var target = directorySelector.CurrentDirectory.Value.FullName;
|
||||
Logger.Log($"Changing Stable CE location to {target}");
|
||||
|
||||
if (File.Exists(Path.Combine(target, "ipc.txt")))
|
||||
{
|
||||
|
@ -161,6 +162,8 @@ private void changePath(Storage storage)
|
|||
}));
|
||||
}
|
||||
|
||||
var fileBasedIpc = ipc as FileBasedIPC;
|
||||
fileBasedIpc?.LocateStableStorage();
|
||||
sceneManager?.SetScreen(typeof(SetupScreen));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -180,6 +183,7 @@ private void changePath(Storage storage)
|
|||
|
||||
private void autoDetect()
|
||||
{
|
||||
stableInfo.StablePath.Value = string.Empty; // This forces findStablePath() to look elsewhere.
|
||||
var fileBasedIpc = ipc as FileBasedIPC;
|
||||
fileBasedIpc?.LocateStableStorage();
|
||||
|
||||
|
|
Loading…
Reference in New Issue