mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-08-16 21:31:45 +02:00
.config
.run
.workdir
Agent
Common
Phantom.Common.Data
Agent
Instance
Java
Minecraft
Replies
ConfigureInstanceResult.cs
LaunchInstanceResult.cs
RegisterAgentFailure.cs
SendCommandToInstanceResult.cs
StopInstanceResult.cs
AllowedPorts.cs
Phantom.Common.Data.csproj
RamAllocationUnits.cs
Phantom.Common.Data.Tests
Phantom.Common.Logging
Phantom.Common.Messages
Docker
Server
Utils
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
PhantomPanel.sln
global.json
22 lines
763 B
C#
22 lines
763 B
C#
namespace Phantom.Common.Data.Replies;
|
|
|
|
public enum SendCommandToInstanceResult {
|
|
Success,
|
|
InstanceDoesNotExist,
|
|
AgentShuttingDown,
|
|
AgentCommunicationError,
|
|
UnknownError
|
|
}
|
|
|
|
public static class SendCommandToInstanceResultExtensions {
|
|
public static string ToSentence(this SendCommandToInstanceResult reason) {
|
|
return reason switch {
|
|
SendCommandToInstanceResult.Success => "Command sent.",
|
|
SendCommandToInstanceResult.InstanceDoesNotExist => "Instance does not exist.",
|
|
SendCommandToInstanceResult.AgentShuttingDown => "Agent is shutting down.",
|
|
SendCommandToInstanceResult.AgentCommunicationError => "Agent did not reply in time.",
|
|
_ => "Unknown error."
|
|
};
|
|
}
|
|
}
|