Updated Filestore. Finished Auth and Install Services. Introduced GameOptions and BaseConfig. Adjusted Settings Service to reflect.
This commit is contained in:
7
AlayaCore/Abstractions/Configuration/BaseConfig.cs
Normal file
7
AlayaCore/Abstractions/Configuration/BaseConfig.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Abstractions.Configuration
|
||||||
|
{
|
||||||
|
public class BaseConfig
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Abstractions/Interfaces/IFileStore.cs
Normal file
7
AlayaCore/Abstractions/Interfaces/IFileStore.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Abstractions.Interfaces
|
||||||
|
{
|
||||||
|
public interface IFileStore
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Abstractions.Interfaces.Services
|
||||||
|
{
|
||||||
|
public interface IAuthService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Models/AlayaPath.cs
Normal file
7
AlayaCore/Models/AlayaPath.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Models
|
||||||
|
{
|
||||||
|
public class AlayaPath
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Models/Configuration/GameOptions.cs
Normal file
7
AlayaCore/Models/Configuration/GameOptions.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Models.Configuration
|
||||||
|
{
|
||||||
|
public class GameOptions
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Services/AuthService.cs
Normal file
7
AlayaCore/Services/AuthService.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Services
|
||||||
|
{
|
||||||
|
public class AuthService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Services/GameInstallService.cs
Normal file
7
AlayaCore/Services/GameInstallService.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Services
|
||||||
|
{
|
||||||
|
public class GameInstallService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
AlayaCore/Services/GameLaunchService.cs
Normal file
7
AlayaCore/Services/GameLaunchService.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Services
|
||||||
|
{
|
||||||
|
public class GameLaunchService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,
|
||||||
7
AlayaCore/Utilities/Enums/FolderLocation.cs
Normal file
7
AlayaCore/Utilities/Enums/FolderLocation.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace AlayaCore.Utilities.Enums
|
||||||
|
{
|
||||||
|
public class FolderLocation
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
25
AlayaCore/Utilities/Stores/LocalFileStore.cs
Normal file
25
AlayaCore/Utilities/Stores/LocalFileStore.cs
Normal 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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user