mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-30 22:34:04 +02:00
27 lines
964 B
C#
27 lines
964 B
C#
namespace Phantom.Server.Services.Instances;
|
|
|
|
public enum AddInstanceResult : byte {
|
|
UnknownError,
|
|
Success,
|
|
InstanceAlreadyExists,
|
|
InstanceNameMustNotBeEmpty,
|
|
InstanceMemoryMustNotBeZero,
|
|
AgentNotFound,
|
|
AgentInstanceLimitExceeded,
|
|
AgentMemoryLimitExceeded
|
|
}
|
|
|
|
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.AgentInstanceLimitExceeded => "Agent instance limit exceeded.",
|
|
AddInstanceResult.AgentMemoryLimitExceeded => "Agent memory limit exceeded.",
|
|
_ => "Unknown error."
|
|
};
|
|
}
|
|
}
|