Automatic Management Changes

- rearranged the options so they are grouped correctly.
- added RestartIfShutdown property to ServerApp and changed to use when checking to restart server.
This commit is contained in:
Brett Hewitson 2022-08-08 20:01:42 +10:00
parent d9571943ad
commit 5532050c04
20 changed files with 157 additions and 92 deletions

View file

@ -1221,7 +1221,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Schließt den Server in den Auto Aktualisierungszyklus ein</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Schließt den Server in den Auto Aktualisierungszyklus ein</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Wenn aktiviert, wird der Server während des automatischen Aktualisierungszyklus regelmäßig aktualisiert. Siehe die Einstellungen für die Optionen für die automatische Aktualisierung.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Wenn aktiviert, wird der Server während des automatischen Aktualisierungszyklus regelmäßig aktualisiert. Siehe die Einstellungen für die Optionen für die automatische Aktualisierung.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Startet den Server neu, wenn er heruntergefahren ist</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Startet den Server neu, wenn er heruntergefahren ist</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Wenn aktiviert, wird der Server neu gestartet, auch wenn er für automatische Neustarts und automatische Updates heruntergefahren wird.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Wenn aktiviert, wird der Server neu gestartet, auch wenn er für automatische Updates heruntergefahren wird.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -1318,7 +1318,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Include server in the Auto-Update cycle</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Include server in the Auto-Update cycle</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Restart server if shutdown</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Restart server if shutdown</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Restarts and Auto-Updates.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Updates.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -1316,7 +1316,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Inclure cycle de mise à jour automatique du serveur</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Inclure cycle de mise à jour automatique du serveur</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Si cette option est activée, le serveur sera périodiquement mis à jour pendant le cycle de mise à jour automatique. Voir les paramètres pour les options de mise à jour automatique.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Si cette option est activée, le serveur sera périodiquement mis à jour pendant le cycle de mise à jour automatique. Voir les paramètres pour les options de mise à jour automatique.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Redémarrer le serveur en cas d'arrêt</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Redémarrer le serveur en cas d'arrêt</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Si cette option est activée, le serveur sera redémarré même s'il est arrêté pour les redémarrages automatiques et les mises à jour automatiques.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Si cette option est activée, le serveur sera redémarré même s'il est arrêté pour les mises à jour automatiques.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -107,6 +107,7 @@ namespace ServerManagerTool.Lib
public bool OutputLogs { get; set; } = false; public bool OutputLogs { get; set; } = false;
public bool PerformWorldSave { get; set; } = Config.Default.ServerShutdown_EnableWorldSave; public bool PerformWorldSave { get; set; } = Config.Default.ServerShutdown_EnableWorldSave;
public ProgressDelegate ProgressCallback { get; set; } = null; public ProgressDelegate ProgressCallback { get; set; } = null;
public bool RestartIfShutdown { get; set; } = false;
public bool SendAlerts { get; set; } = false; public bool SendAlerts { get; set; } = false;
public bool SendEmails { get; set; } = false; public bool SendEmails { get; set; } = false;
public bool SendShutdownMessages { get; set; } = Config.Default.ServerShutdown_SendShutdownMessages; public bool SendShutdownMessages { get; set; } = Config.Default.ServerShutdown_SendShutdownMessages;
@ -332,7 +333,7 @@ namespace ServerManagerTool.Lib
// check if the server was previously running. // check if the server was previously running.
if (!_serverRunning) if (!_serverRunning)
{ {
if (_profile.AutoRestartIfShutdown) if (RestartIfShutdown)
{ {
LogProfileMessage("Server was not running, server will be started as the setting to restart if shutdown is TRUE."); LogProfileMessage("Server was not running, server will be started as the setting to restart if shutdown is TRUE.");
} }
@ -3295,7 +3296,8 @@ namespace ServerManagerTool.Lib
SendAlerts = SendAlerts, SendAlerts = SendAlerts,
SendEmails = SendEmails, SendEmails = SendEmails,
ServerProcess = ServerProcess, ServerProcess = ServerProcess,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = profile.AutoRestartIfShutdown,
}; };
app.PerformProfileUpdate(branch, profile); app.PerformProfileUpdate(branch, profile);
profileExitCodes.TryAdd(profile, app.ExitCode); profileExitCodes.TryAdd(profile, app.ExitCode);
@ -3316,7 +3318,8 @@ namespace ServerManagerTool.Lib
SendAlerts = SendAlerts, SendAlerts = SendAlerts,
SendEmails = SendEmails, SendEmails = SendEmails,
ServerProcess = ServerProcess, ServerProcess = ServerProcess,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = profile.AutoRestartIfShutdown,
}; };
app.PerformProfileUpdate(branch, profile); app.PerformProfileUpdate(branch, profile);
profileExitCodes.TryAdd(profile, app.ExitCode); profileExitCodes.TryAdd(profile, app.ExitCode);
@ -3483,7 +3486,8 @@ namespace ServerManagerTool.Lib
SendAlerts = true, SendAlerts = true,
SendEmails = true, SendEmails = true,
ServerProcess = type, ServerProcess = type,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = performRestart,
}; };
exitCode = app.PerformProfileShutdown(profile, performRestart, performUpdate ? ServerUpdateType.ServerAndMods : ServerUpdateType.None, true, false, CancellationToken.None); exitCode = app.PerformProfileShutdown(profile, performRestart, performUpdate ? ServerUpdateType.ServerAndMods : ServerUpdateType.None, true, false, CancellationToken.None);

