1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-17 12:42:51 +02:00
Minecraft-Phantom-Panel/Server/Phantom.Server.Services/Instances/AddInstanceResult.cs

31 lines
1.1 KiB
C#

namespace Phantom.Server.Services.Instances;
public enum AddInstanceResult {
Success,
InstanceAlreadyExists,
InstanceNameMustNotBeEmpty,
InstanceMemoryMustNotBeZero,
AgentNotFound,
AgentShuttingDown,
AgentInstanceLimitExceeded,
AgentMemoryLimitExceeded,
AgentCommunicationError,
UnknownError
}
public static class AddInstanceResultExtensions {
public static string ToSentence(this AddInstanceResult reason) {
return reason switch {
AddInstanceResult.Success => "Success.",
AddInstanceResult.InstanceNameMustNotBeEmpty => "Instance name must not be empty.",
AddInstanceResult.InstanceMemoryMustNotBeZero => "Memory must not be 0 MB.",
AddInstanceResult.AgentNotFound => "Agent not found.",
AddInstanceResult.AgentShuttingDown => "Agent is shutting down.",
AddInstanceResult.AgentInstanceLimitExceeded => "Agent instance limit exceeded.",
AddInstanceResult.AgentMemoryLimitExceeded => "Agent memory limit exceeded.",
AddInstanceResult.AgentCommunicationError => "Agent did not reply in time.",
_ => "Unknown error."
};
}
}