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,37 @@
namespace MoonlightServers.Daemon.ServerSystem;
public partial class Server
{
public async Task DeleteAsync()
{
await Lock.WaitAsync();
try
{
if(State != ServerState.Offline)
throw new InvalidOperationException("Server is not offline");
Logger.LogTrace("Deleting");
InstallStorage ??= await InstallStorageService.FindAsync(Uuid);
if (InstallStorage != null)
{
Logger.LogTrace("Deleting install storage");
await InstallStorageService.DeleteAsync(InstallStorage);
}
RuntimeStorage ??= await RuntimeStorageService.FindAsync(Uuid);
if (RuntimeStorage != null)
{
Logger.LogTrace("Deleting runtime storage");
await RuntimeStorageService.DeleteAsync(RuntimeStorage);
}
}
finally
{
Lock.Release();
}
}
}