View file

@ -1372,20 +1372,17 @@
<StackPanel Margin="-8,0,2,0"> <StackPanel Margin="-8,0,2,0">
<GroupBox Header="{DynamicResource ServerSettings_ASMSettingLabel}" Style="{StaticResource GroupBoxStyle}"> <GroupBox Header="{DynamicResource ServerSettings_ASMSettingLabel}" Style="{StaticResource GroupBoxStyle}">
<Grid> <StackPanel Orientation="Vertical">
<Grid.RowDefinitions> <Grid>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.Style> <Grid.Style>
<Style TargetType="{x:Type Grid}"> <Style TargetType="{x:Type Grid}">
@ -1400,15 +1397,14 @@
</Style> </Style>
</Grid.Style> </Grid.Style>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,0"> <cctl:CheckBoxAndTextBlock Grid.Row="0" Grid.Column="0" Margin="5,5,5,0" Text="{DynamicResource ServerSettings_AutoStartServerLabel}" VerticalAlignment="Bottom" IsChecked="{Binding EnableAutoStart, Mode=TwoWay}" ToolTip="{DynamicResource ServerSettings_AutoStartServerTooltip}" HorizontalAlignment="Left"/>
<cctl:CheckBoxAndTextBlock Text="{DynamicResource ServerSettings_AutoStartServerLabel}" VerticalAlignment="Bottom" IsChecked="{Binding EnableAutoStart, Mode=TwoWay}" ToolTip="{DynamicResource ServerSettings_AutoStartServerTooltip}" HorizontalAlignment="Left"/> <StackPanel Grid.Row="0" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal">
<RadioButton GroupName="AutoStartServer" Margin="10,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin, Converter={StaticResource InvertBooleanConverter}}" Content="{DynamicResource ServerSettings_AutoStartServerOnBootLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnBootTooltip}"/> <RadioButton GroupName="AutoStartServer" Margin="10,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin, Converter={StaticResource InvertBooleanConverter}}" Content="{DynamicResource ServerSettings_AutoStartServerOnBootLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnBootTooltip}"/>
<RadioButton GroupName="AutoStartServer" Margin="5,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin}" Content="{DynamicResource ServerSettings_AutoStartServerOnLoginLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnLoginTooltip}"/> <RadioButton GroupName="AutoStartServer" Margin="5,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin}" Content="{DynamicResource ServerSettings_AutoStartServerOnLoginLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnLoginTooltip}"/>
</StackPanel> </StackPanel>
<cctl:CheckBoxAndTextBlock Grid.Row="1" Grid.Column="0" Margin="5,5,5,0" Name="EnableAutoShutdown1Checkbox" IsChecked="{Binding EnableAutoShutdown1, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" > <StackPanel Grid.Row="1" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" >
<cctl:CheckBoxAndTextBlock Name="EnableAutoShutdown1Checkbox" IsChecked="{Binding EnableAutoShutdown1, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/>
<TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown1}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"> <TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown1}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}">
<Validation.ErrorTemplate> <Validation.ErrorTemplate>
<ControlTemplate> <ControlTemplate>
@ -1461,8 +1457,8 @@
<cctl:CheckBoxAndTextBlock IsEnabled="{Binding EnableAutoShutdown1}" IsChecked="{Binding RestartAfterShutdown1, Mode=TwoWay}" Text="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Margin="10,0,0,0" /> <cctl:CheckBoxAndTextBlock IsEnabled="{Binding EnableAutoShutdown1}" IsChecked="{Binding RestartAfterShutdown1, Mode=TwoWay}" Text="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Margin="10,0,0,0" />
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" > <cctl:CheckBoxAndTextBlock Grid.Row="2" Grid.Column="0" Margin="5,5,5,0" Name="EnableAutoShutdown2Checkbox" IsChecked="{Binding EnableAutoShutdown2, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/>
<cctl:CheckBoxAndTextBlock Name="EnableAutoShutdown2Checkbox" IsChecked="{Binding EnableAutoShutdown2, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/> <StackPanel Grid.Row="2" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" >
<TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown2}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"> <TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown2}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}">
<Validation.ErrorTemplate> <Validation.ErrorTemplate>
<ControlTemplate> <ControlTemplate>
@ -1516,10 +1512,22 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
<cctl:CheckBoxAndTextBlock Grid.Row="1" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding EnableAutoBackup, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_PeriodicBackupsLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicBackupsTooltip}" HorizontalAlignment="Left"/> <Grid>
<cctl:CheckBoxAndTextBlock Grid.Row="2" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding EnableAutoUpdate, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_PeriodicUpdatesLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicUpdatesTooltip}" HorizontalAlignment="Left"/> <Grid.RowDefinitions>
<cctl:CheckBoxAndTextBlock Grid.Row="3" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding AutoRestartIfShutdown, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_RestartIfShutdownLabel}" ToolTip="{DynamicResource ServerSettings_RestartIfShutdownTooltip}" HorizontalAlignment="Left"/> <RowDefinition/>
</Grid> <RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<cctl:CheckBoxAndTextBlock Grid.Row="0" Grid.Column="0" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding EnableAutoBackup, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_PeriodicBackupsLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicBackupsTooltip}" HorizontalAlignment="Left"/>
<cctl:CheckBoxAndTextBlock Grid.Row="1" Grid.Column="0" Margin="5,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding EnableAutoUpdate, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_PeriodicUpdatesLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicUpdatesTooltip}" HorizontalAlignment="Left"/>
<cctl:CheckBoxAndTextBlock Grid.Row="1" Grid.Column="1" Margin="10,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding AutoRestartIfShutdown, Mode=TwoWay}" VerticalAlignment="Center" Text="{DynamicResource ServerSettings_RestartIfShutdownLabel}" ToolTip="{DynamicResource ServerSettings_RestartIfShutdownTooltip}" HorizontalAlignment="Left"/>
</Grid>
</StackPanel>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</Expander> </Expander>

