diff --git a/src/ARKServerManager/App.xaml.cs b/src/ARKServerManager/App.xaml.cs
index 321e4a93..2e79faa1 100644
--- a/src/ARKServerManager/App.xaml.cs
+++ b/src/ARKServerManager/App.xaml.cs
@@ -424,8 +424,7 @@ namespace ServerManagerTool
Config.Default.ConfigDirectory = Path.Combine(Config.Default.DataDir, Config.Default.ProfilesDir);
System.IO.Directory.CreateDirectory(Config.Default.ConfigDirectory);
- Config.Default.Save();
- CommonConfig.Default.Save();
+ SaveConfigFiles();
if (restartRequired)
{
@@ -527,13 +526,31 @@ namespace ServerManagerTool
MessageBox.Show(String.Format(_globalizer.GetResourceString("Application_Profile_SaveFailedLabel"), server.Profile.ProfileName, ex.Message, ex.StackTrace), _globalizer.GetResourceString("Application_Profile_SaveFailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
- Config.Default.Save();
- CommonConfig.Default.Save();
+ SaveConfigFiles();
}
PluginHelper.Instance?.Dispose();
ApplicationStarted = false;
}
+
+ public static void SaveConfigFiles(bool includeBackup = true)
+ {
+ Config.Default.Save();
+ CommonConfig.Default.Save();
+
+ Config.Default.Reload();
+ CommonConfig.Default.Reload();
+
+ var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ var backupFolder = includeBackup
+ ? IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath)
+ ? Path.Combine(Config.Default.DataDir, Config.Default.BackupDir)
+ : Path.Combine(Config.Default.BackupPath))
+ : null;
+
+ SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder);
+ SettingsUtils.BackupUserConfigSettings(CommonConfig.Default, "commonconfig.json", installFolder, backupFolder);
+ }
}
}
diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml
index ff889d9f..fc295f2b 100644
--- a/src/ARKServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml
@@ -679,6 +679,8 @@
Changing the data directory will move any existing profiles to the new location, but it will not move any server installations. Do you still want to change this directory?Failed to change data directoryThere was an error changing the data directory: {0}\r\nPlease correct the error and try again, or contact technical support for assistance.
+ Confirm Data Directory Reset
+ Click 'Yes' to confirm you want to reset the location of the data directory. Once reset, the server manager will shutdown and you will need to restart.Select Backup DirectorySelect Cache Directory
diff --git a/src/ARKServerManager/Globalization/pt-BR/pt-BR.xaml b/src/ARKServerManager/Globalization/pt-BR/pt-BR.xaml
index 7de82b4b..7c1bb60d 100644
--- a/src/ARKServerManager/Globalization/pt-BR/pt-BR.xaml
+++ b/src/ARKServerManager/Globalization/pt-BR/pt-BR.xaml
@@ -104,7 +104,8 @@
O Ark Server Manager armazenará os perfis e o SteamCMD nos seguintes diretórios:\r\n\r\nProfiles: {0}\r\nSteamCMD: {1}\r\n\r\n Está tudo bem?Erro na seleção do diretório de dadosO diretório que você escolheu está dentro da pasta de instalação do gerenciador de servidor. Isso não é recomendado, escolha outra pasta.
- Não foi possível guardar o perfil
+ O diretório que você escolheu está na área de trabalho. Isso não é recomendado, escolha outra pasta.
+ Não foi possível guardar o perfilNão foi possível guardar o perfil {0}. {1}\n{2}Mostrar janela principal
@@ -164,6 +165,25 @@
Processador
+
+ Seleção da pasta de dados
+ Parece que você não tem um conjunto de diretórios de dados. O diretório de dados é onde seus perfis e o SteamCMD serão armazenados. Não é o mesmo que o diretório de instalação do servidor, que você pode escolher para cada perfil.
+ Selecione a unidade onde a pasta de dados deve estar localizada.
+ Nome da pasta de dados:
+ O nome da pasta de dados do server manager.
+ Disco local
+ {0} livre de {1}
+
+ Ok
+ Cancelar
+ Atualizar
+
+ Erro de seleção no diretório de dados
+ O nome da pasta de dados que você digitou não é válido.
+ Reinicialização do Server Manager necessária
+ A pasta de dados foi configurada, você deve agora reiniciar o server manager para usar as novas configurações.
+
+
Fechar
@@ -591,6 +611,23 @@
Mostrar o motivo de desligamento com TODAS as mensagens de desligamentoSe habilitado, o motivo do desligamento será mostrado com todas as mensagens de desligamento; caso contrário, ele será mostrado apenas no início do encerramento do servidor.
+ Habilitar Discord Bot
+ Você precisará reiniciar o server manager se alterar alguma configuração do Discord Bot.
+ Token:
+ O token associado ao bot discord.
+ Server Id:
+ O id do servidor discord que o bot usará.
+ Prefix:
+ O prefixo que deve ser usado ao enviar um comando via discord.
+ Obter Token...
+ Ajuda...
+ Se ativado, o comando de backup pode ser enviado do discord.
+ Se ativado, o comando de reiniciar pode ser enviado do discord.
+ Se habilitado, o comando de desligar pode ser enviado do discord.
+ Se habilitado, o comando de iniciar pode ser enviado do discord.
+ Se habilitado, o comando de parar pode ser enviado do discord.
+ Se ativado, o comando de atualizar pode ser enviado do discord.
+
Configurações de email SMTPHost:O nome ou endereço IP do host usado para transmissões de SMTP.
@@ -755,6 +792,9 @@
Reinstale o erro do SteamCMDOcorreu um erro ao tentar reinstalar o SteamCMD. Isso deixou o SteamCmd em um estado instável, tente reinstalar novamente ou informe isso.\R\nException: {0}
+ Discord Bot executando comandos
+ O bot discord tem um ou mais comandos em execução. Quer continuar fechando o server manager?
+
Iniciar a confirmação do servidorVocê está prestes a iniciar o servidor, deseja continuar?Confirmação do servidor de desligamento
@@ -1159,6 +1199,24 @@
Se ativado, o servidor será reiniciado mesmo se o desligamento for Reinicializações Automáticas e Atualizações Automáticas.
+
+ Detalhes do Discord Bot
+ Id do canal:
+ O id do canal do discord que este perfil irá usar.
+ Permitir backup
+ Se ativado, o perfil usará os comandos de backup pelo discord.
+ Permitir Reinício
+ Se ativado, o perfil usará comandos de reinicialização pelo discord.
+ Permitir desligamento
+ Se ativado, o perfil usará comandos de desligamento pelo discord.
+ Permitir iníciar
+ Se ativado, o perfil usará os comandos de iníciar pelo discord.
+ Permitir parar
+ Se ativado, o perfil usará os comandos de parar pelo discord.
+ Permitir atualização
+ Se ativado, o perfil usará os comandos de atualização pelo discord.
+
+
RegrasAtivar o modo Hardcore
@@ -5520,4 +5578,32 @@
Ocorreu um problema ao executar a atualização do servidor. Isso pode deixar o servidor em um estado incompleto.\r\n\r\nDeseja continuar com a inicialização do servidor, isso pode causar problemas?
+
+ Discord Bot Error
+ O discord bot requer um token válido para que possa se conectar ao servidor discord\r\nIsso pode ser definido nas configurações globais.
+ O prefixo discord bot contém caracteres inválidos. Somente letras e números são permitidos.
+
+ O comando '{0}' não foi habilitado.
+ Comando desconhecido '{0}'.
+ Outro comando está sendo processado.
+ Outro comando '{0}' está em execução no perfil '{1}'.
+ O comando '{0}' foi desativado para o perfil '{1}'.
+
+ O comando '{0}' requer um id de perfil.
+ O perfil '{0}' não foi encontrado ou não está associado ao canal.
+ O perfil '{0}' está em um estado '{1}' que não pode executar este comando.
+ O perfil '{0}' está sendo atualizado.
+
+ A chamada para o servidor '{0}' falhou.
+ Uma solicitação de backup para o servidor '{0}' foi enviada.
+ Um pedido de reinicialização do servidor '{0}' foi enviado.
+ Um pedido de desligamento do servidor '{0}' foi enviado.
+ Uma solicitação de iníciar para o servidor '{0}' foi enviada.
+ Uma solicitação de parar o servidor '{0}' foi enviada.
+ Uma solicitação de atualização para o servidor '{0}' foi enviada.
+
+ Quantidade:
+ Mapa:
+
+
\ No newline at end of file
diff --git a/src/ARKServerManager/Globalization/zh-CN/zh-CN.xaml b/src/ARKServerManager/Globalization/zh-CN/zh-CN.xaml
index 96c2ef2e..8dc3a36f 100644
--- a/src/ARKServerManager/Globalization/zh-CN/zh-CN.xaml
+++ b/src/ARKServerManager/Globalization/zh-CN/zh-CN.xaml
@@ -9,11 +9,11 @@
翻译:
- 2021.11.30(龍柒)
+ 2021.12.07(龍柒)错误
-
+
孤岛(The Island)中心岛地图(The Center)焦土地图(Scorched Earth)
@@ -21,8 +21,8 @@
畸变地图(Aberration)灭绝地图(Extinction)瓦尔盖罗(Valguero)
- 创世纪(Genesis)
- 创世纪 2(Genesis: Part 2)
+ 创世纪 1(Genesis: Part 1)
+ 创世纪 2(Genesis: Part 2)水晶岛(Crystal Isles)
@@ -34,8 +34,8 @@
生存
-
- 无节日
+
+ 无节日情人节复活节恐惧进化(万圣节)
@@ -43,7 +43,7 @@
冬季仙境(圣诞节)
-
+
所有未知方舟主体
@@ -163,6 +163,25 @@
选择处理器
+
+
+
+ 数据文件夹选择
+ 您似乎没有数据目录集. 数据目录是存储配置文件和streamcmd的地方.它与服务器安装目录不同,您可以为每个配置文件选择.
+ 选择数据文件夹的硬盘号.
+ 数据文件夹名称:
+ 服务器管理器数据文件夹的名称.
+ 本地磁盘
+ {0} free of {1}
+
+ Ok
+ 取消
+ 刷新
+
+ 数据目录选择错误
+ 您输入的数据文件夹名称无效.
+ 需要重新启动服务器管理器
+ 数据文件夹已设置,现在必须重新启动服务器管理器才能使用新设置.
diff --git a/src/ARKServerManager/Styles/Default.xaml b/src/ARKServerManager/Styles/Default.xaml
index 9fecf6e6..b509fe68 100644
--- a/src/ARKServerManager/Styles/Default.xaml
+++ b/src/ARKServerManager/Styles/Default.xaml
@@ -688,6 +688,11 @@
+
+
+
+
+
diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml
index e69072ac..3570a2c1 100644
--- a/src/ARKServerManager/VersionFeed.xml
+++ b/src/ARKServerManager/VersionFeed.xml
@@ -5,14 +5,14 @@
Ark Server Manager Version FeedThis is the Ark Server Manager release version feed.
- 2021-12-06T00:00:00Z
+ 2021-12-08T00:00:00Zurn:uuid:DBAFCE91-2235-4B6C-AE9B-5E4EF9FEC8F5
- 1.1.411 (1.1.411.1)
- 1.1.411.1
+ 1.1.411 (1.1.411.2)
+ 1.1.411.2
- 2021-12-06T00:00:00Z
+ 2021-12-08T00:00:00Z
@@ -21,13 +21,22 @@
A new Discord Bot has been added to the server manager.
- This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
- To setup the new discord bot, open the global settings and scroll down to the Discord section.
+ This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
+ To setup the new discord bot, open the global settings and scroll down to the Discord section.
NOTE: This is long process to get the discord bot working, and I have created a forum post with detailed instructions how to do it.
+ CHANGE
+
+
+
+
Global Settings - Added reset button to the Data Directory Location.
+
pt-BR Translation file updated.
+
zh-CN Translation file updated.
+
+
diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml
index 6ff41ee2..73775da6 100644
--- a/src/ARKServerManager/VersionFeedBeta.xml
+++ b/src/ARKServerManager/VersionFeedBeta.xml
@@ -5,7 +5,34 @@
Ark Server Manager Version FeedThis is the Ark Server Manager beta version feed.
- 2021-12-06T00:00:00Z
+ 2021-12-08T00:00:00Z
+
+
+ urn:uuid:ADBF3FE0-017C-4E23-8FE8-EFE75E7C8BA1
+ 1.1.411 (1.1.411.2)
+ 1.1.411.2
+
+ 2021-12-08T00:00:00Z
+
+
+
+ CHANGE
+
+
+
+
Global Settings - Added reset button to the Data Directory Location.
A new Discord Bot has been added to the server manager.
- This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
- To setup the new discord bot, open the global settings and scroll down to the Discord section.
+
+ A new Discord Bot has been added to the server manager.
+ This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
+ To setup the new discord bot, open the global settings and scroll down to the Discord section.
NOTE: This is long process to get the discord bot working, and I have created a forum post with detailed instructions how to do it.
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
index 9685a6fd..6919def4 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
@@ -71,11 +71,12 @@
-
+
+
-
+
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
index 6c0a866b..91320412 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
@@ -203,6 +203,21 @@ namespace ServerManagerTool
}
}
+ private void ResetDataDir_Click(object sender, RoutedEventArgs e)
+ {
+ // Confirm the reset with the user.
+ if (MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_ResetDataDirectory_ConfirmLabel"), _globalizer.GetResourceString("GlobalSettings_ResetDataDirectory_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
+ return;
+
+ // Update the config
+ Config.Default.DataDir = string.Empty;
+ Config.Default.ConfigDirectory = string.Empty;
+
+ App.SaveConfigFiles(false);
+
+ Environment.Exit(0);
+ }
+
private void SetBackupDir_Click(object sender, RoutedEventArgs e)
{
var dialog = new CommonOpenFileDialog();
@@ -384,13 +399,11 @@ namespace ServerManagerTool
{
Config.Default.Reset();
Config.Default.UpgradeConfig = false;
- Config.Default.Save();
- Config.Default.Reload();
CommonConfig.Default.Reset();
CommonConfig.Default.UpgradeConfig = false;
- CommonConfig.Default.Save();
- CommonConfig.Default.Reload();
+
+ App.SaveConfigFiles(false);
}
catch (Exception ex)
{
@@ -400,7 +413,7 @@ namespace ServerManagerTool
}
finally
{
- App.Current.Shutdown(exitCode);
+ Environment.Exit(0);
}
}
diff --git a/src/ARKServerManager/Windows/MainWindow.xaml.cs b/src/ARKServerManager/Windows/MainWindow.xaml.cs
index 352049ae..1b95b8ed 100644
--- a/src/ARKServerManager/Windows/MainWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/MainWindow.xaml.cs
@@ -251,13 +251,6 @@ namespace ServerManagerTool
PlayerListWindow.CloseAllWindows();
ServerMonitorWindow.CloseAllWindows();
this.versionChecker.DisposeAsync().DoNotWait();
-
- var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- var backupFolder = IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath)
- ? Path.Combine(Config.Default.DataDir, Config.Default.BackupDir)
- : Path.Combine(Config.Default.BackupPath));
- SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder);
- SettingsUtils.BackupUserConfigSettings(CommonConfig.Default, "commonconfig.json", installFolder, backupFolder);
}
private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
diff --git a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
index 0cb7b676..58c918b6 100644
--- a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
@@ -1,5 +1,4 @@
-using ServerManagerTool.Common;
-using ServerManagerTool.Common.Utils;
+using ServerManagerTool.Common.Utils;
using System;
using System.IO;
using System.Reflection;
@@ -84,11 +83,7 @@ namespace ServerManagerTool
Config.Default.SteamCmd_UseAnonymousCredentials = true;
}
- Config.Default.Save();
- CommonConfig.Default.Save();
-
- Config.Default.Reload();
- CommonConfig.Default.Reload();
+ App.SaveConfigFiles(false);
base.OnClosed(e);
}
diff --git a/src/ConanServerManager/App.xaml.cs b/src/ConanServerManager/App.xaml.cs
index f6ebab3d..f5ab9594 100644
--- a/src/ConanServerManager/App.xaml.cs
+++ b/src/ConanServerManager/App.xaml.cs
@@ -408,8 +408,7 @@ namespace ServerManagerTool
Config.Default.ConfigPath = Path.Combine(Config.Default.DataPath, Config.Default.ProfilesRelativePath);
System.IO.Directory.CreateDirectory(Config.Default.ConfigPath);
- Config.Default.Save();
- CommonConfig.Default.Save();
+ SaveConfigFiles();
if (restartRequired)
{
@@ -508,13 +507,31 @@ namespace ServerManagerTool
MessageBox.Show(String.Format(_globalizer.GetResourceString("Application_Profile_SaveFailedLabel"), server.Profile.ProfileName, ex.Message, ex.StackTrace), _globalizer.GetResourceString("Application_Profile_SaveFailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
- Config.Default.Save();
- CommonConfig.Default.Save();
+ App.SaveConfigFiles();
}
PluginHelper.Instance?.Dispose();
this.ApplicationStarted = false;
}
+
+ public static void SaveConfigFiles(bool includeBackup = true)
+ {
+ Config.Default.Save();
+ CommonConfig.Default.Save();
+
+ Config.Default.Reload();
+ CommonConfig.Default.Reload();
+
+ var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ var backupFolder = includeBackup
+ ? IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath)
+ ? Path.Combine(Config.Default.DataPath, Config.Default.BackupRelativePath)
+ : Path.Combine(Config.Default.BackupPath))
+ : null;
+
+ SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder);
+ SettingsUtils.BackupUserConfigSettings(CommonConfig.Default, "commonconfig.json", installFolder, backupFolder);
+ }
}
}
diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml
index ffca5034..1a4dddf1 100644
--- a/src/ConanServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml
@@ -835,6 +835,8 @@
Changing the data directory will move any existing profiles to the new location, but it will not move any server installations. Do you still want to change this directory?Failed to change data directoryThere was an error changing the data directory: {0}\r\nPlease correct the error and try again, or contact technical support for assistance.
+ Confirm Data Directory Reset
+ Click 'Yes' to confirm you want to reset the location of the data directory. Once reset, the server manager will shutdown and you will need to restart.Select Backup DirectorySelect Cache Directory
diff --git a/src/ConanServerManager/Styles/Default.xaml b/src/ConanServerManager/Styles/Default.xaml
index 75585067..53d07ec7 100644
--- a/src/ConanServerManager/Styles/Default.xaml
+++ b/src/ConanServerManager/Styles/Default.xaml
@@ -641,6 +641,11 @@
+
+
+
+
+
diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml
index 0f651bcf..a9f179e7 100644
--- a/src/ConanServerManager/VersionFeed.xml
+++ b/src/ConanServerManager/VersionFeed.xml
@@ -5,14 +5,14 @@
Conan Server Manager Version FeedThis is the Conan Server Manager release version feed.
- 2021-12-02T00:00:00Z
+ 2021-12-08T00:00:00Zurn:uuid:F8A08616-749B-48E7-87D5-D97E86AB3926
- 1.1.56 (1.1.56.1)
- 1.1.56.1
+ 1.1.56 (1.1.56.2)
+ 1.1.56.2
- 2021-12-06T00:00:00Z
+ 2021-12-08T00:00:00Z
@@ -21,13 +21,20 @@
A new Discord Bot has been added to the server manager.
- This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
- To setup the new discord bot, open the global settings and scroll down to the Discord section.
+ This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
+ To setup the new discord bot, open the global settings and scroll down to the Discord section.
NOTE: This is long process to get the discord bot working, and I have created a forum post with detailed instructions how to do it.
+ CHANGE
+
+
+
+
Global Settings - Added reset button to the Data Directory Location.
+
+
diff --git a/src/ConanServerManager/VersionFeedBeta.xml b/src/ConanServerManager/VersionFeedBeta.xml
index 4c2a007c..c99402e6 100644
--- a/src/ConanServerManager/VersionFeedBeta.xml
+++ b/src/ConanServerManager/VersionFeedBeta.xml
@@ -5,7 +5,32 @@
Conan Server Manager Version FeedThis is the Conan Server Manager beta version feed.
- 2021-12-06T00:00:00Z
+ 2021-12-08T00:00:00Z
+
+
+ urn:uuid:F8A08616-749B-48E7-87D5-D97E86AB3926
+ 1.1.56 (1.1.56.2)
+ 1.1.56.2
+
+ 2021-12-08T00:00:00Z
+
+
+
+ CHANGE
+
+
+
+
Global Settings - Added reset button to the Data Directory Location.
A new Discord Bot has been added to the server manager.
- This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
- To setup the new discord bot, open the global settings and scroll down to the Discord section.
+ This new discord bot will allow you to send Start, Stop, Shutdown, Restart, Backup and Update commands to the server manager from within your discord client.
+ To setup the new discord bot, open the global settings and scroll down to the Discord section.
NOTE: This is long process to get the discord bot working, and I have created a forum post with detailed instructions how to do it.
diff --git a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
index a52e7497..1a6f3909 100644
--- a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
+++ b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml
@@ -76,6 +76,7 @@
+
diff --git a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
index 2b59e598..baca682b 100644
--- a/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
+++ b/src/ConanServerManager/Windows/GlobalSettingsControl.xaml.cs
@@ -213,6 +213,21 @@ namespace ServerManagerTool
}
}
+ private void ResetDataDir_Click(object sender, RoutedEventArgs e)
+ {
+ // Confirm the reset with the user.
+ if (MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_ResetDataDirectory_ConfirmLabel"), _globalizer.GetResourceString("GlobalSettings_ResetDataDirectory_ConfirmTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
+ return;
+
+ // Update the config
+ Config.Default.DataPath = string.Empty;
+ Config.Default.ConfigPath = string.Empty;
+
+ App.SaveConfigFiles(false);
+
+ Environment.Exit(0);
+ }
+
private void SetBackupDir_Click(object sender, RoutedEventArgs e)
{
var dialog = new CommonOpenFileDialog();
@@ -393,13 +408,11 @@ namespace ServerManagerTool
{
Config.Default.Reset();
Config.Default.UpgradeConfig = false;
- Config.Default.Save();
- Config.Default.Reload();
CommonConfig.Default.Reset();
CommonConfig.Default.UpgradeConfig = false;
- CommonConfig.Default.Save();
- CommonConfig.Default.Reload();
+
+ App.SaveConfigFiles(false);
}
catch (Exception ex)
{
@@ -409,7 +422,7 @@ namespace ServerManagerTool
}
finally
{
- App.Current.Shutdown(exitCode);
+ Environment.Exit(0);
}
}
diff --git a/src/ConanServerManager/Windows/MainWindow.xaml.cs b/src/ConanServerManager/Windows/MainWindow.xaml.cs
index cbd30acb..d901db40 100644
--- a/src/ConanServerManager/Windows/MainWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/MainWindow.xaml.cs
@@ -244,13 +244,6 @@ namespace ServerManagerTool
PlayerListWindow.CloseAllWindows();
ServerMonitorWindow.CloseAllWindows();
this.versionChecker.DisposeAsync().DoNotWait();
-
- var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- var backupFolder = IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath)
- ? Path.Combine(Config.Default.DataPath, Config.Default.BackupRelativePath)
- : Path.Combine(Config.Default.BackupPath));
- SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder);
- SettingsUtils.BackupUserConfigSettings(CommonConfig.Default, "commonconfig.json", installFolder, backupFolder);
}
private void ResourceDictionaryChangedEvent(object source, ResourceDictionaryChangedEventArgs e)
diff --git a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
index 572a8365..d989298b 100644
--- a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
@@ -1,5 +1,4 @@
-using ServerManagerTool.Common;
-using ServerManagerTool.Common.Utils;
+using ServerManagerTool.Common.Utils;
using System;
using System.ComponentModel;
using System.IO;
@@ -101,11 +100,7 @@ namespace ServerManagerTool
Config.Default.SteamCmd_UseAnonymousCredentials = true;
}
- Config.Default.Save();
- CommonConfig.Default.Save();
-
- Config.Default.Reload();
- CommonConfig.Default.Reload();
+ App.SaveConfigFiles(false);
base.OnClosed(e);
}