tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
JobCodeExtensions.cs
Go to the documentation of this file.
1using System;
2
4
6{
10 public static class JobCodeExtensions
11 {
17 public static bool IsServerStartupJob(this JobCode jobCode)
18 => jobCode switch
19 {
20 JobCode.Unknown or JobCode.Move or JobCode.RepositoryClone or JobCode.RepositoryUpdate or JobCode.RepositoryAutoUpdate or JobCode.RepositoryDelete or JobCode.EngineOfficialInstall or JobCode.EngineCustomInstall or JobCode.EngineDelete or JobCode.Deployment or JobCode.AutomaticDeployment or JobCode.WatchdogLaunch or JobCode.WatchdogRestart or JobCode.WatchdogDump => false,
21 JobCode.StartupWatchdogLaunch or JobCode.StartupWatchdogReattach or JobCode.ReconnectChatBot => true,
22 _ => throw new InvalidOperationException($"Invalid JobCode: {jobCode}"),
23 };
24 }
25}
Extension methods for the JobCode enum.
static bool IsServerStartupJob(this JobCode jobCode)
If a given jobCode can be triggered by TGS startup.
JobCode
The different types of Response.JobResponse.
Definition JobCode.cs:9