View file

@ -448,7 +448,6 @@ namespace ServerManagerTool.Utils
_currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start); _currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.AutoRestartIfShutdown = true;
profileList.Add(profile); profileList.Add(profile);
} }
} }
@ -462,6 +461,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = ServerProcessType.Restart, ServerProcess = ServerProcessType.Restart,
RestartIfShutdown = true,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -576,6 +576,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop, ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -644,8 +645,6 @@ namespace ServerManagerTool.Utils
{ {
foreach (var server in serverList) foreach (var server in serverList)
{ {
var performRestart = false;
if (!server.Profile.AllowDiscordUpdate) if (!server.Profile.AllowDiscordUpdate)
{ {
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Update, server.Profile.ProfileName)); responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Update, server.Profile.ProfileName));
@ -662,7 +661,6 @@ namespace ServerManagerTool.Utils
switch (server.Runtime.Status) switch (server.Runtime.Status)
{ {
case ServerStatus.Running: case ServerStatus.Running:
performRestart = true;
break; break;
case ServerStatus.Initializing: case ServerStatus.Initializing:
@ -678,7 +676,6 @@ namespace ServerManagerTool.Utils
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update); _currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
profileList.Add(profile); profileList.Add(profile);
} }
} }
@ -692,6 +689,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = ServerProcessType.Update, ServerProcess = ServerProcessType.Update,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -707,7 +705,7 @@ namespace ServerManagerTool.Utils
Task.Run(() => Task.Run(() =>
{ {
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, ServerUpdateType.ServerAndMods, false, false, token); app.PerformProfileShutdown(profile, true, ServerUpdateType.ServerAndMods, false, false, token);
_currentProfileCommands.Remove(profile.ProfileId); _currentProfileCommands.Remove(profile.ProfileId);
}, token); }, token);

View file

@ -5,14 +5,14 @@
<title>Ark Server Manager Version Feed</title> <title>Ark Server Manager Version Feed</title>
<subtitle>This is the Ark Server Manager release version feed.</subtitle> <subtitle>This is the Ark Server Manager release version feed.</subtitle>
<link href="https://arkservermanager.freeforums.net/" /> <link href="https://arkservermanager.freeforums.net/" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<entry> <entry>
<id>urn:uuid:84E1DDF9-EFA4-4A8B-90DE-564AE3B3B633</id> <id>urn:uuid:84E1DDF9-EFA4-4A8B-90DE-564AE3B3B633</id>
<title>1.1.437 (1.1.437.2)</title> <title>1.1.437 (1.1.437.3)</title>
<summary>1.1.437.2</summary> <summary>1.1.437.3</summary>
<link href="" /> <link href="" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<content type="xhtml"> <content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;"> <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p> <p>
@ -20,6 +20,7 @@
<br/> <br/>
<ul> <ul>
<li>Server Update - updated the code to simplify which set of dedicated server files (Ark Survival Evolved or Ark: SotF) is required when performing server and mod file updates. Separate Cache folders will be maintained for each.</li> <li>Server Update - updated the code to simplify which set of dedicated server files (Ark Survival Evolved or Ark: SotF) is required when performing server and mod file updates. Separate Cache folders will be maintained for each.</li>
<li>Automatic Management - rearranged the options so they are grouped correctly.</li>
<li>Auto-Start Server Option - added a new option selection for on Boot and on Login.</li> <li>Auto-Start Server Option - added a new option selection for on Boot and on Login.</li>
</ul> </ul>
</p> </p>

