From 0322b184fd4034e3ecb5f14cb221fc7ae7d424cc Mon Sep 17 00:00:00 2001 From: ChiaraBm Date: Tue, 15 Apr 2025 15:33:01 +0200 Subject: [PATCH] Added the ability to kill servers which are starting / online instantly --- MoonlightServers.Daemon/Abstractions/Server.Initialize.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MoonlightServers.Daemon/Abstractions/Server.Initialize.cs b/MoonlightServers.Daemon/Abstractions/Server.Initialize.cs index 57dfc21..f70e262 100644 --- a/MoonlightServers.Daemon/Abstractions/Server.Initialize.cs +++ b/MoonlightServers.Daemon/Abstractions/Server.Initialize.cs @@ -45,6 +45,7 @@ public partial class Server StateMachine.Configure(ServerState.Starting) .Permit(ServerTrigger.Stop, ServerState.Stopping) // Allow stopping + .Permit(ServerTrigger.Kill, ServerState.Stopping) // Allow killing while starting .Permit(ServerTrigger.NotifyOnline, ServerState.Online) // Allow the server to report as online .Permit(ServerTrigger.NotifyRuntimeContainerDied, ServerState.Offline) // Allow server to handle container death .Permit(ServerTrigger.NotifyInternalError, ServerState.Offline) // Error handling for the action below @@ -53,6 +54,7 @@ public partial class Server StateMachine.Configure(ServerState.Online) .Permit(ServerTrigger.Stop, ServerState.Stopping) // Allow stopping + .Permit(ServerTrigger.Kill, ServerState.Stopping) // Allows killing .Permit(ServerTrigger.NotifyRuntimeContainerDied, ServerState.Offline) // Allow server to handle container death .OnExitFromAsync(ServerTrigger.NotifyRuntimeContainerDied, InternalCrash); // Define a runtime container death as a crash