asm: add new backup settings

This commit is contained in:
Lacoi 2023-09-30 14:39:55 +02:00
parent 07ca95586b
commit 7761d9b6cd
3 changed files with 107 additions and 7 deletions

View file

@ -1175,7 +1175,9 @@
<sys:String x:Key="ServerSettings_SaveBackupButtonTooltip">Perform a manual world save.</sys:String>
<sys:String x:Key="ServerSettings_SaveRestoreButtonLabel">Restore...</sys:String>
<sys:String x:Key="ServerSettings_SaveRestoreButtonTooltip">Restore a previous world save.</sys:String>
<sys:String x:Key="ServerSettings_MaxNumOfSaveBackupsLabel">Backup Quantity:</sys:String>
<sys:String x:Key="ServerSettings_MaxNumOfSaveBackupsTooltip">Set the max number of backup to keeps in the save folder. Whenever a new backup is created, the oldest ones will be deleted. Default value is 20. Since such backups take place every 2 hours and they are uncomprssed files, it is suggested to use more flexible third party solutions, especially with "big" saves.</sys:String>
<sys:String x:Key="ServerSettings_MOTDLabel">Message of the Day</sys:String>
<sys:String x:Key="ServerSettings_MOTDTooltip">The Message of the Day displayed to users when they connect to the server.</sys:String>
<sys:String x:Key="ServerSettings_MOTDLineCountLabel">Lines:</sys:String>
@ -1321,6 +1323,21 @@
<sys:String x:Key="ServerSettings_NotifyAdminCommandsInChatTooltip">If enabled, admin commands will be echoed to chat for admins only to see.</sys:String>
<sys:String x:Key="ServerSettings_TribeLogDestroyedEnemyStructuresLabel">Tribe Log Destroyed Enemy Structures</sys:String>
<sys:String x:Key="ServerSettings_TribeLogDestroyedEnemyStructuresTooltip">If enabled, the enemy-structure destruction log (for the victim tribe) wil display the attacker tribe in the Tribe Logs, instead of a generic structure destruction message.</sys:String>
<sys:String x:Key="ServerSettings_ServerSaveOptionsLabel">Official Save Settings</sys:String>
<sys:String x:Key="ServerSettings_NewSaveFormatLabel">New Save Game Format</sys:String>
<sys:String x:Key="ServerSettings_NewSaveFormatTooltip" xml:space="preserve">The new save format (version 11) is used, which is approximately 4x faster and 50% smaller compared to "old save format" (version 8).
Deprecated since patch 244.6, the current default save format (version 9) is based on this. Use only if necessary (e.g.: the default save format fails as well the old save format).
This option must be used to start the Official 2023 Server Saves backups along with -usestore to correctly load tribe ownership.</sys:String>
<sys:String x:Key="ServerSettings_UseStoreLabel">Use Store</sys:String>
<sys:String x:Key="ServerSettings_UseStoreTooltip" xml:space="preserve">Same basic behaviour of official (non-legacy) servers on handling player characters data: character profile file (.arkprofile) is not saved separately from map save (.ark), nor its backup.
When necessary (e.g.: a character just transferred or a new character has been created) a temporary character profile file is created and kept until next world-save.
Tribe profiles are stored in a different format (.arktributetribe). Allows -BackupTransferPlayerDatas option (for fully mimic official servers save behaviour).
Use the option -converttostore to convert previous non stored data to stored data. This option must be used to correctly load the Official 2023 Server Saves backups along with -newsaveformat.</sys:String>
<sys:String x:Key="ServerSettings_BackupTransferPlayerDatasLabel">Backup Transfer Player Datas (Undocumented)</sys:String>
<sys:String x:Key="ServerSettings_BackupTransferPlayerDatasTooltip" xml:space="preserve">Fully mimic official (non-legacy) servers on handling player characters data, adding permanent character profile backup files separately from the world-save.
Requires -usestore option. This option must be used to fully re-enable character profile backups when playing the Official 2023 Server Saves backups.
Undocumented bye wildcard.</sys:String>
<sys:String x:Key="ServerSettings_EnableWebAlarmLabel">Enable Web Alarms</sys:String>
<sys:String x:Key="ServerSettings_EnableWebAlarmTooltip">If enabled, servers can now get web notifications posted somewhere when important things happen to a tribe.</sys:String>

View file

