first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
using NitroxModel.Discovery.InstallationFinders.Core;
using NitroxModel.Helper;
using static NitroxModel.Discovery.InstallationFinders.Core.GameFinderResult;
namespace NitroxModel.Discovery.InstallationFinders;
/// <summary>
/// Tries to read a local config value that contains the installation directory.
/// </summary>
public sealed class ConfigFinder : IGameFinder
{
public GameFinderResult FindGame(GameInfo gameInfo)
{
string path = NitroxUser.PreferredGamePath;
if (string.IsNullOrEmpty(path))
{
return Error("Configured game path was found empty. Please enter the path to the game installation");
}
if (!GameInstallationHelper.HasValidGameFolder(path, gameInfo))
{
return Error($"Game installation directory config '{path}' is invalid. Please enter the path to the '{gameInfo.Name}' installation");
}
return Ok(path);
}
}