View file

@ -5,7 +5,30 @@
<title>Ark Server Manager Version Feed</title> <title>Ark Server Manager Version Feed</title>
<subtitle>This is the Ark Server Manager beta version feed.</subtitle> <subtitle>This is the Ark Server Manager beta version feed.</subtitle>
<link href="https://arkservermanager.freeforums.net/" /> <link href="https://arkservermanager.freeforums.net/" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<entry>
<id>urn:uuid:84E1DDF9-EFA4-4A8B-90DE-564AE3B3B633</id>
<title>1.1.437 (1.1.437.3)</title>
<summary>1.1.437.3</summary>
<link href="" />
<updated>2022-08-08T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Automatic Management - rearranged the options so they are grouped correctly.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry> <entry>
<id>urn:uuid:84E1DDF9-EFA4-4A8B-90DE-564AE3B3B633</id> <id>urn:uuid:84E1DDF9-EFA4-4A8B-90DE-564AE3B3B633</id>

View file

@ -1332,7 +1332,6 @@ namespace ServerManagerTool.Windows
_currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start); _currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.AutoRestartIfShutdown = true;
profileList.Add(profile); profileList.Add(profile);
} }
@ -1349,6 +1348,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = ServerProcessType.Restart, ServerProcess = ServerProcessType.Restart,
RestartIfShutdown = true,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1492,6 +1492,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop, ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1588,8 +1589,6 @@ namespace ServerManagerTool.Windows
foreach (var server in serverList) foreach (var server in serverList)
{ {
var performRestart = false;
// check if another command is being run against the profile // check if another command is being run against the profile
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID)) if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
{ {
@ -1600,7 +1599,6 @@ namespace ServerManagerTool.Windows
switch (server.Runtime.Status) switch (server.Runtime.Status)
{ {
case ServerStatus.Running: case ServerStatus.Running:
performRestart = true;
break; break;
case ServerStatus.Initializing: case ServerStatus.Initializing:
@ -1616,7 +1614,6 @@ namespace ServerManagerTool.Windows
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update); _currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
profileList.Add(profile); profileList.Add(profile);
} }
@ -1633,6 +1630,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = ServerProcessType.Update, ServerProcess = ServerProcessType.Update,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1650,7 +1648,7 @@ namespace ServerManagerTool.Windows
{ {
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName)); AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName));
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, updateModsOnly ? ServerUpdateType.Mods : ServerUpdateType.ServerAndMods, false, false, token); app.PerformProfileShutdown(profile, true, updateModsOnly ? ServerUpdateType.Mods : ServerUpdateType.ServerAndMods, false, false, token);
Task.Delay(DELAY_PROCESSCOMPLETE).Wait(); Task.Delay(DELAY_PROCESSCOMPLETE).Wait();

View file

@ -1184,7 +1184,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Schließt den Server in den Auto Aktualisierungszyklus ein</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Schließt den Server in den Auto Aktualisierungszyklus ein</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Wenn aktiviert, wird der Server während des automatischen Aktualisierungszyklus regelmäßig aktualisiert. Siehe die Einstellungen für die Optionen für die automatische Aktualisierung.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Wenn aktiviert, wird der Server während des automatischen Aktualisierungszyklus regelmäßig aktualisiert. Siehe die Einstellungen für die Optionen für die automatische Aktualisierung.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Startet den Server neu, wenn er heruntergefahren ist</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Startet den Server neu, wenn er heruntergefahren ist</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Wenn aktiviert, wird der Server neu gestartet, auch wenn er für automatische Neustarts und automatische Updates heruntergefahren wird.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Wenn aktiviert, wird der Server neu gestartet, auch wenn er für automatische Updates heruntergefahren wird.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -1254,7 +1254,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Include server in the Auto-Update cycle</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Include server in the Auto-Update cycle</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Restart server if shutdown</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Restart server if shutdown</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Restarts and Auto-Updates.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Updates.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -963,7 +963,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Inclure cycle de mise à jour automatique du serveur</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Inclure cycle de mise à jour automatique du serveur</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Si cette option est activée, le serveur sera périodiquement mis à jour pendant le cycle de mise à jour automatique. Voir les paramètres pour les options de mise à jour automatique.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Si cette option est activée, le serveur sera périodiquement mis à jour pendant le cycle de mise à jour automatique. Voir les paramètres pour les options de mise à jour automatique.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Redémarrer le serveur en cas d'arrêt</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Redémarrer le serveur en cas d'arrêt</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Si cette option est activée, le serveur sera redémarré même s'il est arrêté pour les redémarrages automatiques et les mises à jour automatiques.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Si cette option est activée, le serveur sera redémarré même s'il est arrêté pour les mises à jour automatiques.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Server Details --> <!--#region Server Settings - Server Details -->