@ -455,6 +455,14 @@ namespace ServerManagerTool.Lib
set { SetValue(AutoSavePeriodMinutesProperty, value); }
}
public static readonly DependencyProperty MaxNumOfSaveBackupsProperty = DependencyProperty.Register(nameof(MaxNumOfSaveBackups), typeof(int), typeof(ServerProfile), new PropertyMetadata(20));
[DataMember]
public int MaxNumOfSaveBackups
{
get { return (int)GetValue(MaxNumOfSaveBackupsProperty); }
set { SetValue(MaxNumOfSaveBackupsProperty, value); }
}
public static readonly DependencyProperty MOTDProperty = DependencyProperty.Register(nameof(MOTD), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty));
[IniFileEntry(IniFiles.GameUserSettings, IniSections.GUS_MessageOfTheDay, ServerProfileCategory.Administration, "Message", ClearSection = true, Multiline = true, QuotedString = QuotedStringType.Remove)]
public string MOTD
@ -958,6 +966,30 @@ namespace ServerManagerTool.Lib
get { return (bool)GetValue(LauncherArgsPrefixProperty); }
set { SetValue(LauncherArgsPrefixProperty, value); }
}
public static readonly DependencyProperty NewSaveFormatProperty = DependencyProperty.Register(nameof(NewSaveFormat), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false));
[DataMember]
public bool NewSaveFormat
{
get { return (bool)GetValue(NewSaveFormatProperty); }
set { SetValue(NewSaveFormatProperty, value); }
}
public static readonly DependencyProperty UseStoreProperty = DependencyProperty.Register(nameof(UseStore), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false));
[DataMember]
public bool UseStore
{
get { return (bool)GetValue(UseStoreProperty); }
set { SetValue(UseStoreProperty, value); }
}
public static readonly DependencyProperty BackupTransferPlayerDatasProperty = DependencyProperty.Register(nameof(BackupTransferPlayerDatas), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false));
[DataMember]
public bool BackupTransferPlayerDatas
{
get { return (bool)GetValue(BackupTransferPlayerDatasProperty); }
set { SetValue(BackupTransferPlayerDatasProperty, value); }
}
#endregion
#region Automatic Management
@ -4371,6 +4403,26 @@ namespace ServerManagerTool.Lib
serverArgs.Append(" -culture=").Append(this.Culture);
}
if (this.NewSaveFormat)
{
serverArgs.Append(" -newsaveformat");
}
if (this.UseStore)
{
serverArgs.Append(" -usestore");
}
if (this.BackupTransferPlayerDatas)
{
serverArgs.Append(" -BackupTransferPlayerDatas");
}
if (this.MaxNumOfSaveBackups != 20)
{
serverArgs.Append(" -MaxNumOfSaveBackups=").Append(this.MaxNumOfSaveBackups);
}
return serverArgs.ToString();
}
@ -5683,6 +5735,7 @@ namespace ServerManagerTool.Lib
this.ClearValue(ExtinctionEventUTCProperty);
this.ClearValue(AutoSavePeriodMinutesProperty);
this.ClearValue(MaxNumOfSaveBackupsProperty);
this.ClearValue(MOTDProperty);
this.ClearValue(MOTDDurationProperty);
@ -5706,6 +5759,10 @@ namespace ServerManagerTool.Lib
this.ClearValue(LauncherArgsOverrideProperty);
this.ClearValue(LauncherArgsPrefixProperty);
this.ClearValue(LauncherArgsProperty);
this.ClearValue(NewSaveFormatProperty);
this.ClearValue(UseStoreProperty);
this.ClearValue(BackupTransferPlayerDatasProperty);
}
public void ResetChatAndNotificationSection()
@ -6286,6 +6343,7 @@ namespace ServerManagerTool.Lib
}
this.SetValue(AutoSavePeriodMinutesProperty, sourceProfile.AutoSavePeriodMinutes);
this.SetValue(MaxNumOfSaveBackupsProperty, sourceProfile.MaxNumOfSaveBackups);
this.SetValue(EnableExtinctionEventProperty, sourceProfile.EnableExtinctionEvent);
this.SetValue(ExtinctionEventTimeIntervalProperty, sourceProfile.ExtinctionEventTimeInterval);
@ -6365,6 +6423,10 @@ namespace ServerManagerTool.Lib
//this.SetValue(LauncherArgsOverrideProperty, sourceProfile.LauncherArgsOverride);
//this.SetValue(LauncherArgsPrefixProperty, sourceProfile.LauncherArgsPrefix);
//this.SetValue(AdditionalArgsProperty, sourceProfile.AdditionalArgs);
this.SetValue(NewSaveFormatProperty, sourceProfile.NewSaveFormat);
this.SetValue(UseStoreProperty, sourceProfile.UseStore);
this.SetValue(BackupTransferPlayerDatasProperty, sourceProfile.BackupTransferPlayerDatas);
}
private void SyncAutomaticManagement(ServerProfile sourceProfile)

