From 7761d9b6cdf57db800490d836a5079af356cb70a Mon Sep 17 00:00:00 2001 From: Lacoi Date: Sat, 30 Sep 2023 14:39:55 +0200 Subject: [PATCH] asm: add new backup settings --- .../Globalization/en-US/en-US.xaml | 19 +++++- src/ARKServerManager/Lib/ServerProfile.cs | 62 +++++++++++++++++++ .../UserControls/ServerSettingsControl.xaml | 33 ++++++++-- 3 files changed, 107 insertions(+), 7 deletions(-) diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml index f163e684..177770ce 100644 --- a/src/ARKServerManager/Globalization/en-US/en-US.xaml +++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml @@ -1175,7 +1175,9 @@ Perform a manual world save. Restore... Restore a previous world save. - + Backup Quantity: + 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. + Message of the Day The Message of the Day displayed to users when they connect to the server. Lines: @@ -1321,6 +1323,21 @@ If enabled, admin commands will be echoed to chat for admins only to see. Tribe Log Destroyed Enemy Structures 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. + + Official Save Settings + New Save Game Format + 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. + Use Store + 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. + Backup Transfer Player Datas (Undocumented) + 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. Enable Web Alarms If enabled, servers can now get web notifications posted somewhere when important things happen to a tribe. diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs index ce4821bd..34d432dd 100644 --- a/src/ARKServerManager/Lib/ServerProfile.cs +++ b/src/ARKServerManager/Lib/ServerProfile.cs @@ -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) diff --git a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml index adfc6a2e..f5ef5f87 100644 --- a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml +++ b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml @@ -863,6 +863,7 @@ + @@ -906,10 +907,29 @@ + - + + + + + + + + + + + + + + + + + + + @@ -990,7 +1010,7 @@ - + @@ -1006,7 +1026,7 @@ - + - + - + - + @@ -1582,6 +1602,7 @@ +