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
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace TGS.Server.ChatCommands
{
/// <summary>
/// Retrieves the git SHA of the live DreamDaemon code
/// </summary>
sealed class RevisionCommand : ChatCommand
{
/// <summary>
/// Construct a <see cref="RevisionCommand"/>
/// </summary>
public RevisionCommand()
{
Keyword = "revision";
}
/// <inheritdoc />
protected override ExitCode Run(IList<string> parameters)
{
var res = Instance.LiveSha();
if (res == "UNKNOWN")
{
OutputProc(res);
return ExitCode.ServerError;
}
OutputProc(String.Format("^{0}", res));
return ExitCode.Normal;
}
/// <inheritdoc />
public override string GetHelpText()
{
return "Prints the current code revision of the repository (not the server)";
}
}
}