View file

@ -1016,7 +1016,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Incluir servidor no ciclo de atualização automática</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Incluir servidor no ciclo de atualização automática</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Se ativado, o servidor será atualizado periodicamente durante o ciclo de atualização automática. Veja as configurações para as opções de atualização automática.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">Se ativado, o servidor será atualizado periodicamente durante o ciclo de atualização automática. Veja as configurações para as opções de atualização automática.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Reinicie o servidor se desligado</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Reinicie o servidor se desligado</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Se ativado, o servidor será reiniciado mesmo se for encerrado para reinicializações automáticas e atualizações automáticas.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">Se ativado, o servidor será reiniciado mesmo se for encerrado para atualizações automáticas.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Server Details --> <!--#region Server Settings - Server Details -->

View file

@ -1193,7 +1193,7 @@
<sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Вкл. периодические Авто-Обновления</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesLabel">Вкл. периодические Авто-Обновления</sys:String>
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String> <sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">If enabled, the server will be periodically updated during the Auto-Update cycle. See the settings for Auto-Update options.</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Перезагрузить сервер после выключения</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownLabel">Перезагрузить сервер после выключения</sys:String>
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Restarts and Auto-Updates.</sys:String> <sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">If enabled, the server will be restarted even if shutdown for Auto-Updates.</sys:String>
<!--#endregion--> <!--#endregion-->
<!--#region Server Settings - Discord Bot Details --> <!--#region Server Settings - Discord Bot Details -->

View file

@ -107,6 +107,7 @@ namespace ServerManagerTool.Lib
public int ExitCode { get; set; } = EXITCODE_NORMALEXIT; public int ExitCode { get; set; } = EXITCODE_NORMALEXIT;
public bool OutputLogs { get; set; } = false; public bool OutputLogs { get; set; } = false;
public bool PerformWorldSave { get; set; } = Config.Default.ServerShutdown_EnableWorldSave; public bool PerformWorldSave { get; set; } = Config.Default.ServerShutdown_EnableWorldSave;
public bool RestartIfShutdown { get; set; } = false;
public bool SendAlerts { get; set; } = false; public bool SendAlerts { get; set; } = false;
public bool SendEmails { get; set; } = false; public bool SendEmails { get; set; } = false;
public ProgressDelegate ProgressCallback { get; set; } = null; public ProgressDelegate ProgressCallback { get; set; } = null;
@ -333,7 +334,7 @@ namespace ServerManagerTool.Lib
// check if the server was previously running. // check if the server was previously running.
if (!_serverRunning) if (!_serverRunning)
{ {
if (_profile.AutoRestartIfShutdown) if (RestartIfShutdown)
{ {
LogProfileMessage("Server was not running, server will be started as the setting to restart if shutdown is TRUE."); LogProfileMessage("Server was not running, server will be started as the setting to restart if shutdown is TRUE.");
} }
@ -3170,7 +3171,8 @@ namespace ServerManagerTool.Lib
SendAlerts = SendAlerts, SendAlerts = SendAlerts,
SendEmails = SendEmails, SendEmails = SendEmails,
ServerProcess = ServerProcess, ServerProcess = ServerProcess,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = profile.AutoRestartIfShutdown,
}; };
app.PerformProfileUpdate(branch, profile); app.PerformProfileUpdate(branch, profile);
profileExitCodes.TryAdd(profile, app.ExitCode); profileExitCodes.TryAdd(profile, app.ExitCode);
@ -3191,7 +3193,8 @@ namespace ServerManagerTool.Lib
SendAlerts = SendAlerts, SendAlerts = SendAlerts,
SendEmails = SendEmails, SendEmails = SendEmails,
ServerProcess = ServerProcess, ServerProcess = ServerProcess,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = profile.AutoRestartIfShutdown,
}; };
app.PerformProfileUpdate(branch, profile); app.PerformProfileUpdate(branch, profile);
profileExitCodes.TryAdd(profile, app.ExitCode); profileExitCodes.TryAdd(profile, app.ExitCode);
@ -3358,7 +3361,8 @@ namespace ServerManagerTool.Lib
SendAlerts = true, SendAlerts = true,
SendEmails = true, SendEmails = true,
ServerProcess = type, ServerProcess = type,
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden,
RestartIfShutdown = performRestart,
}; };
exitCode = app.PerformProfileShutdown(profile, performRestart, performUpdate ? ServerUpdateType.ServerAndMods : ServerUpdateType.None, true, false, CancellationToken.None); exitCode = app.PerformProfileShutdown(profile, performRestart, performUpdate ? ServerUpdateType.ServerAndMods : ServerUpdateType.None, true, false, CancellationToken.None);

View file

