tgstation-server
The /tg/station 13 server suite
DeadSessionController.cs
Go to the documentation of this file.
1 using System;
2 using System.Threading;
3 using System.Threading.Tasks;
4 
5 namespace Tgstation.Server.Host.Components.Watchdog
6 {
11  {
13  public Task<LaunchResult> LaunchResult { get; }
14 
16  public bool IsPrimary => false;
17 
19  public bool TerminationWasRequested => false;
20 
22  public ApiValidationStatus ApiValidationStatus => throw new NotSupportedException();
23 
25  public IDmbProvider Dmb { get; }
26 
28  public ushort? Port => null;
29 
31  public bool ClosePortOnReboot
32  {
33  get => false;
34  set => throw new NotSupportedException();
35  }
36 
38  public RebootState RebootState => throw new NotSupportedException();
39 
41  public Task OnReboot { get; }
42 
44  public Task<int> Lifetime { get; }
45 
49  bool disposed;
50 
55  public DeadSessionController(IDmbProvider dmbProvider)
56  {
57  Dmb = dmbProvider ?? throw new ArgumentNullException(nameof(dmbProvider));
58  LaunchResult = Task.FromResult(new LaunchResult
59  {
60  StartupTime = TimeSpan.FromSeconds(0)
61  });
62  Lifetime = Task.FromResult(-1);
63  OnReboot = new TaskCompletionSource<object>().Task;
64  }
65 
67  public void Dispose()
68  {
69  lock (this)
70  {
71  if (disposed)
72  return;
73  disposed = true;
74  }
75  Dmb.Dispose();
76  }
77 
79  public void EnableCustomChatCommands() => throw new NotSupportedException();
80 
82  public ReattachInformation Release() => throw new NotSupportedException();
83 
85  public void ResetRebootState() => throw new NotSupportedException();
86 
88  public Task<string> SendCommand(string command, CancellationToken cancellationToken) => throw new NotSupportedException();
89 
91  public void SetHighPriority() => throw new NotSupportedException();
92 
94  public Task<bool> SetPort(ushort newPort, CancellationToken cancellatonToken) => throw new NotSupportedException();
95 
97  public Task<bool> SetRebootState(RebootState newRebootState, CancellationToken cancellationToken) => throw new NotSupportedException();
98  }
99 }
Represents the result of trying to start a DD process
Definition: LaunchResult.cs:9
Handles communication with a DreamDaemon IProcess
Provides absolute paths to the latest compiled .dmbs
Definition: IDmbProvider.cs:9
DeadSessionController(IDmbProvider dmbProvider)
Construct a DeadSessionController
bool disposed
If the DeadSessionController was Disposed
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
Parameters necessary for duplicating a ISessionController session
ApiValidationStatus
Status of DMAPI validation