mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-22 08:42:44 +01:00
26 lines
1.0 KiB
C#
26 lines
1.0 KiB
C#
namespace Phantom.Common.Data.Instance;
|
|
|
|
public enum InstanceLaunchFailReason {
|
|
ServerPortNotAllowed,
|
|
ServerPortAlreadyInUse,
|
|
RconPortNotAllowed,
|
|
RconPortAlreadyInUse,
|
|
JavaRuntimeNotFound,
|
|
CouldNotDownloadMinecraftServer,
|
|
UnknownError
|
|
}
|
|
|
|
public static class InstanceLaunchFailReasonExtensions {
|
|
public static string ToSentence(this InstanceLaunchFailReason reason) {
|
|
return reason switch {
|
|
InstanceLaunchFailReason.ServerPortNotAllowed => "Server port not allowed.",
|
|
InstanceLaunchFailReason.ServerPortAlreadyInUse => "Server port already in use.",
|
|
InstanceLaunchFailReason.RconPortNotAllowed => "Rcon port not allowed.",
|
|
InstanceLaunchFailReason.RconPortAlreadyInUse => "Rcon port already in use.",
|
|
InstanceLaunchFailReason.JavaRuntimeNotFound => "Java runtime not found.",
|
|
InstanceLaunchFailReason.CouldNotDownloadMinecraftServer => "Could not download Minecraft server.",
|
|
_ => "Unknown error."
|
|
};
|
|
}
|
|
}
|