@ -953,20 +953,17 @@
<StackPanel Margin="-8,0,2,0"> <StackPanel Margin="-8,0,2,0">
<GroupBox Header="{DynamicResource ServerSettings_ServerManagerSettingsLabel}" Style="{StaticResource GroupBoxStyle}"> <GroupBox Header="{DynamicResource ServerSettings_ServerManagerSettingsLabel}" Style="{StaticResource GroupBoxStyle}">
<Grid> <StackPanel Orientation="Vertical">
<Grid.RowDefinitions> <Grid>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.Style> <Grid.Style>
<Style TargetType="{x:Type Grid}"> <Style TargetType="{x:Type Grid}">
@ -981,15 +978,15 @@
</Style> </Style>
</Grid.Style> </Grid.Style>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,0"> <CheckBox Grid.Row="0" Grid.Column="0" Margin="5,5,5,0" Content="{DynamicResource ServerSettings_AutoStartServerLabel}" VerticalAlignment="Bottom" IsChecked="{Binding EnableAutoStart}" ToolTip="{DynamicResource ServerSettings_AutoStartServerTooltip}" HorizontalAlignment="Left"/>
<CheckBox Content="{DynamicResource ServerSettings_AutoStartServerLabel}" VerticalAlignment="Bottom" IsChecked="{Binding EnableAutoStart}" ToolTip="{DynamicResource ServerSettings_AutoStartServerTooltip}" HorizontalAlignment="Left"/> <StackPanel Grid.Row="0" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal">
<RadioButton GroupName="AutoStartServer" Margin="10,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin, Converter={StaticResource InvertBooleanConverter}}" Content="{DynamicResource ServerSettings_AutoStartServerOnBootLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnBootTooltip}"/> <RadioButton GroupName="AutoStartServer" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin, Converter={StaticResource InvertBooleanConverter}}" Content="{DynamicResource ServerSettings_AutoStartServerOnBootLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnBootTooltip}"/>
<RadioButton GroupName="AutoStartServer" Margin="5,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin}" Content="{DynamicResource ServerSettings_AutoStartServerOnLoginLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnLoginTooltip}"/> <RadioButton GroupName="AutoStartServer" Margin="5,0,0,0" VerticalAlignment="Bottom" IsEnabled="{Binding EnableAutoStart}" IsChecked="{Binding AutoStartOnLogin}" Content="{DynamicResource ServerSettings_AutoStartServerOnLoginLabel}" ToolTip="{DynamicResource ServerSettings_AutoStartServerOnLoginTooltip}"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="5,5,5,0" > <CheckBox Grid.Row="1" Grid.Column="0" Margin="5,5,5,0" Name="EnableAutoShutdown1Checkbox" IsChecked="{Binding EnableAutoShutdown1}" Content="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/>
<CheckBox Name="EnableAutoShutdown1Checkbox" IsChecked="{Binding EnableAutoShutdown1}" Content="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/> <StackPanel Grid.Row="1" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal">
<TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown1}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"> <TextBox Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown1}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}">
<Validation.ErrorTemplate> <Validation.ErrorTemplate>
<ControlTemplate> <ControlTemplate>
<StackPanel> <StackPanel>
@ -1041,9 +1038,9 @@
<CheckBox IsEnabled="{Binding EnableAutoShutdown1}" IsChecked="{Binding RestartAfterShutdown1}" Content="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Margin="10,0,0,0" /> <CheckBox IsEnabled="{Binding EnableAutoShutdown1}" IsChecked="{Binding RestartAfterShutdown1}" Content="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Margin="10,0,0,0" />
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5,5,5,0" > <CheckBox Grid.Row="2" Grid.Column="0" Margin="5,5,5,0" Name="EnableAutoShutdown2Checkbox" IsChecked="{Binding EnableAutoShutdown2}" Content="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/>
<CheckBox Name="EnableAutoShutdown2Checkbox" IsChecked="{Binding EnableAutoShutdown2}" Content="{DynamicResource ServerSettings_EnableAutoShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"/> <StackPanel Grid.Row="2" Grid.Column="1" Margin="5,5,5,0" Orientation="Horizontal">
<TextBox Margin="10,0,0,0" Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown2}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}"> <TextBox Width="60" Height="20" IsEnabled="{Binding EnableAutoShutdown2}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_EnableAutoShutdownTooltip}">
<Validation.ErrorTemplate> <Validation.ErrorTemplate>
<ControlTemplate> <ControlTemplate>
<StackPanel> <StackPanel>
@ -1095,11 +1092,23 @@
<CheckBox IsEnabled="{Binding EnableAutoShutdown2}" IsChecked="{Binding RestartAfterShutdown2}" Content="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Padding="4,-1,0,0" Margin="10,0,0,0"/> <CheckBox IsEnabled="{Binding EnableAutoShutdown2}" IsChecked="{Binding RestartAfterShutdown2}" Content="{DynamicResource ServerSettings_RestartAfterShutdownLabel}" VerticalAlignment="Bottom" ToolTip="{DynamicResource ServerSettings_RestartAfterShutdownTooltip}" FlowDirection="RightToLeft" Padding="4,-1,0,0" Margin="10,0,0,0"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox Grid.Row="1" Margin="5,5,5,0" IsChecked="{Binding EnableAutoBackup}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_PeriodicBackupsLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicBackupsTooltip}" HorizontalAlignment="Left"/> <CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,5,5,0" IsChecked="{Binding EnableAutoBackup}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_PeriodicBackupsLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicBackupsTooltip}" HorizontalAlignment="Left"/>
<CheckBox Grid.Row="2" Margin="5,5,5,0" IsChecked="{Binding EnableAutoUpdate}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_PeriodicUpdatesLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicUpdatesTooltip}" HorizontalAlignment="Left"/>
<CheckBox Grid.Row="3" Margin="5,5,5,0" IsChecked="{Binding AutoRestartIfShutdown}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_RestartIfShutdownLabel}" ToolTip="{DynamicResource ServerSettings_RestartIfShutdownTooltip}" HorizontalAlignment="Left"/> <CheckBox Grid.Row="1" Grid.Column="0" Margin="5,5,5,0" IsChecked="{Binding EnableAutoUpdate}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_PeriodicUpdatesLabel}" ToolTip="{DynamicResource ServerSettings_PeriodicUpdatesTooltip}" HorizontalAlignment="Left"/>
</Grid> <CheckBox Grid.Row="2" Grid.Column="1" Margin="10,5,5,0" IsChecked="{Binding AutoRestartIfShutdown}" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_RestartIfShutdownLabel}" ToolTip="{DynamicResource ServerSettings_RestartIfShutdownTooltip}" HorizontalAlignment="Left"/>
</Grid>
</StackPanel>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</Expander> </Expander>

