4using System.Threading.Tasks;
19 public string Name =>
"engine";
22 public string HelpText =>
"Displays the running engine version. Use --active for the version used in future deployments";
45 this.watchdog =
watchdog ??
throw new ArgumentNullException(nameof(
watchdog));
49 public ValueTask<MessageContent>
Invoke(
string arguments,
ChatUser user, CancellationToken cancellationToken)
52 if (arguments.Split(
' ').Any(x => x.Equals(
"--active", StringComparison.OrdinalIgnoreCase)))
57 return ValueTask.FromResult(
60 Text =
"Server offline!",
64 return ValueTask.FromResult(
74 if (engineVersion ==
null)
78 text = engineVersion.
Engine!.Value
switch
80 EngineType.OpenDream => $
"OpenDream: {engineVersion.SourceSHA}",
81 EngineType.Byond => $
"BYOND {engineVersion.Version!.Major}.{engineVersion.Version.Minor}",
82 _ =>
throw new InvalidOperationException($
"Invalid EngineType: {engineVersion.Engine.Value}"),
86 text += $
" (Custom Upload #{engineVersion.CustomIteration.Value})";
89 return ValueTask.FromResult(
Information about an engine installation.
static EngineVersion Parse(string input)
Parses a stringified EngineVersion.
EngineType? Engine
The EngineType.
int? CustomIteration
The revision of the custom build.
Represents a tgs_chat_user datum.
For displaying the installed Byond version.
bool AdminOnly
If the command should only be available to ChatUsers who's ChatUser.Channel has ChannelRepresentation...
readonly IEngineManager engineManager
The IEngineManager for the EngineCommand.
string Name
The text to invoke the command. May not be "?" or "help" (case-insensitive).
ValueTask< MessageContent > Invoke(string arguments, ChatUser user, CancellationToken cancellationToken)
Invoke the ICommand.A ValueTask<TResult> resulting in a MessageContent to send to the invoker.
string HelpText
The help text to display when queires are made about the command.
readonly IWatchdog watchdog
The IWatchdog for the EngineCommand.
EngineCommand(IEngineManager engineManager, IWatchdog watchdog)
Initializes a new instance of the EngineCommand class.
Represents a message to send to a chat provider.
Represents a command that can be invoked by talking to chat bots.
For managing the engine installations.
EngineVersion? ActiveVersion
The currently active EngineVersion.
Runs and monitors the twin server controllers.
Models.? CompileJob ActiveCompileJob
Retrieves the Models.CompileJob currently running on the server.
WatchdogStatus Status
The current WatchdogStatus.
WatchdogStatus
The current status of the watchdog.