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,50 @@
using MoonlightServers.Daemon.Models;
namespace MoonlightServers.Daemon.Services;
public class ServerConfigurationService
{
public async Task<RuntimeConfiguration> GetRuntimeConfigurationAsync(string uuid)
{
return new RuntimeConfiguration(
new RuntimeLimitsConfig(400, null, 4096, null),
new RuntimeStorageConfig("local", [], 10240),
new RuntimeTemplateConfig(
"ghcr.io/pterodactyl/yolks:java_21",
"java -jar -Xmx{{SERVER_MEMORY}}M server.jar",
"stop",
["Done"]
),
new RuntimeNetworkConfig(
[],
null,
null,
new RuntimePortConfig("0.0.0.0", 25565),
[
new RuntimePortConfig("0.0.0.0", 25565)
]
),
new RuntimeEnvironmentConfig(
new Dictionary<string, string>()
{
{ "testy", "ytset" }
},
new Dictionary<string, string>()
{
{ "SERVER_MEMORY", "4096" },
{"MINECRAFT_VERSION", "latest"},
{"SERVER_JARFILE", "server.jar"}
}
)
);
}
public async Task<InstallConfiguration> GetInstallConfigurationAsync(string uuid)
{
return new InstallConfiguration(
"bash",
"installer",
await File.ReadAllTextAsync("/home/chiara/Documents/daemonScripts/install.sh")
);
}
}