SessionControllers now manage chatJsonTrackingContext.Active

This commit is contained in:
Cyberboss
2018-09-25 13:46:50 -04:00
parent bead007972
commit d6ead4fdde
2 changed files with 11 additions and 0 deletions
@@ -88,5 +88,10 @@ namespace Tgstation.Server.Host.Components.Watchdog
/// Changes <see cref="RebootState"/> to <see cref="Components.Watchdog.RebootState.Normal"/> without telling the DMAPI
/// </summary>
void ResetRebootState();
/// <summary>
/// Enables the reading of custom chat commands from the <see cref="ISessionController"/>
/// </summary>
void EnableCustomChatCommands();
}
}
@@ -200,6 +200,8 @@ namespace Tgstation.Server.Host.Components.Watchdog
rebootTcs = new TaskCompletionSource<object>();
process.Lifetime.ContinueWith(x => chatJsonTrackingContext.Active = false, TaskScheduler.Current);
async Task<LaunchResult> GetLaunchResult()
{
var startTime = DateTimeOffset.Now;
@@ -353,6 +355,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
case Constants.DMCommandWorldReboot:
if (ClosePortOnReboot)
{
chatJsonTrackingContext.Active = false;
content = new Dictionary<string, int> { { Constants.DMParameterData, 0 } };
portClosedForReboot = true;
}
@@ -386,6 +389,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
throw new ObjectDisposedException(nameof(SessionController));
}
/// <inheritdoc />
public void EnableCustomChatCommands() => chatJsonTrackingContext.Active = true;
/// <inheritdoc />
public ReattachInformation Release()
{