mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
Merge pull request #68 from Cyberboss/stagedevent
Adds an event for when staged updates are applied
This commit is contained in:
@@ -49,6 +49,8 @@ namespace TGServerService
|
||||
bool compilationCancellationRequestation = false;
|
||||
bool canCancelCompilation = false;
|
||||
|
||||
bool UpdateStaged = false;
|
||||
|
||||
//deletes leftovers and checks current status
|
||||
void InitCompiler()
|
||||
{
|
||||
@@ -446,11 +448,14 @@ namespace TGServerService
|
||||
}
|
||||
}
|
||||
}
|
||||
var msg = String.Format("Compile complete!{0}", DaemonStatus() == TGDreamDaemonStatus.Offline ? "" : " Server will update next round.");
|
||||
var staged = DaemonStatus() != TGDreamDaemonStatus.Offline;
|
||||
var msg = String.Format("Compile complete!{0}", !staged ? "" : " Server will update next round.");
|
||||
SendMessage("DM: " + msg);
|
||||
TGServerService.WriteInfo(msg, TGServerService.EventID.DMCompileSuccess);
|
||||
lock (CompilerLock)
|
||||
{
|
||||
if (staged)
|
||||
UpdateStaged = true;
|
||||
lastCompilerError = null;
|
||||
compilerCurrentStatus = TGCompilerStatus.Initialized; //still fairly valid
|
||||
}
|
||||
|
||||
@@ -55,6 +55,14 @@ namespace TGServerService
|
||||
break;
|
||||
case SRWorldReboot:
|
||||
TGServerService.WriteInfo("World Rebooted", TGServerService.EventID.WorldReboot);
|
||||
lock (CompilerLock)
|
||||
{
|
||||
if (UpdateStaged)
|
||||
{
|
||||
UpdateStaged = false;
|
||||
TGServerService.WriteInfo("Staged update applied", TGServerService.EventID.ServerUpdateApplied);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace TGServerService
|
||||
RepoChangelogFail = 5700,
|
||||
ServiceShutdownFail = 6100,
|
||||
WorldReboot = 6200,
|
||||
ServerUpdateApplied = 6300,
|
||||
}
|
||||
|
||||
static TGServerService ActiveService; //So everyone else can write to our eventlog
|
||||
|
||||
Reference in New Issue
Block a user