View file

@ -444,7 +444,6 @@ namespace ServerManagerTool.Utils
_currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start); _currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.AutoRestartIfShutdown = true;
profileList.Add(profile); profileList.Add(profile);
} }
} }
@ -458,6 +457,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = ServerProcessType.Restart, ServerProcess = ServerProcessType.Restart,
RestartIfShutdown = true,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -571,6 +571,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop, ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -638,8 +639,6 @@ namespace ServerManagerTool.Utils
{ {
foreach (var server in serverList) foreach (var server in serverList)
{ {
var performRestart = false;
if (!server.Profile.AllowDiscordUpdate) if (!server.Profile.AllowDiscordUpdate)
{ {
responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Update, server.Profile.ProfileName)); responseList.Add(string.Format(_globalizer.GetResourceString("DiscordBot_CommandDisabledProfile"), CommandType.Update, server.Profile.ProfileName));
@ -656,7 +655,6 @@ namespace ServerManagerTool.Utils
switch (server.Runtime.Status) switch (server.Runtime.Status)
{ {
case ServerStatus.Running: case ServerStatus.Running:
performRestart = true;
break; break;
case ServerStatus.Initializing: case ServerStatus.Initializing:
@ -672,7 +670,6 @@ namespace ServerManagerTool.Utils
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update); _currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
profileList.Add(profile); profileList.Add(profile);
} }
} }
@ -686,6 +683,7 @@ namespace ServerManagerTool.Utils
SendAlerts = true, SendAlerts = true,
SendEmails = false, SendEmails = false,
ServerProcess = ServerProcessType.Update, ServerProcess = ServerProcessType.Update,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -701,7 +699,7 @@ namespace ServerManagerTool.Utils
Task.Run(() => Task.Run(() =>
{ {
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, ServerUpdateType.ServerAndMods, false, false, token); app.PerformProfileShutdown(profile, true, ServerUpdateType.ServerAndMods, false, false, token);
_currentProfileCommands.Remove(profile.ProfileId); _currentProfileCommands.Remove(profile.ProfileId);
}, token); }, token);

View file

@ -5,14 +5,14 @@
<title>Conan Server Manager Version Feed</title> <title>Conan Server Manager Version Feed</title>
<subtitle>This is the Conan Server Manager release version feed.</subtitle> <subtitle>This is the Conan Server Manager release version feed.</subtitle>
<link href="https://servermanagers.freeforums.net/" /> <link href="https://servermanagers.freeforums.net/" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<entry> <entry>
<id>urn:uuid:6D1F49A0-06E6-415F-AA92-AACD598BC50C</id> <id>urn:uuid:6D1F49A0-06E6-415F-AA92-AACD598BC50C</id>
<title>1.1.80 (1.1.80.3)</title> <title>1.1.80 (1.1.80.4)</title>
<summary>1.1.80.3</summary> <summary>1.1.80.4</summary>
<link href="" /> <link href="" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<content type="xhtml"> <content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;"> <div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p> <p>
@ -21,6 +21,7 @@
<ul> <ul>
<li>Server Details Section - added new option to use the Conan Testlive Dedicated Server files. This new option will switch the steam application id of the server files to use the Conan Testlive Dedicated Server files, instead of the Conan Dedicated Server files.</li> <li>Server Details Section - added new option to use the Conan Testlive Dedicated Server files. This new option will switch the steam application id of the server files to use the Conan Testlive Dedicated Server files, instead of the Conan Dedicated Server files.</li>
<li>Server Update - updated the code to determine which set of dedicated server files (Conan or Conan Testlive) is required when performing server and mod file updates. Separate Cache folders will be maintained for each.</li> <li>Server Update - updated the code to determine which set of dedicated server files (Conan or Conan Testlive) is required when performing server and mod file updates. Separate Cache folders will be maintained for each.</li>
<li>Automatic Management - rearranged the options so they are grouped correctly.</li>
<li>Auto-Start Server Option - added a new option selection for on Boot and on Login.</li> <li>Auto-Start Server Option - added a new option selection for on Boot and on Login.</li>
</ul> </ul>
</p> </p>

