Auto Update Tweaks

Support Zip Creation - added new config settings.
This commit is contained in:
Brett Hewitson 2021-12-20 10:16:02 +10:00
parent aa265bfbb6
commit 8bf57a71b9
14 changed files with 233 additions and 140 deletions

View file

@ -101,16 +101,16 @@
<setting name="HelpUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/thread/1194/faq-frequently-asked</value>
</setting>
<setting name="ArkSE_PatchNotesUrl" serializeAs="String">
<setting name="AppPatchNotesUrl" serializeAs="String">
<value>https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/</value>
</setting>
<setting name="ArkSotF_PatchNotesUrl" serializeAs="String">
<setting name="AppPatchNotesUrlSotF" serializeAs="String">
<value>https://survivetheark.com/index.php?/forums/forum/9-changelog-patch-notes/</value>
</setting>
<setting name="ArkSEUrl" serializeAs="String">
<setting name="AppUrl" serializeAs="String">
<value>http://store.steampowered.com/app/346110/</value>
</setting>
<setting name="ArkSotfUrl" serializeAs="String">
<setting name="AppUrl_SotF" serializeAs="String">
<value>http://store.steampowered.com/app/407530/</value>
</setting>
<setting name="LastUpdatedTimeFile" serializeAs="String">
@ -122,7 +122,7 @@
<setting name="SteamCmdInstallModArgsFormat" serializeAs="String">
<value>+login {0} +workshop_download_item {1} {2} +quit</value>
</setting>
<setting name="ArkSteamWorkshopFolderRelativePath" serializeAs="String">
<setting name="AppSteamWorkshopFolderRelativePath" serializeAs="String">
<value>steamapps\workshop\content\346110\</value>
</setting>
<setting name="ServerModsRelativePath" serializeAs="String">
@ -146,13 +146,13 @@
<setting name="SteamWorkshopFolderRelativePath" serializeAs="String">
<value>steamapps\workshop</value>
</setting>
<setting name="ArkSteamWorkshopFile" serializeAs="String">
<setting name="AppSteamWorkshopFile" serializeAs="String">
<value>appworkshop_346110.acf</value>
</setting>
<setting name="ArkSteamWorkshopFile_SotF" serializeAs="String">
<setting name="AppSteamWorkshopFile_SotF" serializeAs="String">
<value>appworkshop_407530.acf</value>
</setting>
<setting name="ArkSteamWorkshopFolderRelativePath_SotF" serializeAs="String">
<setting name="AppSteamWorkshopFolderRelativePath_SotF" serializeAs="String">
<value>steamapps\workshop\content\407530\</value>
</setting>
<setting name="WorkshopCacheFile_SotF" serializeAs="String">
@ -191,13 +191,13 @@
<setting name="LatestASMBetaPatchNotesUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/board/11/beta-testers</value>
</setting>
<setting name="ArkWhitelistFile" serializeAs="String">
<setting name="ServerWhitelistFile" serializeAs="String">
<value>PlayersJoinNoCheckList.txt</value>
</setting>
<setting name="ArkAdminFile" serializeAs="String">
<setting name="ServerAdminFile" serializeAs="String">
<value>AllowedCheaterSteamIDs.txt</value>
</setting>
<setting name="ArkExclusiveFile" serializeAs="String">
<setting name="ServerExclusiveFile" serializeAs="String">
<value>PlayersExclusiveJoinList.txt</value>
</setting>
<setting name="DefaultServerFolderName" serializeAs="String">
@ -299,10 +299,10 @@
<setting name="ServerBranchFolderPrefix" serializeAs="String">
<value>__</value>
</setting>
<setting name="ArkSteamManifestFile" serializeAs="String">
<setting name="AppSteamManifestFile" serializeAs="String">
<value>appmanifest_376030.acf</value>
</setting>
<setting name="ArkSteamManifestFile_SotF" serializeAs="String">
<setting name="AppSteamManifestFile_SotF" serializeAs="String">
<value>appmanifest_407530.acf</value>
</setting>
<setting name="SteamManifestFolderRelativePath" serializeAs="String">
@ -604,7 +604,7 @@
<value>True</value>
</setting>
<setting name="AutoUpdate_ParallelUpdate" serializeAs="String">
<value>True</value>
<value>False</value>
</setting>
<setting name="AutoUpdate_UpdateReasonPrefix" serializeAs="String">
<value>Server Update Reason:</value>
@ -679,7 +679,7 @@
<value>True</value>
</setting>
<setting name="AutoUpdate_SequencialDelayPeriod" serializeAs="String">
<value>0</value>
<value>10</value>
</setting>
<setting name="SectionStackSizeOverridesEnabled" serializeAs="String">
<value>True</value>

