mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 15:57:24 +08:00
parent
c88045dfc7
commit
5898a9986b
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
@ -181,7 +180,7 @@ namespace osu.Game.Tournament.IPC
|
|||||||
/// <returns>Whether an IPC directory was successfully auto-detected.</returns>
|
/// <returns>Whether an IPC directory was successfully auto-detected.</returns>
|
||||||
public bool AutoDetectIPCLocation() => SetIPCLocation(findStablePath());
|
public bool AutoDetectIPCLocation() => SetIPCLocation(findStablePath());
|
||||||
|
|
||||||
private static bool ipcFileExistsInDirectory([NotNullWhen(true)] string? p) => p != null && File.Exists(Path.Combine(p, "ipc.txt"));
|
private static bool ipcFileExistsInDirectory(string? p) => p != null && File.Exists(Path.Combine(p, "ipc.txt"));
|
||||||
|
|
||||||
private string? findStablePath()
|
private string? findStablePath()
|
||||||
{
|
{
|
||||||
@ -202,7 +201,7 @@ namespace osu.Game.Tournament.IPC
|
|||||||
string? stableInstallPath = Environment.GetEnvironmentVariable("OSU_STABLE_PATH");
|
string? stableInstallPath = Environment.GetEnvironmentVariable("OSU_STABLE_PATH");
|
||||||
|
|
||||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||||
return stableInstallPath;
|
return stableInstallPath!;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user