From f678d6c0d6476591f076f2ce9b17b9386423e341 Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Sun, 10 Jan 2021 18:52:15 +0000 Subject: [PATCH] Cybertweaks --- build/Version.props | 2 +- src/DMAPI/tgs.dm | 4 +++- .../Components/Events/EventType.cs | 2 +- .../Components/Watchdog/BasicWatchdog.cs | 2 +- .../Components/Watchdog/WatchdogBase.cs | 18 +++++++-------- .../PublishProfiles/FolderProfile.pubxml | 22 +++++++++++++++++++ 6 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 src/Tgstation.Server.Host/Properties/PublishProfiles/FolderProfile.pubxml diff --git a/build/Version.props b/build/Version.props index 44647f7611..7214e884f4 100644 --- a/build/Version.props +++ b/build/Version.props @@ -7,7 +7,7 @@ 2.2.0 8.2.0 9.1.1 - 5.2.10 + 5.2.11 1.1.0 1.2.0 diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index 3225f14d8c..e1eac9f291 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "5.2.10" +#define TGS_DMAPI_VERSION "5.2.11" // All functions and datums outside this document are subject to change with any version and should not be relied on. @@ -97,6 +97,8 @@ #define TGS_EVENT_WATCHDOG_DETACH 16 // We don't actually implement this value as the DMAPI can never receive it // #define TGS_EVENT_WATCHDOG_LAUNCH 17 +// Same here. We don't actually implement this value as the DMAPI can never receive it +// #define TGS_EVENT_WORLD_END_PROCESS 18 // OTHER ENUMS diff --git a/src/Tgstation.Server.Host/Components/Events/EventType.cs b/src/Tgstation.Server.Host/Components/Events/EventType.cs index 4e20113171..f22c1db8e0 100644 --- a/src/Tgstation.Server.Host/Components/Events/EventType.cs +++ b/src/Tgstation.Server.Host/Components/Events/EventType.cs @@ -114,7 +114,7 @@ namespace Tgstation.Server.Host.Components.Events WatchdogLaunch, /// - /// Inbetween DD restarts if the process has been force-ended by the DMAPI (TgsEndProcess()) + /// In between DD restarts if the process has been force-ended by the DMAPI (TgsEndProcess()) /// [EventScript("WorldEndProcess")] WorldEndProcess, diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs index 4a83eab388..433680a941 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs @@ -93,7 +93,7 @@ namespace Tgstation.Server.Host.Components.Watchdog { case MonitorActivationReason.ActiveServerCrashed: if (Server.TerminationWasRequested) - await eventConsumer.HandleEvent(EventType.WorldEndProcess, Enumerable.Empty(), cancellationToken).ConfigureAwait(false); + await EventConsumer.HandleEvent(EventType.WorldEndProcess, Enumerable.Empty(), cancellationToken).ConfigureAwait(false); string exitWord = Server.TerminationWasRequested ? "exited" : "crashed"; if (Server.RebootState == Session.RebootState.Shutdown) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index e1c8336752..f6a7ed6160 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -83,6 +83,11 @@ namespace Tgstation.Server.Host.Components.Watchdog /// protected IAsyncDelayer AsyncDelayer { get; } + /// + /// The that is not the + /// + protected IEventConsumer EventConsumer { get; } + /// /// The for the . /// @@ -118,11 +123,6 @@ namespace Tgstation.Server.Host.Components.Watchdog /// readonly IIOManager diagnosticsIOManager; - /// - /// The that is not the - /// - public IEventConsumer eventConsumer; - /// /// The for the . /// @@ -179,7 +179,7 @@ namespace Tgstation.Server.Host.Components.Watchdog /// The to populate with /// The value of . /// The value of . - /// The value of . + /// The value of . /// The value of . /// The value of /// The initial value of . May be modified @@ -208,7 +208,7 @@ namespace Tgstation.Server.Host.Components.Watchdog this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); AsyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); this.diagnosticsIOManager = diagnosticsIOManager ?? throw new ArgumentNullException(nameof(diagnosticsIOManager)); - this.eventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); + EventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); this.remoteDeploymentManagerFactory = remoteDeploymentManagerFactory ?? throw new ArgumentNullException(nameof(remoteDeploymentManagerFactory)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); ActiveLaunchParameters = initialLaunchParameters ?? throw new ArgumentNullException(nameof(initialLaunchParameters)); @@ -267,7 +267,7 @@ namespace Tgstation.Server.Host.Components.Watchdog return; if (!graceful) { - var eventTask = eventConsumer.HandleEvent(releaseServers ? EventType.WatchdogDetach : EventType.WatchdogShutdown, null, cancellationToken); + var eventTask = EventConsumer.HandleEvent(releaseServers ? EventType.WatchdogDetach : EventType.WatchdogShutdown, null, cancellationToken); var chatTask = announce ? Chat.QueueWatchdogMessage("Shutting down...", cancellationToken) : Task.CompletedTask; @@ -378,7 +378,7 @@ namespace Tgstation.Server.Host.Components.Watchdog cancellationToken); // simple announce if (reattachInfo == null) announceTask = Task.WhenAll( - eventConsumer.HandleEvent(EventType.WatchdogLaunch, Enumerable.Empty(), cancellationToken), + EventConsumer.HandleEvent(EventType.WatchdogLaunch, Enumerable.Empty(), cancellationToken), announceTask); } else diff --git a/src/Tgstation.Server.Host/Properties/PublishProfiles/FolderProfile.pubxml b/src/Tgstation.Server.Host/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000000..a23e825bed --- /dev/null +++ b/src/Tgstation.Server.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,22 @@ + + + + + FileSystem + FileSystem + Release + Any CPU + + True + False + netcoreapp3.1 + linux-x64 + 2b69ad6d-2b5a-4023-8ead-0bd1b18e028a + false + bin\Release\netcoreapp3.1\publish\ + False + + \ No newline at end of file