View file

@ -579,36 +579,36 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/")]
public string ArkSE_PatchNotesUrl {
public string AppPatchNotesUrl {
get {
return ((string)(this["ArkSE_PatchNotesUrl"]));
return ((string)(this["AppPatchNotesUrl"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://survivetheark.com/index.php?/forums/forum/9-changelog-patch-notes/")]
public string ArkSotF_PatchNotesUrl {
public string AppPatchNotesUrlSotF {
get {
return ((string)(this["ArkSotF_PatchNotesUrl"]));
return ((string)(this["AppPatchNotesUrlSotF"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://store.steampowered.com/app/346110/")]
public string ArkSEUrl {
public string AppUrl {
get {
return ((string)(this["ArkSEUrl"]));
return ((string)(this["AppUrl"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://store.steampowered.com/app/407530/")]
public string ArkSotfUrl {
public string AppUrl_SotF {
get {
return ((string)(this["ArkSotfUrl"]));
return ((string)(this["AppUrl_SotF"]));
}
}
@ -752,9 +752,9 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("steamapps\\workshop\\content\\346110\\")]
public string ArkSteamWorkshopFolderRelativePath {
public string AppSteamWorkshopFolderRelativePath {
get {
return ((string)(this["ArkSteamWorkshopFolderRelativePath"]));
return ((string)(this["AppSteamWorkshopFolderRelativePath"]));
}
}
@ -1052,9 +1052,9 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("appworkshop_346110.acf")]
public string ArkSteamWorkshopFile {
public string AppSteamWorkshopFile {
get {
return ((string)(this["ArkSteamWorkshopFile"]));
return ((string)(this["AppSteamWorkshopFile"]));
}
}
@ -1121,18 +1121,18 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("appworkshop_407530.acf")]
public string ArkSteamWorkshopFile_SotF {
public string AppSteamWorkshopFile_SotF {
get {
return ((string)(this["ArkSteamWorkshopFile_SotF"]));
return ((string)(this["AppSteamWorkshopFile_SotF"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("steamapps\\workshop\\content\\407530\\")]
public string ArkSteamWorkshopFolderRelativePath_SotF {
public string AppSteamWorkshopFolderRelativePath_SotF {
get {
return ((string)(this["ArkSteamWorkshopFolderRelativePath_SotF"]));
return ((string)(this["AppSteamWorkshopFolderRelativePath_SotF"]));
}
}
@ -1250,18 +1250,18 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("PlayersJoinNoCheckList.txt")]
public string ArkWhitelistFile {
public string ServerWhitelistFile {
get {
return ((string)(this["ArkWhitelistFile"]));
return ((string)(this["ServerWhitelistFile"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("AllowedCheaterSteamIDs.txt")]
public string ArkAdminFile {
public string ServerAdminFile {
get {
return ((string)(this["ArkAdminFile"]));
return ((string)(this["ServerAdminFile"]));
}
}
@ -1280,9 +1280,9 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("PlayersExclusiveJoinList.txt")]
public string ArkExclusiveFile {
public string ServerExclusiveFile {
get {
return ((string)(this["ArkExclusiveFile"]));
return ((string)(this["ServerExclusiveFile"]));
}
}
@ -1652,7 +1652,7 @@ namespace ServerManagerTool {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AutoUpdate_ParallelUpdate {
get {
return ((bool)(this["AutoUpdate_ParallelUpdate"]));
@ -2108,18 +2108,18 @@ namespace ServerManagerTool {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("appmanifest_376030.acf")]
public string ArkSteamManifestFile {
public string AppSteamManifestFile {
get {
return ((string)(this["ArkSteamManifestFile"]));
return ((string)(this["AppSteamManifestFile"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("appmanifest_407530.acf")]
public string ArkSteamManifestFile_SotF {
public string AppSteamManifestFile_SotF {
get {
return ((string)(this["ArkSteamManifestFile_SotF"]));
return ((string)(this["AppSteamManifestFile_SotF"]));
}
}
@ -2227,7 +2227,7 @@ namespace ServerManagerTool {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
[global::System.Configuration.DefaultSettingValueAttribute("10")]
public int AutoUpdate_SequencialDelayPeriod {
get {
return ((int)(this["AutoUpdate_SequencialDelayPeriod"]));

View file

@ -161,16 +161,16 @@
<Setting Name="CustomLevelXPIncrease_Dino" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="ArkSE_PatchNotesUrl" Type="System.String" Scope="Application">
<Setting Name="AppPatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/</Value>
</Setting>
<Setting Name="ArkSotF_PatchNotesUrl" Type="System.String" Scope="Application">
<Setting Name="AppPatchNotesUrlSotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://survivetheark.com/index.php?/forums/forum/9-changelog-patch-notes/</Value>
</Setting>
<Setting Name="ArkSEUrl" Type="System.String" Scope="Application">
<Setting Name="AppUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://store.steampowered.com/app/346110/</Value>
</Setting>
<Setting Name="ArkSotfUrl" Type="System.String" Scope="Application">
<Setting Name="AppUrl_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://store.steampowered.com/app/407530/</Value>
</Setting>
<Setting Name="RunAsAdministratorPrompt" Type="System.Boolean" Scope="User">
@ -209,7 +209,7 @@
<Setting Name="SteamCmdInstallModArgsFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login {0} +workshop_download_item {1} {2} +quit</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFolderRelativePath" Type="System.String" Scope="Application">
<Setting Name="AppSteamWorkshopFolderRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop\content\346110\</Value>
</Setting>
<Setting Name="ServerModsRelativePath" Type="System.String" Scope="Application">
@ -290,7 +290,7 @@
<Setting Name="SteamWorkshopFolderRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFile" Type="System.String" Scope="Application">
<Setting Name="AppSteamWorkshopFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">appworkshop_346110.acf</Value>
</Setting>
<Setting Name="SteamCmd_Password" Type="System.String" Scope="User">
@ -308,10 +308,10 @@
<Setting Name="ServerUpdate_OnServerStart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFile_SotF" Type="System.String" Scope="Application">
<Setting Name="AppSteamWorkshopFile_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">appworkshop_407530.acf</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFolderRelativePath_SotF" Type="System.String" Scope="Application">
<Setting Name="AppSteamWorkshopFolderRelativePath_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop\content\407530\</Value>
</Setting>
<Setting Name="WorkshopCacheFile_SotF" Type="System.String" Scope="Application">
@ -350,16 +350,16 @@
<Setting Name="LatestASMBetaPatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/board/11/beta-testers</Value>
</Setting>
<Setting Name="ArkWhitelistFile" Type="System.String" Scope="Application">
<Setting Name="ServerWhitelistFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">PlayersJoinNoCheckList.txt</Value>
</Setting>
<Setting Name="ArkAdminFile" Type="System.String" Scope="Application">
<Setting Name="ServerAdminFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">AllowedCheaterSteamIDs.txt</Value>
</Setting>
<Setting Name="SectionServerFilesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ArkExclusiveFile" Type="System.String" Scope="Application">
<Setting Name="ServerExclusiveFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">PlayersExclusiveJoinList.txt</Value>
</Setting>
<Setting Name="EmailNotify_ShutdownRestart" Type="System.Boolean" Scope="User">
@ -462,7 +462,7 @@
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_ParallelUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoUpdate_UpdateReasonPrefix" Type="System.String" Scope="User">
<Value Profile="(Default)">Server Update Reason:</Value>
@ -590,10 +590,10 @@
<Setting Name="ServerBranchFolderPrefix" Type="System.String" Scope="Application">
<Value Profile="(Default)">__</Value>
</Setting>
<Setting Name="ArkSteamManifestFile" Type="System.String" Scope="Application">
<Setting Name="AppSteamManifestFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">appmanifest_376030.acf</Value>
</Setting>
<Setting Name="ArkSteamManifestFile_SotF" Type="System.String" Scope="Application">
<Setting Name="AppSteamManifestFile_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">appmanifest_407530.acf</Value>
</Setting>
<Setting Name="SteamManifestFolderRelativePath" Type="System.String" Scope="Application">
@ -627,7 +627,7 @@
<Value Profile="(Default)">ArkServerManager</Value>
</Setting>
<Setting Name="AutoUpdate_SequencialDelayPeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
<Value Profile="(Default)">10</Value>
</Setting>
<Setting Name="SectionStackSizeOverridesEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>

View file

@ -804,7 +804,8 @@ namespace ServerManagerTool.Lib
success = false;
LogProfileMessage("****************************");
LogProfileMessage("ERROR: Failed server update.");
LogProfileMessage("****************************\r\n");
LogProfileMessage("****************************");
LogProfileMessage("Check steamcmd logs for more information why the server update failed.\r\n");
if (Config.Default.SteamCmdRedirectOutput)
LogProfileMessage($"If the server update keeps failing try disabling the '{_globalizer.GetResourceString("GlobalSettings_SteamCmdRedirectOutputLabel")}' option in the settings window.\r\n");
@ -981,6 +982,7 @@ namespace ServerManagerTool.Lib
LogProfileMessage("***************************");
LogProfileMessage("ERROR: Mod download failed.");
LogProfileMessage("***************************\r\n");
LogProfileMessage("Check steamcmd logs for more information why the mod update failed.\r\n");
if (Config.Default.SteamCmdRedirectOutput)
LogProfileMessage($"If the mod update keeps failing try disabling the '{_globalizer.GetResourceString("GlobalSettings_SteamCmdRedirectOutputLabel")}' option in the settings window.\r\n");
@ -1195,6 +1197,7 @@ namespace ServerManagerTool.Lib
}
// stop the server
LogProfileMessage("");
StopServer(CancellationToken.None);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1205,6 +1208,7 @@ namespace ServerManagerTool.Lib
emailMessage.AppendLine($"Server Manager version: {App.Instance.Version}");
// make a backup of the current profile and config files.
LogProfileMessage("");
CreateProfileBackupArchiveFile(_profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1213,6 +1217,7 @@ namespace ServerManagerTool.Lib
if (BackupWorldFile)
{
// make a backup of the current world file.
LogProfileMessage("");
CreateServerBackupArchiveFile(emailMessage, _profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1227,6 +1232,7 @@ namespace ServerManagerTool.Lib
alertMessage.AppendLine(Config.Default.Alert_UpdateResults);
// check if the server needs to be updated
LogProfileMessage("");
if (updateServer)
{
Task.Delay(5000).Wait();
@ -1259,16 +1265,14 @@ namespace ServerManagerTool.Lib
_profile.LastInstalledVersion = GetServerVersion(GetServerVersionFile()).ToString();
LogProfileMessage("Updated server from cache. See patch notes.");
LogProfileMessage($"Server version: {_profile.LastInstalledVersion}.");
LogProfileMessage(Config.Default.ArkSE_PatchNotesUrl);
LogProfileMessage(Config.Default.AppPatchNotesUrl);
if (!string.IsNullOrWhiteSpace(Config.Default.Alert_ServerUpdate))
alertMessage.AppendLine(Config.Default.Alert_ServerUpdate);
emailMessage.AppendLine();
emailMessage.AppendLine("Updated server from cache. See patch notes.");
emailMessage.AppendLine(Config.Default.ArkSE_PatchNotesUrl);
emailMessage.AppendLine(Config.Default.AppPatchNotesUrl);
_profile.ServerUpdated = true;
}
@ -1289,10 +1293,16 @@ namespace ServerManagerTool.Lib
LogProfileMessage("Server is already up to date, no update required.");
}
var serverVersion = GetServerVersion(GetServerVersionFile()).ToString();
LogProfileMessage($"Server version: {serverVersion}");
emailMessage.AppendLine($"Server version: {serverVersion}");
if (ExitCode != EXITCODE_NORMALEXIT)
return;
// check if the mods need to be updated
LogProfileMessage("");
if (updateModIds.Count > 0)
{
Task.Delay(5000).Wait();
@ -1389,12 +1399,14 @@ namespace ServerManagerTool.Lib
}
else
{
LogProfileMessage("Mods are already up to date, no updates required.");
if (modIdList.Count > 0)
LogProfileMessage("Mods are already up to date, no updates required.");
}
if (ExitCode != EXITCODE_NORMALEXIT)
return;
LogProfileMessage("");
if (Config.Default.AutoUpdate_OverrideServerStartup)
{
if (_serverRunning)
@ -1419,13 +1431,15 @@ namespace ServerManagerTool.Lib
}
else
{
if (updateModIds.Count > 0)
LogProfileMessage("");
if (modIdList.Count > 0)
LogProfileMessage("The server and mods files are already up to date, no updates required.");
else
LogProfileMessage("The server files are already up to date, no updates required.");
_serverRunning = GetServerProcess() != null;
LogProfileMessage("");
if (Config.Default.AutoUpdate_OverrideServerStartup)
{
if (!_serverRunning)
@ -1619,7 +1633,10 @@ namespace ServerManagerTool.Lib
{
// failed max limit reached
if (Config.Default.SteamCmdRedirectOutput)
{
LogMessage("Check steamcmd logs for more information why the mod cache update failed.\r\n");
LogMessage($"If the mod cache update keeps failing try disabling the '{_globalizer.GetResourceString("GlobalSettings_SteamCmdRedirectOutputLabel")}' option in the Server Manager settings window.");
}
ExitCode = EXITCODE_CACHEMODUPDATEFAILED;
return;
@ -1738,7 +1755,10 @@ namespace ServerManagerTool.Lib
{
// failed max limit reached
if (Config.Default.SteamCmdRedirectOutput)
{
LogBranchMessage(branchName, $"Check steamcmd logs for more information why the server cache update failed.\r\n");
LogBranchMessage(branchName, $"If the server cache update keeps failing try disabling the '{_globalizer.GetResourceString("GlobalSettings_SteamCmdRedirectOutputLabel")}' option in the ASM settings window.");
}
ExitCode = EXITCODE_CACHESERVERUPDATEFAILED;
return;
@ -1762,13 +1782,13 @@ namespace ServerManagerTool.Lib
}
else
LogBranchMessage(branchName, "No new version.");
var cacheVersion = GetServerVersion(GetServerCacheVersionFile(branchName)).ToString();
LogMessage($"Server cache version: {cacheVersion}");
}
else
LogBranchMessage(branchName, $"Server cache does not exist.");
var cacheVersion = GetServerVersion(GetServerCacheVersionFile(branchName)).ToString();
LogBranchMessage(branchName, $"Server cache version: {cacheVersion}");
LogBranchMessage(branchName, "-----------------------------");
LogBranchMessage(branchName, "Finished server cache update.");
LogBranchMessage(branchName, "-----------------------------");
@ -2015,13 +2035,6 @@ namespace ServerManagerTool.Lib
files.Add(file.FullName);
}
//var playerImageFileFilter = $"*{Config.Default.PlayerImageFileExtension}";
//var playerImageFiles = saveFolderInfo.GetFiles(playerImageFileFilter, SearchOption.TopDirectoryOnly);
//foreach (var file in playerImageFiles)
//{
// files.Add(file.FullName);
//}
var comment = new StringBuilder();
comment.AppendLine($"Windows Platform: {Environment.OSVersion.Platform}");
comment.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
@ -2378,16 +2391,23 @@ namespace ServerManagerTool.Lib
{
if (!string.IsNullOrWhiteSpace(versionFile) && File.Exists(versionFile))
{
var fileValue = File.ReadAllText(versionFile);
if (!string.IsNullOrWhiteSpace(fileValue))
try
{
string versionString = fileValue.ToString();
if (versionString.IndexOf('.') == -1)
versionString = versionString + ".0";
var fileValue = File.ReadAllText(versionFile);
if (Version.TryParse(versionString, out Version version))
return version;
if (!string.IsNullOrWhiteSpace(fileValue))
{
string versionString = fileValue.ToString();
if (versionString.IndexOf('.') == -1)
versionString = versionString + ".0";
if (Version.TryParse(versionString, out Version version))
return version;
}
}
catch (Exception)
{
// do nothing, just leave
}
}

View file

@ -6399,15 +6399,15 @@ namespace ServerManagerTool.Lib
var exclusiveFile = false;
var whitelistFile = false;
if (e.Name.Equals(Config.Default.ArkAdminFile, StringComparison.OrdinalIgnoreCase))
if (e.Name.Equals(Config.Default.ServerAdminFile, StringComparison.OrdinalIgnoreCase))
{
adminFile = true;
}
if (e.Name.Equals(Config.Default.ArkExclusiveFile, StringComparison.OrdinalIgnoreCase))
if (e.Name.Equals(Config.Default.ServerExclusiveFile, StringComparison.OrdinalIgnoreCase))
{
exclusiveFile = true;
}
if (e.Name.Equals(Config.Default.ArkWhitelistFile, StringComparison.OrdinalIgnoreCase))
if (e.Name.Equals(Config.Default.ServerWhitelistFile, StringComparison.OrdinalIgnoreCase))
{
whitelistFile = true;
}
@ -6499,7 +6499,7 @@ namespace ServerManagerTool.Lib
if (adminFile)
{
var file = Path.Combine(InstallDirectory, Config.Default.SavedRelativePath, Config.Default.ArkAdminFile);
var file = Path.Combine(InstallDirectory, Config.Default.SavedRelativePath, Config.Default.ServerAdminFile);
if (File.Exists(file))
{
adminSteamIds = File.ReadAllLines(file);
@ -6509,7 +6509,7 @@ namespace ServerManagerTool.Lib
if (exclusiveFile)
{
var file = Path.Combine(InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ArkExclusiveFile);
var file = Path.Combine(InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerExclusiveFile);
if (File.Exists(file))
{
exclusiveSteamIds = File.ReadAllLines(file);
@ -6519,7 +6519,7 @@ namespace ServerManagerTool.Lib
if (whitelistFile)
{
var file = Path.Combine(InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ArkWhitelistFile);
var file = Path.Combine(InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerWhitelistFile);
if (File.Exists(file))
{
whitelistSteamIds = File.ReadAllLines(file);
@ -6566,7 +6566,7 @@ namespace ServerManagerTool.Lib
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
var file = Path.Combine(folder, Config.Default.ArkAdminFile);
var file = Path.Combine(folder, Config.Default.ServerAdminFile);
File.WriteAllLines(file, this.ServerFilesAdmins.ToEnumerable());
}
catch (Exception ex)
@ -6583,7 +6583,7 @@ namespace ServerManagerTool.Lib
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
var file = Path.Combine(folder, Config.Default.ArkExclusiveFile);
var file = Path.Combine(folder, Config.Default.ServerExclusiveFile);
File.WriteAllLines(file, this.ServerFilesExclusive.ToEnumerable());
}
catch (Exception ex)
@ -6600,7 +6600,7 @@ namespace ServerManagerTool.Lib
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
var file = Path.Combine(folder, Config.Default.ArkWhitelistFile);
var file = Path.Combine(folder, Config.Default.ServerWhitelistFile);
File.WriteAllLines(file, this.ServerFilesWhitelisted.ToEnumerable());
}
catch (Exception ex)

View file

@ -789,7 +789,6 @@
<cctl:AnnotatedSlider Grid.Row="6" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesLabel}" Value="{Binding Config.LoggingMaxArchiveFiles}" Minimum="1" Maximum="1000" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Files}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
</Grid>
</GroupBox>
</Grid>
</ScrollViewer>
</Grid>

View file

@ -1,15 +1,4 @@
using Microsoft.WindowsAPICodePack.Dialogs;
using ServerManagerTool.Common;
using ServerManagerTool.Common.Lib;
using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Serialization;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Enums;
using ServerManagerTool.Lib;
using ServerManagerTool.Lib.ViewModel;
using ServerManagerTool.Plugin.Common;
using ServerManagerTool.Utils;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
@ -24,6 +13,17 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using Microsoft.WindowsAPICodePack.Dialogs;
using ServerManagerTool.Common;
using ServerManagerTool.Common.Lib;
using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Serialization;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Enums;
using ServerManagerTool.Lib;
using ServerManagerTool.Lib.ViewModel;
using ServerManagerTool.Plugin.Common;
using ServerManagerTool.Utils;
using WPFSharp.Globalizer;
namespace ServerManagerTool
@ -638,19 +638,19 @@ namespace ServerManagerTool
private void HelpSOTF_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(Config.Default.ArkSotfUrl))
if (string.IsNullOrWhiteSpace(Config.Default.AppUrl_SotF))
return;
Process.Start(Config.Default.ArkSotfUrl);
Process.Start(Config.Default.AppUrl_SotF);
}
private void PatchNotes_Click(object sender, RoutedEventArgs e)
{
var url = string.Empty;
if (Settings.SOTF_Enabled)
url =Config.Default.ArkSotF_PatchNotesUrl;
url =Config.Default.AppPatchNotesUrlSotF;
else
url = Config.Default.ArkSE_PatchNotesUrl;
url = Config.Default.AppPatchNotesUrl;
if (string.IsNullOrWhiteSpace(url))
return;
@ -791,9 +791,9 @@ namespace ServerManagerTool
// <data folder>\SteamCMD\steamapps\workshop\content\<app id>
if (this.Settings.SOTF_Enabled)
folder = Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.ArkSteamWorkshopFolderRelativePath_SotF);
folder = Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.AppSteamWorkshopFolderRelativePath_SotF);
else
folder = Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.ArkSteamWorkshopFolderRelativePath);
folder = Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.AppSteamWorkshopFolderRelativePath);
if (Directory.Exists(folder))
{
foreach (var modFolder in Directory.GetDirectories(folder))
@ -915,6 +915,9 @@ namespace ServerManagerTool
comment.AppendLine($"HasDiscordBotToken: {!string.IsNullOrWhiteSpace(Config.Default.DiscordBotToken)}");
comment.AppendLine($"DiscordBotServerId: {Config.Default.DiscordBotServerId}");
comment.AppendLine($"DiscordBotPrefix: {Config.Default.DiscordBotPrefix}");
comment.AppendLine($"DiscordBotLogLevel: {Config.Default.DiscordBotLogLevel}");
comment.AppendLine($"DiscordBotAllowAllBots: {Config.Default.DiscordBotAllowAllBots}");
comment.AppendLine($"DiscordBotWhitelist: {string.Join(";", Config.Default.DiscordBotWhitelist)}");
comment.AppendLine($"AllowDiscordBackup: {Config.Default.AllowDiscordBackup}");
comment.AppendLine($"AllowDiscordRestart: {Config.Default.AllowDiscordRestart}");
comment.AppendLine($"AllowDiscordShutdown: {Config.Default.AllowDiscordShutdown}");
@ -928,10 +931,15 @@ namespace ServerManagerTool
comment.AppendLine($"EmailNotify_ShutdownRestart: {Config.Default.EmailNotify_ShutdownRestart}");
comment.AppendLine($"ServerShutdown_UseShutdownCommand: {Config.Default.ServerShutdown_UseShutdownCommand}");
comment.AppendLine($"ServerShutdown_WorldSaveDelay: {Config.Default.ServerShutdown_WorldSaveDelay}");
comment.AppendLine($"BackupWorldFile: {Config.Default.BackupWorldFile}");
comment.AppendLine($"CloseShutdownWindowWhenFinished: {Config.Default.CloseShutdownWindowWhenFinished}");
comment.AppendLine($"AutoUpdate_VerifyServerAfterUpdate: {Config.Default.AutoUpdate_VerifyServerAfterUpdate}");
comment.AppendLine($"SteamCmdRemoveQuit: {CommonConfig.Default.SteamCmdRemoveQuit}");
comment.AppendLine($"UpdateDirectoryPermissions: {Config.Default.UpdateDirectoryPermissions}");
comment.AppendLine($"LoggingEnabled: {Config.Default.LoggingEnabled}");
comment.AppendLine($"LoggingMaxArchiveDays: {Config.Default.LoggingMaxArchiveDays}");
comment.AppendLine($"LoggingMaxArchiveFiles: {Config.Default.LoggingMaxArchiveFiles}");
comment.AppendLine($"ServerShutdown_WorldSaveDelay: {Config.Default.ServerShutdown_WorldSaveDelay}");
var zipFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), this.Settings.ProfileID + ".zip");
if (File.Exists(zipFile)) File.Delete(zipFile);

View file

@ -231,9 +231,9 @@ namespace ServerManagerTool.Utils
public static string GetModCachePath(string modId, bool isSotF)
{
if (isSotF)
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.ArkSteamWorkshopFolderRelativePath_SotF, modId));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.AppSteamWorkshopFolderRelativePath_SotF, modId));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.ArkSteamWorkshopFolderRelativePath, modId));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.AppSteamWorkshopFolderRelativePath, modId));
}
public static List<string> GetModIdList(string modIds)
@ -282,17 +282,17 @@ namespace ServerManagerTool.Utils
public static string GetSteamManifestFile(string installDirectory, bool isSotF)
{
if (isSotF)
return IOUtils.NormalizePath(Path.Combine(installDirectory, Config.Default.SteamManifestFolderRelativePath, Config.Default.ArkSteamManifestFile_SotF));
return IOUtils.NormalizePath(Path.Combine(installDirectory, Config.Default.SteamManifestFolderRelativePath, Config.Default.AppSteamManifestFile_SotF));
return IOUtils.NormalizePath(Path.Combine(installDirectory, Config.Default.SteamManifestFolderRelativePath, Config.Default.ArkSteamManifestFile));
return IOUtils.NormalizePath(Path.Combine(installDirectory, Config.Default.SteamManifestFolderRelativePath, Config.Default.AppSteamManifestFile));
}
public static string GetSteamWorkshopFile(bool isSotF)
{
if (isSotF)
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.SteamWorkshopFolderRelativePath, Config.Default.ArkSteamWorkshopFile_SotF));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.SteamWorkshopFolderRelativePath, Config.Default.AppSteamWorkshopFile_SotF));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.SteamWorkshopFolderRelativePath, Config.Default.ArkSteamWorkshopFile));
return IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir, Config.Default.SteamWorkshopFolderRelativePath, Config.Default.AppSteamWorkshopFile));
}
public static int GetSteamWorkshopLatestTime(string workshopFile, string modId)