Split the service and server functions

This commit is contained in:
Cyberboss
2017-11-12 23:48:54 -05:00
parent 6e54f622de
commit 1372f2daea
55 changed files with 1112 additions and 1129 deletions
+44
View File
@@ -0,0 +1,44 @@
using System.Collections.Generic;
using TGS.Interface;
namespace TGS.Server.ChatCommands
{
/// <summary>
/// Retrieve the installed, staged, or latest availab
/// </summary>
sealed class ByondCommand : ChatCommand
{
/// <summary>
/// Construct a <see cref="ByondCommand"/>
/// </summary>
public ByondCommand()
{
Keyword = "byond";
}
/// <inheritdoc />
protected override ExitCode Run(IList<string> parameters)
{
var type = ByondVersion.Installed;
if (parameters.Count > 0)
if (parameters[0].ToLower() == "--staged")
type = ByondVersion.Staged;
else if (parameters[0].ToLower() == "--latest")
type = ByondVersion.Latest;
OutputProc(Instance.GetVersion(type) ?? "None");
return ExitCode.Normal;
}
/// <inheritdoc />
public override string GetHelpText()
{
return "Gets the specified BYOND version";
}
/// <inheritdoc />
public override string GetArgumentString()
{
return "[--staged|--latest]";
}
}
}