Recreated plugin with new project template. Started implementing server system daemon

This commit is contained in:
2026-03-01 21:09:29 +01:00
parent f6b71f4de6
commit 52dbd13fb5
350 changed files with 2795 additions and 21553 deletions

View File

@@ -0,0 +1,13 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallConsole
{
public event Func<string, Task>? OnOutput;
public Task AttachAsync();
public Task WriteInputAsync(string value);
public Task ClearCacheAsync();
public Task<string[]> GetCacheAsync();
}

View File

@@ -0,0 +1,14 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallEnvironment : IAsyncDisposable
{
public IInstallStatistics Statistics { get; }
public IInstallConsole Console { get; }
public event Func<Task>? OnExited;
public Task<bool> IsRunningAsync();
public Task StartAsync();
public Task KillAsync();
}

View File

@@ -0,0 +1,18 @@
using MoonlightServers.Daemon.Models;
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallEnvironmentService
{
public Task<IInstallEnvironment?> FindAsync(string id);
public Task<IInstallEnvironment> CreateAsync(
string id,
RuntimeConfiguration runtimeConfiguration,
InstallConfiguration installConfiguration,
IInstallStorage installStorage,
IRuntimeStorage runtimeStorage
);
public Task DeleteAsync(IInstallEnvironment environment);
}

View File

@@ -0,0 +1,11 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallStatistics
{
public event Func<ServerStatistics, Task>? OnStatisticsReceived;
public Task AttachAsync();
public Task ClearCacheAsync();
public Task<ServerStatistics[]> GetCacheAsync();
}

View File

@@ -0,0 +1,6 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallStorage
{
public Task<string> GetHostPathAsync();
}

View File

@@ -0,0 +1,10 @@
using MoonlightServers.Daemon.Models;
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IInstallStorageService
{
public Task<IInstallStorage?> FindAsync(string id);
public Task<IInstallStorage> CreateAsync(string id, RuntimeConfiguration runtimeConfiguration, InstallConfiguration installConfiguration);
public Task DeleteAsync(IInstallStorage installStorage);
}

View File

@@ -0,0 +1,13 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeConsole
{
public event Func<string, Task>? OnOutput;
public Task AttachAsync();
public Task WriteInputAsync(string value);
public Task ClearCacheAsync();
public Task<string[]> GetCacheAsync();
}

View File

@@ -0,0 +1,14 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeEnvironment : IAsyncDisposable
{
public IRuntimeStatistics Statistics { get; }
public IRuntimeConsole Console { get; }
public event Func<Task>? OnExited;
public Task<bool> IsRunningAsync();
public Task StartAsync();
public Task KillAsync();
}

View File

@@ -0,0 +1,11 @@
using MoonlightServers.Daemon.Models;
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeEnvironmentService
{
public Task<IRuntimeEnvironment?> FindAsync(string id);
public Task<IRuntimeEnvironment> CreateAsync(string id, RuntimeConfiguration configuration, IRuntimeStorage runtimeStorage);
public Task UpdateAsync(IRuntimeEnvironment environment, RuntimeConfiguration configuration);
public Task DeleteAsync(IRuntimeEnvironment environment);
}

View File

@@ -0,0 +1,11 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeStatistics
{
public event Func<ServerStatistics, Task>? OnStatisticsReceived;
public Task AttachAsync();
public Task ClearCacheAsync();
public Task<ServerStatistics[]> GetCacheAsync();
}

View File

@@ -0,0 +1,6 @@
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeStorage
{
public Task<string> GetHostPathAsync();
}

View File

@@ -0,0 +1,11 @@
using MoonlightServers.Daemon.Models;
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
public interface IRuntimeStorageService
{
public Task<IRuntimeStorage?> FindAsync(string id);
public Task<IRuntimeStorage> CreateAsync(string id, RuntimeConfiguration configuration);
public Task UpdateAsync(IRuntimeStorage runtimeStorage, RuntimeConfiguration configuration);
public Task DeleteAsync(IRuntimeStorage runtimeStorage);
}