View file

@ -863,6 +863,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
@ -906,10 +907,29 @@
</Style>
</Button.Style>
</Button>
<cctl:AnnotatedSlider Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="1" Label="{DynamicResource ServerSettings_MaxNumOfSaveBackupsLabel}" Value="{Binding MaxNumOfSaveBackups}" VerticalAlignment="Center" Minimum="0" Maximum="20" LargeChange="2" SmallChange="1" TickFrequency="1" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" ToolTip="{DynamicResource ServerSettings_MaxNumOfSaveBackupsTooltip}"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="6" Header="{DynamicResource ServerSettings_MOTDLabel}" Style="{StaticResource GroupBoxStyle}" Foreground="{DynamicResource UnSyncedSetting}">
<GroupBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="6" Header="{DynamicResource ServerSettings_ServerSaveOptionsLabel}" Style="{StaticResource GroupBoxStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<cctl:CheckBoxAndTextBlock Grid.Row="0" Grid.Column="0" Margin="5,5,5,0" IsChecked="{Binding NewSaveFormat, Mode=TwoWay}" Text="{DynamicResource ServerSettings_NewSaveFormatLabel}" VerticalAlignment="Center" HorizontalAlignment="Left" ToolTip="{DynamicResource ServerSettings_NewSaveFormatTooltip}"/>
<cctl:CheckBoxAndTextBlock Grid.Row="0" Grid.Column="1" Margin="5,5,5,0" IsChecked="{Binding UseStore, Mode=TwoWay}" Text="{DynamicResource ServerSettings_UseStoreLabel}" VerticalAlignment="Center" HorizontalAlignment="Left" ToolTip="{DynamicResource ServerSettings_UseStoreTooltip}"/>
<cctl:CheckBoxAndTextBlock Grid.Row="0" Grid.Column="2" Margin="5,5,5,0" IsChecked="{Binding BackupTransferPlayerDatas, Mode=TwoWay}" Text="{DynamicResource ServerSettings_BackupTransferPlayerDatasLabel}" VerticalAlignment="Center" HorizontalAlignment="Left" ToolTip="{DynamicResource ServerSettings_BackupTransferPlayerDatasTooltip}"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="6" Header="{DynamicResource ServerSettings_MOTDLabel}" Style="{StaticResource GroupBoxStyle}" Foreground="{DynamicResource UnSyncedSetting}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@ -990,7 +1010,7 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox.Header>
<cctl:CheckBoxAndTextBlock HorizontalAlignment="Left" IsChecked="{Binding EnableExtinctionEvent, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableExtinctionEventLabel}" ToolTip="{DynamicResource ServerSettings_EnableExtinctionEventTooltip}" />
</GroupBox.Header>
@ -1006,7 +1026,7 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_ServerOptionsLabel}"/>
@ -1254,7 +1274,7 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_ServerBadWordFilterOptionsLabel}"/>
@ -1289,7 +1309,7 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_ServerLogOptionsLabel}"/>
@ -1327,7 +1347,7 @@
</Grid>
</GroupBox>
<GroupBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="6" Style="{StaticResource GroupBoxStyle}">
<GroupBox.Header>
<cctl:CheckBoxAndTextBlock Name="EnableWebAlarmCheckbox" IsChecked="{Binding EnableWebAlarm, Mode=TwoWay}" Text="{DynamicResource ServerSettings_EnableWebAlarmLabel}" ToolTip="{DynamicResource ServerSettings_EnableWebAlarmTooltip}" />
</GroupBox.Header>
@ -1582,6 +1602,7 @@
</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="0" Grid.Column="1" Margin="10,5,5,0" IsEnabled="{Binding ElementName=EnableSOTFCheckbox, Path=IsChecked, Converter={StaticResource InvertBooleanConverter}}" IsChecked="{Binding EnableAutoBackup, Mode=TwoWay}" VerticalAlignment="Center" Text="Include Cluster Directory" ToolTip="{DynamicResource ServerSettings_PeriodicBackupsTooltip}" HorizontalAlignment="Left" Foreground="{DynamicResource UnSyncedSetting}"/>
<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"/>