View file

@ -5,7 +5,30 @@
<title>Conan Server Manager Version Feed</title> <title>Conan Server Manager Version Feed</title>
<subtitle>This is the Conan Server Manager beta version feed.</subtitle> <subtitle>This is the Conan Server Manager beta version feed.</subtitle>
<link href="https://servermanagers.freeforums.net/" /> <link href="https://servermanagers.freeforums.net/" />
<updated>2022-08-07T00:00:00Z</updated> <updated>2022-08-08T00:00:00Z</updated>
<entry>
<id>urn:uuid:6D1F49A0-06E6-415F-AA92-AACD598BC50C</id>
<title>1.1.80 (1.1.80.4)</title>
<summary>1.1.80.4</summary>
<link href="" />
<updated>2022-08-08T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Automatic Management - rearranged the options so they are grouped correctly.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry> <entry>
<id>urn:uuid:6D1F49A0-06E6-415F-AA92-AACD598BC50C</id> <id>urn:uuid:6D1F49A0-06E6-415F-AA92-AACD598BC50C</id>

View file

@ -1329,7 +1329,6 @@ namespace ServerManagerTool.Windows
_currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start); _currentProfileCommands.Add(server.Profile.ProfileID, restart ? CommandType.Restart : CommandType.Start);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.AutoRestartIfShutdown = true;
profileList.Add(profile); profileList.Add(profile);
} }
@ -1346,6 +1345,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = ServerProcessType.Restart, ServerProcess = ServerProcessType.Restart,
RestartIfShutdown = true,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1489,6 +1489,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop, ServerProcess = shutdown ? ServerProcessType.Shutdown : ServerProcessType.Stop,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1585,8 +1586,6 @@ namespace ServerManagerTool.Windows
foreach (var server in serverList) foreach (var server in serverList)
{ {
var performRestart = false;
// check if another command is being run against the profile // check if another command is being run against the profile
if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID)) if (_currentProfileCommands.ContainsKey(server.Profile.ProfileID))
{ {
@ -1597,7 +1596,6 @@ namespace ServerManagerTool.Windows
switch (server.Runtime.Status) switch (server.Runtime.Status)
{ {
case ServerStatus.Running: case ServerStatus.Running:
performRestart = true;
break; break;
case ServerStatus.Initializing: case ServerStatus.Initializing:
@ -1613,7 +1611,6 @@ namespace ServerManagerTool.Windows
_currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update); _currentProfileCommands.Add(server.Profile.ProfileID, CommandType.Update);
var profile = ServerProfileSnapshot.Create(server.Profile); var profile = ServerProfileSnapshot.Create(server.Profile);
profile.RestartAfterShutdown1 = performRestart; // use this property to trigger a restart
profileList.Add(profile); profileList.Add(profile);
} }
@ -1630,6 +1627,7 @@ namespace ServerManagerTool.Windows
SendEmails = false, SendEmails = false,
ShutdownReason = shutdownReason, ShutdownReason = shutdownReason,
ServerProcess = ServerProcessType.Update, ServerProcess = ServerProcessType.Update,
RestartIfShutdown = false,
ServerStatusChangeCallback = (ServerStatus serverStatus) => ServerStatusChangeCallback = (ServerStatus serverStatus) =>
{ {
TaskUtils.RunOnUIThreadAsync(() => TaskUtils.RunOnUIThreadAsync(() =>
@ -1647,7 +1645,7 @@ namespace ServerManagerTool.Windows
{ {
AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName)); AddMessageBlockContent(string.Format(_globalizer.GetResourceString("DiscordBot_UpdateRequested"), profile.ServerName));
app.PerformProfileShutdown(profile, profile.RestartAfterShutdown1, updateModsOnly ? ServerUpdateType.Mods : ServerUpdateType.ServerAndMods, false, false, token); app.PerformProfileShutdown(profile, true, updateModsOnly ? ServerUpdateType.Mods : ServerUpdateType.ServerAndMods, false, false, token);
Task.Delay(DELAY_PROCESSCOMPLETE).Wait(); Task.Delay(DELAY_PROCESSCOMPLETE).Wait();