Updated Filestore. Finished Auth and Install Services. Introduced GameOptions and BaseConfig. Adjusted Settings Service to reflect.

This commit is contained in:
2026-04-06 11:41:03 +01:00
parent 823ccf4b87
commit c148672c08
12 changed files with 103 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Abstractions.Configuration
{
public class BaseConfig
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Abstractions.Interfaces
{
public interface IFileStore
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Abstractions.Interfaces.Services
{
public interface IAuthService
{
}
}

View File

@@ -0,0 +1,13 @@
using System.Threading;
using System.Threading.Tasks;
using AlayaCore.Installation;
using AlayaCore.Models.Manifests;
namespace AlayaCore.Abstractions.Interfaces.Services
{
public interface IMinecraftService
{
Task EnsureMinecraftInstalledAsync(ManifestModel manifest, InstallEnvironment environment, CancellationToken cancellationToken);
Task EnsureNeoForgeInstalledAsync(ManifestModel manifest, InstallEnvironment environment, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Models
{
public class AlayaPath
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Models.Configuration
{
public class GameOptions
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Services
{
public class AuthService
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Services
{
public class GameInstallService
{
}
}

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Services
{
public class GameLaunchService
{
}
}

View File

@@ -106,8 +106,8 @@ namespace AlayaCore.Services
bytesPerSecond: null, bytesPerSecond: null,
statusMessage: "Starting download...")); statusMessage: "Starting download..."));
using Stream responseStream = await response.Content.ReadAsStreamAsync(); await using Stream responseStream = await response.Content.ReadAsStreamAsync();
using FileStream fileStream = new FileStream( await using FileStream fileStream = new FileStream(
tempFilePath, tempFilePath,
FileMode.Create, FileMode.Create,
FileAccess.Write, FileAccess.Write,

View File

@@ -0,0 +1,7 @@
namespace AlayaCore.Utilities.Enums
{
public class FolderLocation
{
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.IO;
using AlayaCore.Abstractions.Interfaces;
using AlayaCore.Utilities.Enums;
namespace AlayaCore.Utilities.Stores
{
public class FileStore : IFileStore
{
private static readonly string _baseDirectory = AppContext.BaseDirectory;
private static readonly string _javaDirectory = Path.Combine(_baseDirectory, "Java");
private static readonly Dictionary<FolderLocation, string> _folders = new()
{
{ FolderLocation.BaseDirectory, _baseDirectory },
{ FolderLocation.Java, _javaDirectory}
};
public string Get(FolderLocation location)
{
return _folders[location];
}
}
}