mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Server Shutdown/Restart Fixes
- rewritten the code that sends the RCON commands to prevent the hangs after the RCON command fails. - added an accessibility check when doing the worldsave and first shutdown via RCON. - changed the online player count method on the main screen. - updated the support zip method with the new global settings.
This commit is contained in:
parent
5b822517c3
commit
2baf0bc392
10 changed files with 422 additions and 210 deletions
|
|
@ -572,10 +572,10 @@ namespace ServerManagerTool
|
|||
var profileFile = ServerProfile.LoadFromProfileFile(file, null);
|
||||
if (profileFile != null)
|
||||
{
|
||||
profileFile.AdminPassword = "obfuscated";
|
||||
profileFile.ServerPassword = "obfuscated";
|
||||
profileFile.RconPassword = "obfuscated";
|
||||
profileFile.BranchPassword = "obfuscated";
|
||||
profileFile.AdminPassword = string.IsNullOrWhiteSpace(profileFile.AdminPassword) ? "empty" : "obfuscated";
|
||||
profileFile.ServerPassword = string.IsNullOrWhiteSpace(profileFile.ServerPassword) ? "empty" : "obfuscated";
|
||||
profileFile.RconPassword = string.IsNullOrWhiteSpace(profileFile.RconPassword) ? "empty" : "obfuscated";
|
||||
profileFile.BranchPassword = string.IsNullOrWhiteSpace(profileFile.BranchPassword) ? "empty" : "obfuscated";
|
||||
obfuscateFiles.Add(file, profileFile.ToOutputString());
|
||||
}
|
||||
}
|
||||
|
|
@ -634,74 +634,92 @@ namespace ServerManagerTool
|
|||
comment.AppendLine($"Server Manager Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Code: {Config.Default.ServerManagerCode}");
|
||||
comment.AppendLine($"Server Manager Key: {Config.Default.ServerManagerUniqueKey}");
|
||||
comment.AppendLine($"Server Manager Directory: {Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}");
|
||||
comment.AppendLine($"Server Manager Directory: {Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}");
|
||||
|
||||
comment.AppendLine($"MachinePublicIP: {Config.Default.MachinePublicIP}");
|
||||
comment.AppendLine($"Data Directory: {Config.Default.DataPath}");
|
||||
comment.AppendLine($"Profiles Directory: {Config.Default.ConfigPath}");
|
||||
if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath))
|
||||
comment.AppendLine($"Backup Directory: {Config.Default.BackupPath}");
|
||||
else
|
||||
comment.AppendLine($"Backup Directory: *{Path.Combine(Config.Default.DataPath, Config.Default.BackupRelativePath)}");
|
||||
comment.AppendLine($"Server Directory: {this.Settings.InstallDirectory}");
|
||||
|
||||
comment.AppendLine($"IsAdministrator: {SecurityUtils.IsAdministrator()}");
|
||||
comment.AppendLine($"RunAsAdministratorPrompt: {Config.Default.RunAsAdministratorPrompt}");
|
||||
comment.AppendLine($"CheckIfServerManagerRunningOnStartup: {Config.Default.CheckIfServerManagerRunningOnStartup}");
|
||||
comment.AppendLine($"ManageFirewallAutomatically: {Config.Default.ManageFirewallAutomatically}");
|
||||
comment.AppendLine($"ManagePublicIPAutomatically: {Config.Default.ManagePublicIPAutomatically}");
|
||||
comment.AppendLine($"MainWindow_WindowState: {Config.Default.MainWindow_WindowState}");
|
||||
comment.AppendLine($"MainWindow_MinimizeToTray: {Config.Default.MainWindow_MinimizeToTray}");
|
||||
comment.AppendLine($"ManageFirewallAutomatically: {Config.Default.ManageFirewallAutomatically}");
|
||||
comment.AppendLine($"ValidateProfileOnServerStart: {Config.Default.ValidateProfileOnServerStart}");
|
||||
comment.AppendLine($"ServerMonitorWindow_WindowState: {Config.Default.ServerMonitorWindow_WindowState}");
|
||||
|
||||
comment.AppendLine($"SteamCMD File: {SteamCmdUpdater.GetSteamCmdFile(Config.Default.DataPath)}");
|
||||
comment.AppendLine($"SteamCmdRedirectOutput: {Config.Default.SteamCmdRedirectOutput}");
|
||||
comment.AppendLine($"SteamCmd_UseAnonymousCredentials: {Config.Default.SteamCmd_UseAnonymousCredentials}");
|
||||
comment.AppendLine($"SteamCmd_Username Set: {!string.IsNullOrWhiteSpace(Config.Default.SteamCmd_Username)}");
|
||||
comment.AppendLine($"SteamCmd_Password Set: {!string.IsNullOrWhiteSpace(Config.Default.SteamCmd_Password)}");
|
||||
comment.AppendLine($"SteamAPIKey: {!string.IsNullOrWhiteSpace(CommonConfig.Default.SteamAPIKey)}");
|
||||
|
||||
comment.AppendLine($"AutoBackup_EnableBackup: {Config.Default.AutoBackup_EnableBackup}");
|
||||
comment.AppendLine($"AutoBackup_BackupPeriod: {Config.Default.AutoBackup_BackupPeriod}");
|
||||
comment.AppendLine($"ServerStatus_EnableActions: {Config.Default.ServerStatus_EnableActions}");
|
||||
comment.AppendLine($"ServerStatus_ShowActionConfirmation: {Config.Default.ServerStatus_ShowActionConfirmation}");
|
||||
|
||||
comment.AppendLine($"ValidateProfileOnServerStart: {Config.Default.ValidateProfileOnServerStart}");
|
||||
comment.AppendLine($"ServerUpdate_OnServerStart: {Config.Default.ServerUpdate_OnServerStart}");
|
||||
comment.AppendLine($"ServerStartMinimized: {Config.Default.ServerStartMinimized}");
|
||||
|
||||
comment.AppendLine($"ServerUpdate_UpdateModsWhenUpdatingServer: {Config.Default.ServerUpdate_UpdateModsWhenUpdatingServer}");
|
||||
comment.AppendLine($"ServerUpdate_ForceUpdateMods: {Config.Default.ServerUpdate_ForceUpdateMods}");
|
||||
comment.AppendLine($"ServerUpdate_ForceCopyMods: {Config.Default.ServerUpdate_ForceCopyMods}");
|
||||
comment.AppendLine($"ServerUpdate_ForceUpdateModsIfNoSteamInfo: {Config.Default.ServerUpdate_ForceUpdateModsIfNoSteamInfo}");
|
||||
comment.AppendLine($"WorkshopCache_ExpiredHours: {Config.Default.WorkshopCache_ExpiredHours}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath))
|
||||
comment.AppendLine($"Backup Directory: {Config.Default.BackupPath}");
|
||||
else
|
||||
comment.AppendLine($"Backup Directory: *{Path.Combine(Config.Default.DataPath, Config.Default.BackupRelativePath)}");
|
||||
comment.AppendLine($"AutoBackup_IncludeSaveGamesFolder: {Config.Default.AutoBackup_IncludeSaveGamesFolder}");
|
||||
comment.AppendLine($"AutoBackup_DeleteOldFiles: {Config.Default.AutoBackup_DeleteOldFiles}");
|
||||
comment.AppendLine($"AutoBackup_DeleteInterval: {Config.Default.AutoBackup_DeleteInterval}");
|
||||
comment.AppendLine($"RCON_BackupMessageCommand: {Config.Default.RCON_BackupMessageCommand}");
|
||||
comment.AppendLine($"ServerBackup_WorldSaveMessage: {Config.Default.ServerBackup_WorldSaveMessage}");
|
||||
|
||||
comment.AppendLine($"AutoBackup_EnableBackup: {Config.Default.AutoBackup_EnableBackup}");
|
||||
comment.AppendLine($"AutoBackup_BackupPeriod: {Config.Default.AutoBackup_BackupPeriod}");
|
||||
|
||||
comment.AppendLine($"AutoUpdate_EnableUpdate: {Config.Default.AutoUpdate_EnableUpdate}");
|
||||
comment.AppendLine($"AutoUpdate_CacheDir: {Config.Default.AutoUpdate_CacheDir}");
|
||||
comment.AppendLine($"AutoUpdate_UpdatePeriod: {Config.Default.AutoUpdate_UpdatePeriod}");
|
||||
comment.AppendLine($"AutoUpdate_UseSmartCopy: {Config.Default.AutoUpdate_UseSmartCopy}");
|
||||
comment.AppendLine($"AutoUpdate_RetryOnFail: {Config.Default.AutoUpdate_RetryOnFail}");
|
||||
comment.AppendLine($"AutoUpdate_ShowUpdateReason: {Config.Default.AutoUpdate_ShowUpdateReason}");
|
||||
comment.AppendLine($"AutoUpdate_ValidateServerFiles: {Config.Default.AutoUpdate_ValidateServerFiles}");
|
||||
comment.AppendLine($"AutoUpdate_RetryOnFail: {Config.Default.AutoUpdate_RetryOnFail}");
|
||||
comment.AppendLine($"AutoUpdate_ParallelUpdate: {Config.Default.AutoUpdate_ParallelUpdate}");
|
||||
comment.AppendLine($"AutoUpdate_SequencialDelayPeriod: {Config.Default.AutoUpdate_SequencialDelayPeriod}");
|
||||
comment.AppendLine($"AutoUpdate_ShowUpdateReason: {Config.Default.AutoUpdate_ShowUpdateReason}");
|
||||
comment.AppendLine($"AutoUpdate_ShowUpdateReason: {Config.Default.AutoUpdate_UpdateReasonPrefix}");
|
||||
comment.AppendLine($"AutoUpdate_OverrideServerStartup: {Config.Default.AutoUpdate_OverrideServerStartup}");
|
||||
|
||||
comment.AppendLine($"AutoRestart_EnabledGracePeriod: {Config.Default.AutoRestart_EnabledGracePeriod}");
|
||||
comment.AppendLine($"AutoRestart_GracePeriod: {Config.Default.AutoRestart_GracePeriod}");
|
||||
|
||||
comment.AppendLine($"ServerShutdown_EnableWorldSave: {Config.Default.ServerShutdown_EnableWorldSave}");
|
||||
comment.AppendLine($"ServerShutdown_CheckForOnlinePlayers: {Config.Default.ServerShutdown_CheckForOnlinePlayers}");
|
||||
comment.AppendLine($"ServerShutdown_SendShutdownMessages: {Config.Default.ServerShutdown_SendShutdownMessages}");
|
||||
comment.AppendLine($"ServerShutdown_GracePeriod: {Config.Default.ServerShutdown_GracePeriod}");
|
||||
comment.AppendLine($"ServerUpdate_UpdateModsWhenUpdatingServer: {Config.Default.ServerUpdate_UpdateModsWhenUpdatingServer}");
|
||||
comment.AppendLine($"ServerUpdate_ForceCopyMods: {Config.Default.ServerUpdate_ForceCopyMods}");
|
||||
comment.AppendLine($"ServerUpdate_ForceUpdateMods: {Config.Default.ServerUpdate_ForceUpdateMods}");
|
||||
comment.AppendLine($"ServerUpdate_ForceUpdateModsIfNoSteamInfo: {Config.Default.ServerUpdate_ForceUpdateModsIfNoSteamInfo}");
|
||||
comment.AppendLine($"ServerUpdate_OnServerStart: {Config.Default.ServerUpdate_OnServerStart}");
|
||||
comment.AppendLine($"ServerShutdown_AllMessagesShowReason: {Config.Default.ServerShutdown_AllMessagesShowReason}");
|
||||
|
||||
comment.AppendLine($"DiscordBotEnabled: {Config.Default.DiscordBotEnabled}");
|
||||
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($"DiscordBotAllServersKeyword: {Config.Default.DiscordBotAllServersKeyword}");
|
||||
comment.AppendLine($"AllowDiscordBackup: {Config.Default.AllowDiscordBackup}");
|
||||
comment.AppendLine($"AllowDiscordRestart: {Config.Default.AllowDiscordRestart}");
|
||||
comment.AppendLine($"AllowDiscordShutdown: {Config.Default.AllowDiscordShutdown}");
|
||||
comment.AppendLine($"AllowDiscordStart: {Config.Default.AllowDiscordStart}");
|
||||
comment.AppendLine($"AllowDiscordStop: {Config.Default.AllowDiscordStop}");
|
||||
comment.AppendLine($"AllowDiscordUpdate: {Config.Default.AllowDiscordUpdate}");
|
||||
comment.AppendLine($"DiscordBotAllowAllBots: {Config.Default.DiscordBotAllowAllBots}");
|
||||
comment.AppendLine($"DiscordBotWhitelist: {string.Join(";", Config.Default.DiscordBotWhitelist)}");
|
||||
|
||||
comment.AppendLine($"EmailNotify_AutoRestart: {Config.Default.EmailNotify_AutoRestart}");
|
||||
comment.AppendLine($"EmailNotify_AutoBackup: {Config.Default.EmailNotify_AutoBackup}");
|
||||
comment.AppendLine($"EmailNotify_AutoUpdate: {Config.Default.EmailNotify_AutoUpdate}");
|
||||
comment.AppendLine($"EmailNotify_AutoRestart: {Config.Default.EmailNotify_AutoRestart}");
|
||||
comment.AppendLine($"EmailNotify_ShutdownRestart: {Config.Default.EmailNotify_ShutdownRestart}");
|
||||
|
||||
comment.AppendLine($"ServerShutdown_UseShutdownCommand: {Config.Default.ServerShutdown_UseShutdownCommand}");
|
||||
|
|
@ -710,10 +728,12 @@ namespace ServerManagerTool
|
|||
comment.AppendLine($"AutoUpdate_VerifyServerAfterUpdate: {Config.Default.AutoUpdate_VerifyServerAfterUpdate}");
|
||||
comment.AppendLine($"SteamCmdRemoveQuit: {CommonConfig.Default.SteamCmdRemoveQuit}");
|
||||
comment.AppendLine($"UpdateDirectoryPermissions: {Config.Default.UpdateDirectoryPermissions}");
|
||||
comment.AppendLine($"SteamCmdRedirectOutput: {Config.Default.SteamCmdRedirectOutput}");
|
||||
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}");
|
||||
comment.AppendLine($"RCON_MessageCommand: {Config.Default.RCON_MessageCommand}");
|
||||
|
||||
var zipFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), this.Settings.ProfileID + ".zip");
|
||||
if (File.Exists(zipFile)) File.Delete(zipFile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue