mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Fixed the cleanup of the log files generated by the auto processes (Backup, Update and Shutdown/Restart)
Added new Log settings which allow you to turn if on/off and set the number of days/files to retain Language file updates
This commit is contained in:
parent
f582e1e72a
commit
dace70a37c
29 changed files with 821 additions and 431 deletions
|
|
@ -239,7 +239,7 @@
|
|||
<setting name="ScheduledTasksCheckTime" serializeAs="String">
|
||||
<value>5</value>
|
||||
</setting>
|
||||
<setting name="ASMPluginUrl" serializeAs="String">
|
||||
<setting name="ServerManagerPluginUrl" serializeAs="String">
|
||||
<value>http://arkservermanager.freeforums.net/board/22/plugins</value>
|
||||
</setting>
|
||||
<setting name="PlayerFileExtension" serializeAs="String">
|
||||
|
|
@ -564,9 +564,6 @@
|
|||
<setting name="SectionSupplyCrateOverridesIsExpanded" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SteamAPIKey" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="ServerUpdate_ForceUpdateModsIfNoSteamInfo" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
|
|
@ -600,7 +597,7 @@
|
|||
<setting name="AutoUpdate_OverrideServerStartup" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="ASMUniqueKey" serializeAs="String">
|
||||
<setting name="ServerManagerUniqueKey" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="SectionSupplyCrateOverridesEnabled" serializeAs="String">
|
||||
|
|
@ -715,7 +712,7 @@
|
|||
<value>500</value>
|
||||
</setting>
|
||||
<setting name="UpdateDirectoryPermissions" serializeAs="String">
|
||||
<value>True</value>
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="ServerShutdown_CheckForOnlinePlayers" serializeAs="String">
|
||||
<value>True</value>
|
||||
|
|
@ -866,6 +863,15 @@
|
|||
<setting name="DiscordBotAllowAllBots" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="LoggingEnabled" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="LoggingMaxArchiveFiles" serializeAs="String">
|
||||
<value>30</value>
|
||||
</setting>
|
||||
<setting name="LoggingMaxArchiveDays" serializeAs="String">
|
||||
<value>30</value>
|
||||
</setting>
|
||||
</ServerManagerTool.Config>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ namespace ServerManagerTool
|
|||
|
||||
public App()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Config.Default.ASMUniqueKey))
|
||||
if (string.IsNullOrWhiteSpace(Config.Default.ServerManagerUniqueKey))
|
||||
{
|
||||
Config.Default.ASMUniqueKey = Guid.NewGuid().ToString();
|
||||
Config.Default.ServerManagerUniqueKey = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Config.Default.DataDir))
|
||||
|
|
@ -233,27 +233,30 @@ namespace ServerManagerTool
|
|||
|
||||
public static string GetProfileLogFolder(string profileId) => IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.LogsDir, profileId.ToLower()));
|
||||
|
||||
public static Logger GetProfileLogger(string profileId, string name, LogLevel minLevel, LogLevel maxLevel)
|
||||
public static Logger GetProfileLogger(string profileId, string logName, LogLevel minLevel, LogLevel maxLevel)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(profileId) || string.IsNullOrWhiteSpace(name))
|
||||
if (string.IsNullOrWhiteSpace(profileId) || string.IsNullOrWhiteSpace(logName))
|
||||
return null;
|
||||
|
||||
var loggerName = $"{profileId.ToLower()}_{name}".Replace(" ", "_");
|
||||
var loggerName = $"{profileId.ToLower()}_{logName}".Replace(" ", "_");
|
||||
|
||||
if (LogManager.Configuration.FindTargetByName(loggerName) == null)
|
||||
{
|
||||
{
|
||||
var logFilePath = GetProfileLogFolder(profileId);
|
||||
if (!System.IO.Directory.Exists(logFilePath))
|
||||
System.IO.Directory.CreateDirectory(logFilePath);
|
||||
|
||||
var logFile = new FileTarget(loggerName)
|
||||
{
|
||||
FileName = Path.Combine(logFilePath, $"{name}.log"),
|
||||
Layout = "${time} ${message}",
|
||||
ArchiveFileName = Path.Combine(logFilePath, $"{name}.{{#}}.log"),
|
||||
FileName = Path.Combine(logFilePath, $"{logName}.log"),
|
||||
Layout = "${time} [${level:uppercase=true}] ${message}",
|
||||
ArchiveFileName = Path.Combine(logFilePath, $"{logName}.{{#}}.log"),
|
||||
ArchiveNumbering = ArchiveNumberingMode.DateAndSequence,
|
||||
ArchiveEvery = FileArchivePeriod.Day,
|
||||
ArchiveDateFormat = "yyyyMMdd"
|
||||
ArchiveDateFormat = "yyyyMMdd",
|
||||
ArchiveOldFileOnStartup = true,
|
||||
MaxArchiveFiles = Config.Default.LoggingMaxArchiveFiles,
|
||||
MaxArchiveDays = Config.Default.LoggingMaxArchiveDays,
|
||||
};
|
||||
LogManager.Configuration.AddTarget(loggerName, logFile);
|
||||
|
||||
|
|
@ -291,12 +294,6 @@ namespace ServerManagerTool
|
|||
SettingsUtils.MigrateSettings(Config.Default, settingsFile);
|
||||
Config.Default.UpgradeConfig = false;
|
||||
Config.Default.Save();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(CommonConfig.Default.SteamAPIKey))
|
||||
{
|
||||
CommonConfig.Default.SteamAPIKey = Config.Default.SteamAPIKey;
|
||||
CommonConfig.Default.Save();
|
||||
}
|
||||
}
|
||||
if (!Config.Default.DiscordBotPrefixFixed)
|
||||
{
|
||||
|
|
@ -370,14 +367,14 @@ namespace ServerManagerTool
|
|||
PluginHelper.Instance.SetFetchProfileCallback(DiscordPluginHelper.FetchProfiles);
|
||||
OnResourceDictionaryChanged(Thread.CurrentThread.CurrentCulture.Name);
|
||||
|
||||
// check if we are starting ASM for the old server restart - no longer supported
|
||||
// check if we are starting server manager for the old server restart - no longer supported
|
||||
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTORESTART, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// just exit
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
// check if we are starting ASM for server shutdown
|
||||
// check if we are starting server manager for server shutdown
|
||||
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN1, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var arg = e.Args.FirstOrDefault(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN1, StringComparison.OrdinalIgnoreCase));
|
||||
|
|
@ -387,7 +384,7 @@ namespace ServerManagerTool
|
|||
Environment.Exit(exitCode);
|
||||
}
|
||||
|
||||
// check if we are starting ASM for server shutdown
|
||||
// check if we are starting server manager for server shutdown
|
||||
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN2, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var arg = e.Args.FirstOrDefault(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN2, StringComparison.OrdinalIgnoreCase));
|
||||
|
|
@ -397,7 +394,7 @@ namespace ServerManagerTool
|
|||
Environment.Exit(exitCode);
|
||||
}
|
||||
|
||||
// check if we are starting ASM for server updating
|
||||
// check if we are starting server manager for server updating
|
||||
if (e.Args.Any(a => a.Equals(Constants.ARG_AUTOUPDATE, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var exitCode = ServerApp.PerformAutoUpdate();
|
||||
|
|
@ -406,7 +403,7 @@ namespace ServerManagerTool
|
|||
Environment.Exit(exitCode);
|
||||
}
|
||||
|
||||
// check if we are starting ASM for server backups
|
||||
// check if we are starting server manager for server backups
|
||||
if (e.Args.Any(a => a.Equals(Constants.ARG_AUTOBACKUP, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var exitCode = ServerApp.PerformAutoBackup();
|
||||
|
|
@ -469,7 +466,7 @@ namespace ServerManagerTool
|
|||
|
||||
var restartRequired = false;
|
||||
if (string.IsNullOrWhiteSpace(Config.Default.DataDir))
|
||||
{
|
||||
{
|
||||
var dataDirectoryWindow = new DataDirectoryWindow();
|
||||
dataDirectoryWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
var result = dataDirectoryWindow.ShowDialog();
|
||||
|
|
@ -479,7 +476,7 @@ namespace ServerManagerTool
|
|||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
restartRequired = true;
|
||||
restartRequired = true;
|
||||
}
|
||||
|
||||
Config.Default.ConfigDirectory = Path.Combine(Config.Default.DataDir, Config.Default.ProfilesDir);
|
||||
|
|
@ -533,8 +530,10 @@ namespace ServerManagerTool
|
|||
}
|
||||
|
||||
public static void ReconfigureLogging()
|
||||
{
|
||||
string logDir = Path.Combine(Config.Default.DataDir, Config.Default.LogsDir);
|
||||
{
|
||||
UpdateLoggingStatus();
|
||||
|
||||
var logDir = Path.Combine(Config.Default.DataDir, Config.Default.LogsDir);
|
||||
if (!System.IO.Directory.Exists(logDir))
|
||||
System.IO.Directory.CreateDirectory(logDir);
|
||||
|
||||
|
|
@ -546,10 +545,31 @@ namespace ServerManagerTool
|
|||
var fileName = Path.GetFileNameWithoutExtension(fileTarget.FileName.ToString());
|
||||
fileTarget.FileName = Path.Combine(logDir, $"{fileName}.log");
|
||||
fileTarget.ArchiveFileName = Path.Combine(logDir, $"{fileName}.{{#}}.log");
|
||||
fileTarget.MaxArchiveFiles = Config.Default.LoggingMaxArchiveFiles;
|
||||
fileTarget.MaxArchiveDays = Config.Default.LoggingMaxArchiveDays;
|
||||
}
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
? 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);
|
||||
}
|
||||
|
||||
private void ShutDownApplication()
|
||||
{
|
||||
|
|
@ -572,29 +592,12 @@ namespace ServerManagerTool
|
|||
}
|
||||
|
||||
PluginHelper.Instance?.Dispose();
|
||||
LogManager.Flush();
|
||||
LogManager.Shutdown();
|
||||
|
||||
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
|
||||
? 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);
|
||||
}
|
||||
|
||||
public void StartDiscordBot()
|
||||
{
|
||||
if (_tokenSourceDiscordBot != null)
|
||||
|
|
@ -610,6 +613,8 @@ namespace ServerManagerTool
|
|||
var config = new DiscordBotConfig
|
||||
{
|
||||
LogLevel = Config.Default.DiscordBotLogLevel,
|
||||
MaxArchiveFiles = Config.Default.LoggingMaxArchiveFiles,
|
||||
MaxArchiveDays = Config.Default.LoggingMaxArchiveDays,
|
||||
DiscordToken = Config.Default.DiscordBotToken,
|
||||
CommandPrefix = Config.Default.DiscordBotPrefix,
|
||||
DataDirectory = Config.Default.DataDir,
|
||||
|
|
@ -656,5 +661,21 @@ namespace ServerManagerTool
|
|||
_tokenSourceDiscordBot.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateLoggingStatus()
|
||||
{
|
||||
if (Config.Default.LoggingEnabled)
|
||||
{
|
||||
while (!LogManager.IsLoggingEnabled())
|
||||
LogManager.EnableLogging();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (LogManager.IsLoggingEnabled())
|
||||
LogManager.DisableLogging();
|
||||
}
|
||||
|
||||
Debug.WriteLine($"Logging Enabled: {LogManager.IsLoggingEnabled()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
60
src/ARKServerManager/Config.Designer.cs
generated
60
src/ARKServerManager/Config.Designer.cs
generated
|
|
@ -1451,18 +1451,6 @@ namespace ServerManagerTool {
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string SteamAPIKey {
|
||||
get {
|
||||
return ((string)(this["SteamAPIKey"]));
|
||||
}
|
||||
set {
|
||||
this["SteamAPIKey"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("https://steamcommunity.com/dev/apikey")]
|
||||
|
|
@ -1635,12 +1623,12 @@ namespace ServerManagerTool {
|
|||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string ASMUniqueKey {
|
||||
public string ServerManagerUniqueKey {
|
||||
get {
|
||||
return ((string)(this["ASMUniqueKey"]));
|
||||
return ((string)(this["ServerManagerUniqueKey"]));
|
||||
}
|
||||
set {
|
||||
this["ASMUniqueKey"] = value;
|
||||
this["ServerManagerUniqueKey"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1803,9 +1791,9 @@ namespace ServerManagerTool {
|
|||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("http://arkservermanager.freeforums.net/board/22/plugins")]
|
||||
public string ASMPluginUrl {
|
||||
public string ServerManagerPluginUrl {
|
||||
get {
|
||||
return ((string)(this["ASMPluginUrl"]));
|
||||
return ((string)(this["ServerManagerPluginUrl"]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2374,7 +2362,7 @@ namespace ServerManagerTool {
|
|||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool UpdateDirectoryPermissions {
|
||||
get {
|
||||
return ((bool)(this["UpdateDirectoryPermissions"]));
|
||||
|
|
@ -3044,5 +3032,41 @@ namespace ServerManagerTool {
|
|||
this["DiscordBotAllowAllBots"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool LoggingEnabled {
|
||||
get {
|
||||
return ((bool)(this["LoggingEnabled"]));
|
||||
}
|
||||
set {
|
||||
this["LoggingEnabled"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("30")]
|
||||
public int LoggingMaxArchiveFiles {
|
||||
get {
|
||||
return ((int)(this["LoggingMaxArchiveFiles"]));
|
||||
}
|
||||
set {
|
||||
this["LoggingMaxArchiveFiles"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("30")]
|
||||
public int LoggingMaxArchiveDays {
|
||||
get {
|
||||
return ((int)(this["LoggingMaxArchiveDays"]));
|
||||
}
|
||||
set {
|
||||
this["LoggingMaxArchiveDays"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,9 +410,6 @@
|
|||
<Setting Name="SectionSupplyCrateOverridesIsExpanded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SteamAPIKey" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SteamAPIKeyUrl" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">https://steamcommunity.com/dev/apikey</Value>
|
||||
</Setting>
|
||||
|
|
@ -458,7 +455,7 @@
|
|||
<Setting Name="AutoUpdate_OverrideServerStartup" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="ASMUniqueKey" Type="System.String" Scope="User">
|
||||
<Setting Name="ServerManagerUniqueKey" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SectionSupplyCrateOverridesEnabled" Type="System.Boolean" Scope="User">
|
||||
|
|
@ -500,7 +497,7 @@
|
|||
<Setting Name="Alert_ModUpdateDetected" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Mod updates have been detected:</Value>
|
||||
</Setting>
|
||||
<Setting Name="ASMPluginUrl" Type="System.String" Scope="Application">
|
||||
<Setting Name="ServerManagerPluginUrl" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">http://arkservermanager.freeforums.net/board/22/plugins</Value>
|
||||
</Setting>
|
||||
<Setting Name="PlayerFileExtension" Type="System.String" Scope="Application">
|
||||
|
|
@ -666,7 +663,7 @@
|
|||
<Value Profile="(Default)">500</Value>
|
||||
</Setting>
|
||||
<Setting Name="UpdateDirectoryPermissions" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="ServerShutdown_CheckForOnlinePlayers" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
|
|
@ -840,5 +837,14 @@
|
|||
<Setting Name="DiscordBotAllowAllBots" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoggingEnabled" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoggingMaxArchiveFiles" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">30</Value>
|
||||
</Setting>
|
||||
<Setting Name="LoggingMaxArchiveDays" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">30</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
|
|
@ -691,6 +691,12 @@
|
|||
<sys:String x:Key="GlobalSettings_VerifyServerAfterUpdateTooltip">If enabled, after the server has been updated from the cache, it will perform a server verification using steamcmd.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_UpdateDirectoryPermissionsLabel">Update Directory Permissions on Save</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_UpdateDirectoryPermissionsTooltip">If enabled, when a save is performed, all folders under the server directory will be have the permissions check and if necessary fixed. WARNING: Disabling could prevent your server from running properly.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_EnableLoggingLabel">Enable Logging</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_EnableLoggingTooltip">If enabled, all logging will be enabled.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_LoggingMaxArchiveDaysLabel">Delete Logs After</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_LoggingMaxArchiveDaysTooltip">How old the log files must be to be deleted in days.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_LoggingMaxArchiveFilesLabel">Max Number of Logs</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_LoggingMaxArchiveFilesTooltip">The maximum number of log files that will be kept.</sys:String>
|
||||
|
||||
<sys:String x:Key="GlobalSettings_ResetSettings_ConfirmTitle">Confirm Settings Reset Action</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_ResetSettings_ConfirmLabel">Click 'Yes' to confirm you want to perform the settings reset.</sys:String>
|
||||
|
|
@ -848,6 +854,7 @@
|
|||
<sys:String x:Key="SliderUnits_Hours">hours</sys:String>
|
||||
<sys:String x:Key="SliderUnits_Days">days</sys:String>
|
||||
<sys:String x:Key="SliderUnits_Dinos">dinos</sys:String>
|
||||
<sys:String x:Key="SliderUnits_Files">files</sys:String>
|
||||
<sys:String x:Key="SliderUnits_Items">items</sys:String>
|
||||
<sys:String x:Key="SliderUnits_XP">xp</sys:String>
|
||||
<sys:String x:Key="SliderUnits_Players">players</sys:String>
|
||||
|
|
@ -1896,7 +1903,7 @@
|
|||
<sys:String x:Key="ServerSettings_EngramsRemovePrereqsColumnTooltip">If enabled, will remove the prerequisites needed to unlock the engram.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsAutoUnlockColumnLabel">Auto Unlock</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsAutoUnlockColumnTooltip">If enabled, the engram will be automatically unlocked at the specified level.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsLevelToAutoUnlockColumnLabel">Unlock Level</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsLevelToAutoUnlockColumnLabel">Auto Unlock Level</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsLevelToAutoUnlockColumnTooltip">Player level when the engram is automatically unlocked. Auto Unlock must be enabled.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_EngramsRemoveRecordTooltip">Remove this Engram</sys:String>
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,15 @@
|
|||
<sys:String x:Key="WindowState_Normal">正常</sys:String>
|
||||
<sys:String x:Key="WindowState_Minimized">最小化</sys:String>
|
||||
<sys:String x:Key="WindowState_Maximized">最大化</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Discord Bot Log Levels -->
|
||||
<sys:String x:Key="DiscordBotLogLevel_Critical">关键的</sys:String>
|
||||
<sys:String x:Key="DiscordBotLogLevel_Error">错误</sys:String>
|
||||
<sys:String x:Key="DiscordBotLogLevel_Warning">警告</sys:String>
|
||||
<sys:String x:Key="DiscordBotLogLevel_Info">信息</sys:String>
|
||||
<sys:String x:Key="DiscordBotLogLevel_Verbose">详细调试信息</sys:String>
|
||||
<sys:String x:Key="DiscordBotLogLevel_Debug">排错</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!-- 应用 -->
|
||||
|
|
@ -616,6 +625,32 @@
|
|||
<sys:String x:Key="GlobalSettings_ShutdownAllMessagesShowReasonLabel">显示所有关机消息的关机原因</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_ShutdownAllMessagesShowReasonTooltip">如果启用,关闭原因将显示所有关闭消息; 否则只会在服务器关机开始时显示。</sys:String>
|
||||
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotLabel">启用Discord(开黑) 机器人</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotInformationLabel">如果更改Discord(开黑)机器人的任何设置,则需要重新启动服务器管理器.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotTokenLabel">令牌:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotTokenTooltip">与Discord(开黑)关联的令牌.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotServerLabel">地图配置ID:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotServerTooltip">机器人将侦听的Discord(开黑)服务器的id.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotPrefixLabel">前缀:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotPrefixTooltip">通过Discord(开黑)发送命令时必须使用的前缀.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotLogLevelLabel">日志级别:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotApplyButtonLabel">领取令牌...</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotHelpButtonLabel">帮助...</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordBotAllowAllBotsLabel">允许所有机器人</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordBotAllowAllBotsTooltip">如果启用,服务器管理器机器人将响应所有其他机器人,否则将忽略它们,除非它们在白名单中.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotWhitelistLabel">机器人白名单</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotWhitelistIdLabel">机器人ID</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotWhitelistIdTooltip">要加入白名单的机器人的id.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AddDiscordBotWhitelistTooltip">添加白名单</sys:String>
|
||||
<sys:String x:Key="ServerSettings_ClearDiscordBotWhitelistTooltip">清除白名单</sys:String>
|
||||
<sys:String x:Key="ServerSettings_RemoveDiscordBotWhitelistTooltip">删除白名单</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowBackupTooltip">如果启用,则可以从discord(开黑)发送备份命令.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowRestartTooltip">如果启用,可以从discord(开黑)发送重启命令.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowShutdownTooltip">如果启用,可以从discord(开黑)发送关机命令.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowStartTooltip">如果启用,则可以从discord(开黑)发送开始命令.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowStopTooltip">如果启用,可以从discord(开黑)发送停止命令.</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_DiscordBotAllowUpdateTooltip">如果启用,则可以从discord(开黑)发送更新命令.</sys:String>
|
||||
|
||||
<sys:String x:Key="GlobalSettings_EmailSettingsLabel">SMTP 电子邮箱设置</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_EmailHostLabel">主机:</sys:String>
|
||||
<sys:String x:Key="GlobalSettings_EmailHostTooltip">主机名称或者地址使用SMTP发送.</sys:String>
|
||||
|
|
@ -757,12 +792,18 @@
|
|||
<sys:String x:Key="MainWindow_AutoUpdateTaskEnableLabel">启用</sys:String>
|
||||
<sys:String x:Key="MainWindow_AutoUpdateTaskEnableTooltip">启用自动更新计划任务</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskRunTimeLabel">下次运行时间:</sys:String>
|
||||
<sys:String x:Key="MainWindow_DiscordBotStatusLabel">Discord(开黑)机器人:</sys:String>
|
||||
<sys:String x:Key="MainWindow_DiscordBotTaskStartLabel">开始</sys:String>
|
||||
<sys:String x:Key="MainWindow_DiscordBotTaskStartTooltip">启动Discord(开黑)机器人</sys:String>
|
||||
<sys:String x:Key="MainWindow_DiscordBotTaskStopLabel">停止</sys:String>
|
||||
<sys:String x:Key="MainWindow_DiscordBotTaskStopTooltip">停止Discord(开黑)机器人</sys:String>
|
||||
|
||||
<sys:String x:Key="MainWindow_TaskStateUnknownLabel">未知</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskStateDisabledLabel">禁用</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskStateQueuedLabel">排队</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskStateReadyLabel">准备</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskStateRunningLabel">运行</sys:String>
|
||||
<sys:String x:Key="MainWindow_TaskStateStoppedLabel">停止</sys:String>
|
||||
|
||||
<sys:String x:Key="MainWindow_ProfileLoad_FailedTitle">配置文件无法加载</sys:String>
|
||||
<sys:String x:Key="MainWindow_ProfileLoad_FailedLabel">在配置文件 {0} 加载失败. 错误是: {1}\r\n{2}</sys:String>
|
||||
|
|
@ -1182,6 +1223,26 @@
|
|||
<sys:String x:Key="ServerSettings_PeriodicUpdatesTooltip">如果启用,服务器将按照周期,定期自动更新。请参阅自动更新选项的设置.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_RestartIfShutdownLabel">如果已关闭,则重新启动服务器,</sys:String>
|
||||
<sys:String x:Key="ServerSettings_RestartIfShutdownTooltip">如果启用,即使关闭自动重启和自动更新,服务器也将重新启动。</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region 服务器设置-Discord(开黑) 机器人详细信息 -->
|
||||
<sys:String x:Key="ServerSettings_DiscordBotLabel">Discord(开黑)机器人细节</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordBotChannelLabel">频道ID:</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordBotChannelTooltip">此配置文件将侦听的Discord(开黑)服务器通道的ID.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordAliasLabel">名称:</sys:String>
|
||||
<sys:String x:Key="ServerSettings_DiscordAliasTooltip">在使用Discord(开黑)命令时,可以使用唯一的名称来标识服务器,而不是配置文件id.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordBackupLabel">允许备份</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordBackupTooltip">如果启用,配置文件将侦听来自Discord(开黑)的备份命令.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordRestartLabel">允许重新启动</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordRestartTooltip">如果启用,配置文件将侦听来自Discord(开黑)的重新启动命令.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordShutdownLabel">允许关机</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordShutdownTooltip">如果启用,配置文件将侦听来自Discord(开黑)的关机命令.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordStartLabel">允许启动</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordStartTooltip">如果启用,配置文件将侦听来自Discord(开黑)的启动命令.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordStopLabel">允许停止</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordStopTooltip">如果启用,配置文件将侦听来自Discord(开黑)的停止命令.</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordUpdateLabel">允许更新</sys:String>
|
||||
<sys:String x:Key="ServerSettings_AllowDiscordUpdateTooltip">如果启用,配置文件将侦听来自Discord(开黑)的更新命令.</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!-- 服务器设置 - 规则 -->
|
||||
|
|
@ -6900,4 +6961,34 @@
|
|||
<sys:String x:Key="EngramEntry_TurretZhongduan_Weiyi_C">炮塔终端</sys:String>
|
||||
<sys:String x:Key="EngramEntry_xidianka_Weiyi_C">恐龙洗点卡</sys:String>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Discord Bot -->
|
||||
<sys:String x:Key="DiscordBot_ErrorTitle">Discord(开黑)机器人错误</sys:String>
|
||||
<sys:String x:Key="DiscordBot_MissingTokenError">Discord(开黑)机器人需要有效的令牌,以便它可以登录到Discord(开黑)服务器。\r\n这可以在全局设置中设置.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_MissingPrefixError">Discord(开黑)机器人需要有效的前缀。\r\n这可以在全局设置中设置.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_InvalidPrefixError">Discord(开黑)机器人前缀包含无效字符。只允许使用字母和数字.</sys:String>
|
||||
|
||||
<sys:String x:Key="DiscordBot_CommandNotEnabled">命令 '{0}'尚未启用.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_CommandUnknown">未知命令 '{0}'.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_CommandRunning">当前正在处理另一个命令.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_CommandRunningProfile">另一个命令 '{0}' 当前正在针对配置文件运行 '{1}'.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_CommandDisabledProfile">命令 '{0}' 已为配置文件禁用 '{1}'.</sys:String>
|
||||
|
||||
<sys:String x:Key="DiscordBot_ProfileMissing">这个 '{0}' 命令需要配置文件ID或别名。</sys:String>
|
||||
<sys:String x:Key="DiscordBot_ProfileNotFound">简介 '{0}'找不到或与通道不关联.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_ProfileMultiples">具有多个配置文件 '{0}' 在通道中找到,命令中止.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_ProfileBadStatus">简介 '{0}'他处于一种状态'{1}' 无法运行此命令的.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_ProfileUpdating">简介 '{0}' 目前正在更新.</sys:String>
|
||||
|
||||
<sys:String x:Key="DiscordBot_InfoFailed">对服务器'{0}'的调用失败.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_BackupRequested">已发送服务器'{0}'的备份请求.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_RestartRequested">已发送服务器'{0}'的重新启动请求.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_ShutdownRequested">已发送服务器'{0}'的关闭请求.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_StartRequested">已发送服务器'{0}'的启动请求.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_StopRequested">已发送服务器'{0}'的停止请求.</sys:String>
|
||||
<sys:String x:Key="DiscordBot_UpdateRequested">已发送服务器'{0}'的更新请求.</sys:String>
|
||||
|
||||
<sys:String x:Key="DiscordBot_CountLabel">总数:</sys:String>
|
||||
<sys:String x:Key="DiscordBot_MapLabel">地图:</sys:String>
|
||||
<!--#endregion-->
|
||||
</Globalization:GlobalizationResourceDictionary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
using ServerManagerTool.Common;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Layouts;
|
||||
using NLog.Targets;
|
||||
using ServerManagerTool.Common;
|
||||
using ServerManagerTool.Common.Lib;
|
||||
using ServerManagerTool.Common.Model;
|
||||
using ServerManagerTool.Common.Utils;
|
||||
|
|
@ -74,6 +78,7 @@ namespace ServerManagerTool.Lib
|
|||
// restart code
|
||||
private const int EXITCODE_RESTART_FAILED = 5001;
|
||||
private const int EXITCODE_RESTART_BADLAUNCHER = 5002;
|
||||
private const int EXITCODE_RESTART_NOSTEAMCLIENT = 5003;
|
||||
|
||||
public const string LOGPREFIX_AUTOBACKUP = "#AutoBackupLogs";
|
||||
public const string LOGPREFIX_AUTOSHUTDOWN = "#AutoShutdownLogs";
|
||||
|
|
@ -81,13 +86,13 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
private const int DIRECTORIES_PER_LINE = 200;
|
||||
|
||||
private static readonly object LockObjectMessage = new object();
|
||||
private static readonly object LockObjectBranchMessage = new object();
|
||||
private static readonly object LockObjectProfileMessage = new object();
|
||||
private static DateTime _startTime = DateTime.Now;
|
||||
private static string _logPrefix = "";
|
||||
private static Dictionary<ServerProfileSnapshot, ServerProfile> _profiles = null;
|
||||
|
||||
private static Logger _loggerManager;
|
||||
private Logger _loggerBranch;
|
||||
private Logger _loggerProfile;
|
||||
|
||||
private ServerProfileSnapshot _profile = null;
|
||||
private QueryMaster.Rcon _rconConsole = null;
|
||||
private bool _serverRunning = false;
|
||||
|
|
@ -97,7 +102,7 @@ namespace ServerManagerTool.Lib
|
|||
public bool SendMessages = Config.Default.ServerShutdown_SendShutdownMessages;
|
||||
public bool DeleteOldServerBackupFiles = false;
|
||||
public int ExitCode = EXITCODE_NORMALEXIT;
|
||||
public bool OutputLogs = true;
|
||||
public bool OutputLogs = false;
|
||||
public bool SendAlerts = false;
|
||||
public bool SendEmails = false;
|
||||
public string ShutdownReason = null;
|
||||
|
|
@ -123,6 +128,7 @@ namespace ServerManagerTool.Lib
|
|||
}
|
||||
|
||||
var emailMessage = new StringBuilder();
|
||||
|
||||
LogProfileMessage("------------------------");
|
||||
LogProfileMessage("Started server backup...");
|
||||
LogProfileMessage("------------------------");
|
||||
|
|
@ -477,7 +483,7 @@ namespace ServerManagerTool.Lib
|
|||
var message = string.Empty;
|
||||
if (minutesLeft > 5)
|
||||
{
|
||||
// check if the we have just started the countdown
|
||||
// check if we have just started the countdown
|
||||
if (minutesLeft == ShutdownInterval)
|
||||
{
|
||||
message = Config.Default.ServerShutdown_GraceMessage1.Replace("{minutes}", minutesLeft.ToString());
|
||||
|
|
@ -872,13 +878,13 @@ namespace ServerManagerTool.Lib
|
|||
// check if the mod needs to be downloaded, or force the download.
|
||||
if (Config.Default.ServerUpdate_ForceUpdateMods)
|
||||
{
|
||||
LogProfileMessage("Forcing mod download - ASM setting is TRUE.");
|
||||
LogProfileMessage("Forcing mod download - Server Manager setting is TRUE.");
|
||||
}
|
||||
else if (modDetail == null)
|
||||
{
|
||||
if (forceUpdateMods)
|
||||
{
|
||||
LogProfileMessage("Forcing mod download - Mod details not available and ASM setting is TRUE.");
|
||||
LogProfileMessage("Forcing mod download - Mod details not available and Server Manager setting is TRUE.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1003,7 +1009,7 @@ namespace ServerManagerTool.Lib
|
|||
// check if the mod needs to be copied, or force the copy.
|
||||
if (Config.Default.ServerUpdate_ForceCopyMods)
|
||||
{
|
||||
LogProfileMessage("Forcing mod copy - ASM setting is TRUE.");
|
||||
LogProfileMessage("Forcing mod copy - Server Manager setting is TRUE.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1261,18 +1267,19 @@ namespace ServerManagerTool.Lib
|
|||
_profile.LastInstalledVersion = GetServerVersion(GetServerVersionFile()).ToString();
|
||||
_profile.ServerUpdated = true;
|
||||
|
||||
LogProfileMessage("Updated server from cache.");
|
||||
LogProfileMessage("Updated server from cache. See patch notes.");
|
||||
LogProfileMessage($"Server version: {_profile.LastInstalledVersion}.");
|
||||
|
||||
LogProfileMessage("See ARK patch notes.");
|
||||
LogProfileMessage(Config.Default.ArkSE_PatchNotesUrl);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Config.Default.Alert_ServerUpdate))
|
||||
alertMessage.AppendLine(Config.Default.Alert_ServerUpdate);
|
||||
|
||||
emailMessage.AppendLine();
|
||||
emailMessage.AppendLine("Updated server from cache. See ARK patch notes.");
|
||||
emailMessage.AppendLine("Updated server from cache. See patch notes.");
|
||||
emailMessage.AppendLine(Config.Default.ArkSE_PatchNotesUrl);
|
||||
|
||||
_profile.ServerUpdated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1621,7 +1628,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
// failed max limit reached
|
||||
if (Config.Default.SteamCmdRedirectOutput)
|
||||
LogMessage($"If the mod cache update keeps failing try disabling the '{_globalizer.GetResourceString("GlobalSettings_SteamCmdRedirectOutputLabel")}' option in the ASM settings window.");
|
||||
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;
|
||||
|
|
@ -1867,7 +1874,8 @@ namespace ServerManagerTool.Lib
|
|||
var comment = new StringBuilder();
|
||||
comment.AppendLine($"Windows Platform: {Environment.OSVersion.Platform}");
|
||||
comment.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
||||
comment.AppendLine($"ASM Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Key: {Config.Default.ServerManagerCode}");
|
||||
comment.AppendLine($"Config Directory: {Config.Default.ConfigDirectory}");
|
||||
comment.AppendLine($"Server Directory: {_profile.InstallDirectory}");
|
||||
comment.AppendLine($"Profile Name: {_profile.ProfileName}");
|
||||
|
|
@ -2017,7 +2025,8 @@ namespace ServerManagerTool.Lib
|
|||
var comment = new StringBuilder();
|
||||
comment.AppendLine($"Windows Platform: {Environment.OSVersion.Platform}");
|
||||
comment.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
||||
comment.AppendLine($"ASM Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Key: {Config.Default.ServerManagerCode}");
|
||||
comment.AppendLine($"Config Directory: {Config.Default.ConfigDirectory}");
|
||||
comment.AppendLine($"Server Directory: {_profile.InstallDirectory}");
|
||||
comment.AppendLine($"Profile Name: {_profile.ProfileName}");
|
||||
|
|
@ -2181,11 +2190,48 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static string GetBranchName(string branchName) => string.IsNullOrWhiteSpace(branchName) ? Config.Default.DefaultServerBranchName : branchName;
|
||||
|
||||
public static string GetBranchLogFile(string branchName) => IOUtils.NormalizePath(Path.Combine(App.GetLogFolder(), _logPrefix, $"{_startTime:yyyyMMdd_HHmmss}{(string.IsNullOrWhiteSpace(branchName) ? string.Empty : $"_{branchName}")}.log"));
|
||||
|
||||
private string GetLauncherFile() => IOUtils.NormalizePath(Path.Combine(GetProfileServerConfigDir(_profile), Config.Default.LauncherFile));
|
||||
|
||||
private static string GetLogFile() => IOUtils.NormalizePath(Path.Combine(App.GetLogFolder(), _logPrefix, $"{_startTime:yyyyMMdd_HHmmss}.log"));
|
||||
private static string GetLogFolder(string logType) => IOUtils.NormalizePath(Path.Combine(App.GetLogFolder(), logType));
|
||||
|
||||
private static Logger GetLogger(string logFilePath, string logType, string logName)
|
||||
{
|
||||
return GetLogger(logFilePath, logType, logName ?? string.Empty, LogLevel.Debug, LogLevel.Fatal);
|
||||
}
|
||||
|
||||
private static Logger GetLogger(string logFilePath, string logType, string logName, LogLevel minLevel, LogLevel maxLevel)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(logFilePath) || string.IsNullOrWhiteSpace(logType) || string.IsNullOrWhiteSpace(logName))
|
||||
return null;
|
||||
|
||||
var loggerName = $"{logType}_{logName}".Replace(" ", "_");
|
||||
|
||||
if (LogManager.Configuration.FindTargetByName(loggerName) is null)
|
||||
{
|
||||
if (!Directory.Exists(logFilePath))
|
||||
Directory.CreateDirectory(logFilePath);
|
||||
|
||||
var logFile = new FileTarget(loggerName)
|
||||
{
|
||||
FileName = Path.Combine(logFilePath, $"{logName}.log"),
|
||||
Layout = "${time} [${level:uppercase=true}] ${message}",
|
||||
ArchiveFileName = Path.Combine(logFilePath, $"{logName}.{{#}}.log"),
|
||||
ArchiveNumbering = ArchiveNumberingMode.DateAndSequence,
|
||||
ArchiveEvery = FileArchivePeriod.Day,
|
||||
ArchiveDateFormat = "yyyyMMdd",
|
||||
ArchiveOldFileOnStartup = true,
|
||||
MaxArchiveFiles = Config.Default.LoggingMaxArchiveFiles,
|
||||
MaxArchiveDays = Config.Default.LoggingMaxArchiveDays,
|
||||
};
|
||||
LogManager.Configuration.AddTarget(loggerName, logFile);
|
||||
|
||||
var rule = new LoggingRule(loggerName, minLevel, maxLevel, logFile);
|
||||
LogManager.Configuration.LoggingRules.Add(rule);
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
}
|
||||
|
||||
return LogManager.GetLogger(loggerName);
|
||||
}
|
||||
|
||||
private List<string> GetModList()
|
||||
{
|
||||
|
|
@ -2238,7 +2284,7 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
private static string GetProfileFile(ServerProfileSnapshot profile) => IOUtils.NormalizePath(Path.Combine(Config.Default.ConfigDirectory, $"{profile.ProfileId.ToLower()}{Config.Default.ProfileExtension}"));
|
||||
|
||||
private string GetProfileLogFile() => _profile != null ? IOUtils.NormalizePath(Path.Combine(App.GetLogFolder(), _profile.ProfileId.ToLower(), _logPrefix, $"{_startTime:yyyyMMdd_HHmmss}.log")) : GetLogFile();
|
||||
private string GetProfileLogFolder(string profileId, string logType) => IOUtils.NormalizePath(Path.Combine(App.GetProfileLogFolder(profileId), logType));
|
||||
|
||||
public static string GetProfileServerConfigDir(ServerProfile profile) => Path.Combine(profile.InstallDirectory, Config.Default.ServerConfigRelativePath);
|
||||
|
||||
|
|
@ -2424,36 +2470,18 @@ namespace ServerManagerTool.Lib
|
|||
if (string.IsNullOrWhiteSpace(error))
|
||||
return;
|
||||
|
||||
LogMessage($"***** ERROR: {error}");
|
||||
_loggerManager?.Error(error);
|
||||
|
||||
Debug.WriteLine($"[ERROR] {error}");
|
||||
}
|
||||
|
||||
private static void LogMessage(string message)
|
||||
{
|
||||
message = message ?? string.Empty;
|
||||
|
||||
var logFile = GetLogFile();
|
||||
lock (LockObjectMessage)
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(logFile)))
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(logFile));
|
||||
_loggerManager?.Info(message);
|
||||
|
||||
int retries = 0;
|
||||
while (retries < 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.AppendAllLines(logFile, new[] { $"{DateTime.Now.ToString("o", CultureInfo.CurrentCulture)}: {message}" }, Encoding.Unicode);
|
||||
break;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
retries++;
|
||||
Task.Delay(WRITELOG_ERRORRETRYDELAY).Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.WriteLine(message);
|
||||
Debug.WriteLine($"[INFO] {message}");
|
||||
}
|
||||
|
||||
private void LogBranchError(string branchName, string error, bool includeProgressCallback = true)
|
||||
|
|
@ -2461,45 +2489,24 @@ namespace ServerManagerTool.Lib
|
|||
if (string.IsNullOrWhiteSpace(error))
|
||||
return;
|
||||
|
||||
LogBranchMessage(branchName, $"***** ERROR: {error}", includeProgressCallback);
|
||||
_loggerBranch?.Error(error);
|
||||
|
||||
if (includeProgressCallback)
|
||||
ProgressCallback?.Invoke(0, $"[ERROR] {error}");
|
||||
|
||||
Debug.WriteLine($"[ERROR] (Branch {GetBranchName(branchName) ?? "unknown"}) {error}");
|
||||
}
|
||||
|
||||
private void LogBranchMessage(string branchName, string message, bool includeProgressCallback = true)
|
||||
{
|
||||
message = message ?? string.Empty;
|
||||
|
||||
if (OutputLogs)
|
||||
{
|
||||
var logFile = GetBranchLogFile(branchName);
|
||||
lock (LockObjectBranchMessage)
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(logFile)))
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(logFile));
|
||||
|
||||
int retries = 0;
|
||||
while (retries < 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.AppendAllLines(logFile, new[] { $"{DateTime.Now.ToString("o", CultureInfo.CurrentCulture)}: {message}" }, Encoding.Unicode);
|
||||
break;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
retries++;
|
||||
Task.Delay(WRITELOG_ERRORRETRYDELAY).Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_loggerBranch?.Info(message);
|
||||
|
||||
if (includeProgressCallback)
|
||||
ProgressCallback?.Invoke(0, message);
|
||||
ProgressCallback?.Invoke(0, $"[INFO] {message}");
|
||||
|
||||
if (_profile != null)
|
||||
Debug.WriteLine($"[Branch {GetBranchName(branchName) ?? "unknown"}] {message}");
|
||||
else
|
||||
Debug.WriteLine(message);
|
||||
Debug.WriteLine($"[INFO] (Branch {GetBranchName(branchName) ?? "unknown"}) {message}");
|
||||
}
|
||||
|
||||
private void LogProfileError(string error, bool includeProgressCallback = true)
|
||||
|
|
@ -2507,45 +2514,24 @@ namespace ServerManagerTool.Lib
|
|||
if (string.IsNullOrWhiteSpace(error))
|
||||
return;
|
||||
|
||||
LogProfileMessage($"***** ERROR: {error}", includeProgressCallback);
|
||||
_loggerProfile?.Error(error);
|
||||
|
||||
if (includeProgressCallback)
|
||||
ProgressCallback?.Invoke(0, $"[ERROR] {error}");
|
||||
|
||||
Debug.WriteLine($"[ERROR] (Profile {_profile?.ProfileName ?? "unknown"}) {error}");
|
||||
}
|
||||
|
||||
private void LogProfileMessage(string message, bool includeProgressCallback = true)
|
||||
{
|
||||
message = message ?? string.Empty;
|
||||
|
||||
if (OutputLogs)
|
||||
{
|
||||
var logFile = GetProfileLogFile();
|
||||
lock (LockObjectProfileMessage)
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(logFile)))
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(logFile));
|
||||
|
||||
int retries = 0;
|
||||
while (retries < 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.AppendAllLines(logFile, new[] { $"{DateTime.Now.ToString("o", CultureInfo.CurrentCulture)}: {message}" }, Encoding.Unicode);
|
||||
break;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
retries++;
|
||||
Task.Delay(WRITELOG_ERRORRETRYDELAY).Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_loggerProfile?.Info(message);
|
||||
|
||||
if (includeProgressCallback)
|
||||
ProgressCallback?.Invoke(0, message);
|
||||
ProgressCallback?.Invoke(0, $"[INFO] {message}");
|
||||
|
||||
if (_profile != null)
|
||||
Debug.WriteLine($"[Profile {_profile?.ProfileName ?? "unknown"}] {message}");
|
||||
else
|
||||
Debug.WriteLine(message);
|
||||
Debug.WriteLine($"[INFO] (Profile {_profile?.ProfileName ?? "unknown"}) {message}");
|
||||
}
|
||||
|
||||
private void ProcessAlert(AlertType alertType, string alertMessage)
|
||||
|
|
@ -2579,7 +2565,7 @@ namespace ServerManagerTool.Lib
|
|||
if (_rconConsole == null)
|
||||
{
|
||||
LogProfileMessage($"RCON> {command} - attempt {rconRetries + 1} (a).", false);
|
||||
LogProfileMessage("RCON connection not created.", false);
|
||||
LogProfileMessage("RCON connection could not be created.", false);
|
||||
rconRetries++;
|
||||
}
|
||||
else
|
||||
|
|
@ -2596,6 +2582,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
LogProfileMessage($"RCON> {command} - attempt {retries + 1} (b).", false);
|
||||
LogProfileMessage($"{ex.Message}", false);
|
||||
LogProfileMessage($"{ex.StackTrace}", false);
|
||||
}
|
||||
|
||||
retries++;
|
||||
|
|
@ -2648,9 +2635,11 @@ namespace ServerManagerTool.Lib
|
|||
StringBuilder messageBody = new StringBuilder(body);
|
||||
Attachment attachment = null;
|
||||
|
||||
if (includeLogFile)
|
||||
if (includeLogFile && _loggerProfile != null)
|
||||
{
|
||||
var logFile = GetProfileLogFile();
|
||||
var fileTarget = LogManager.Configuration.FindTargetByName(_loggerProfile.Name) as FileTarget;
|
||||
var fileLayout = fileTarget?.FileName as SimpleLayout;
|
||||
var logFile = fileLayout?.Text ?? string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(logFile) && File.Exists(logFile))
|
||||
{
|
||||
attachment = new Attachment(logFile);
|
||||
|
|
@ -2720,6 +2709,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
#if DEBUG
|
||||
LogProfileMessage($"ERROR: {nameof(SetupRconConsole)}\r\n{ex.Message}", false);
|
||||
LogProfileMessage($"ERROR: {nameof(SetupRconConsole)}\r\n{ex.StackTrace}", false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -2728,10 +2718,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
_profile = profile;
|
||||
|
||||
if (_profile == null)
|
||||
return EXITCODE_NORMALEXIT;
|
||||
|
||||
if (_profile.SotFEnabled)
|
||||
if (_profile == null || _profile.SotFEnabled)
|
||||
return EXITCODE_NORMALEXIT;
|
||||
|
||||
ExitCode = EXITCODE_NORMALEXIT;
|
||||
|
|
@ -2739,6 +2726,9 @@ namespace ServerManagerTool.Lib
|
|||
Mutex mutex = null;
|
||||
var createdNew = false;
|
||||
|
||||
if (OutputLogs)
|
||||
_loggerProfile = GetLogger(GetProfileLogFolder(profile.ProfileId, LOGPREFIX_AUTOBACKUP), $"{LOGPREFIX_AUTOBACKUP}_{profile.ProfileId}", "Backup");
|
||||
|
||||
try
|
||||
{
|
||||
// try to establish a mutex for the profile.
|
||||
|
|
@ -2804,6 +2794,9 @@ namespace ServerManagerTool.Lib
|
|||
Mutex mutex = null;
|
||||
var createdNew = false;
|
||||
|
||||
if (OutputLogs)
|
||||
_loggerProfile = GetLogger(GetProfileLogFolder(profile.ProfileId, LOGPREFIX_AUTOSHUTDOWN), $"{LOGPREFIX_AUTOSHUTDOWN}_{profile.ProfileId}", "Shutdown");
|
||||
|
||||
try
|
||||
{
|
||||
// check if within the shutdown grace period (only performed when restarting the server)
|
||||
|
|
@ -2889,10 +2882,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
_profile = profile;
|
||||
|
||||
if (_profile == null)
|
||||
return EXITCODE_NORMALEXIT;
|
||||
|
||||
if (_profile.SotFEnabled)
|
||||
if (_profile == null || _profile.SotFEnabled)
|
||||
return EXITCODE_NORMALEXIT;
|
||||
|
||||
ExitCode = EXITCODE_NORMALEXIT;
|
||||
|
|
@ -2900,6 +2890,9 @@ namespace ServerManagerTool.Lib
|
|||
Mutex mutex = null;
|
||||
var createdNew = false;
|
||||
|
||||
if (OutputLogs)
|
||||
_loggerProfile = GetLogger(GetProfileLogFolder(profile.ProfileId, LOGPREFIX_AUTOUPDATE), $"{LOGPREFIX_AUTOUPDATE}_{profile.ProfileId}", "Update");
|
||||
|
||||
try
|
||||
{
|
||||
LogBranchMessage(branch.BranchName, $"[{_profile.ProfileName}] Started server update process.");
|
||||
|
|
@ -2971,6 +2964,9 @@ namespace ServerManagerTool.Lib
|
|||
Mutex mutex = null;
|
||||
var createdNew = false;
|
||||
|
||||
if (OutputLogs)
|
||||
_loggerBranch = GetLogger(GetLogFolder(LOGPREFIX_AUTOUPDATE), $"{LOGPREFIX_AUTOUPDATE}_{branch.BranchName}", GetBranchName(branch.BranchName));
|
||||
|
||||
try
|
||||
{
|
||||
LogBranchMessage(branch.BranchName, $"Started branch update process.");
|
||||
|
|
@ -3007,8 +3003,9 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
var app = new ServerApp
|
||||
{
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
OutputLogs = OutputLogs,
|
||||
SendAlerts = SendAlerts,
|
||||
SendEmails = SendEmails,
|
||||
ServerProcess = ServerProcess,
|
||||
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
|
@ -3026,8 +3023,9 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
var app = new ServerApp
|
||||
{
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
OutputLogs = OutputLogs,
|
||||
SendAlerts = SendAlerts,
|
||||
SendEmails = SendEmails,
|
||||
ServerProcess = ServerProcess,
|
||||
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
|
@ -3082,10 +3080,10 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static int PerformAutoBackup()
|
||||
{
|
||||
_logPrefix = LOGPREFIX_AUTOBACKUP;
|
||||
|
||||
int exitCode = EXITCODE_NORMALEXIT;
|
||||
|
||||
_loggerManager = GetLogger(GetLogFolder(LOGPREFIX_AUTOBACKUP), LOGPREFIX_AUTOBACKUP, "AutoBackup");
|
||||
|
||||
try
|
||||
{
|
||||
// check if a data directory has been setup.
|
||||
|
|
@ -3101,6 +3099,7 @@ namespace ServerManagerTool.Lib
|
|||
var app = new ServerApp
|
||||
{
|
||||
DeleteOldServerBackupFiles = Config.Default.AutoBackup_DeleteOldFiles,
|
||||
OutputLogs = true,
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
ServerProcess = ServerProcessType.AutoBackup
|
||||
|
|
@ -3130,10 +3129,10 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static int PerformAutoShutdown(string argument, ServerProcessType type)
|
||||
{
|
||||
_logPrefix = LOGPREFIX_AUTOSHUTDOWN;
|
||||
|
||||
int exitCode = EXITCODE_NORMALEXIT;
|
||||
|
||||
_loggerManager = GetLogger(GetLogFolder(LOGPREFIX_AUTOSHUTDOWN), LOGPREFIX_AUTOSHUTDOWN, "AutoShutdown");
|
||||
|
||||
try
|
||||
{
|
||||
// check if a data directory has been setup.
|
||||
|
|
@ -3187,6 +3186,7 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
var app = new ServerApp
|
||||
{
|
||||
OutputLogs = true,
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
ServerProcess = type,
|
||||
|
|
@ -3210,13 +3210,13 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
public static int PerformAutoUpdate()
|
||||
{
|
||||
_logPrefix = LOGPREFIX_AUTOUPDATE;
|
||||
|
||||
int exitCode = EXITCODE_NORMALEXIT;
|
||||
|
||||
Mutex mutex = null;
|
||||
bool createdNew = false;
|
||||
|
||||
_loggerManager = GetLogger(GetLogFolder(LOGPREFIX_AUTOUPDATE), LOGPREFIX_AUTOUPDATE, "AutoUpdate");
|
||||
|
||||
try
|
||||
{
|
||||
// check if a data directory has been setup.
|
||||
|
|
@ -3258,6 +3258,9 @@ namespace ServerManagerTool.Lib
|
|||
Parallel.ForEach(branches, branch => {
|
||||
app = new ServerApp
|
||||
{
|
||||
OutputLogs = true,
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
ServerProcess = ServerProcessType.AutoUpdate,
|
||||
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
|
@ -3276,6 +3279,9 @@ namespace ServerManagerTool.Lib
|
|||
|
||||
app = new ServerApp
|
||||
{
|
||||
OutputLogs = true,
|
||||
SendAlerts = true,
|
||||
SendEmails = true,
|
||||
ServerProcess = ServerProcessType.AutoUpdate,
|
||||
SteamCMDProcessWindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
var registration = new ServerStatusUpdateRegistration
|
||||
{
|
||||
AsmId = Config.Default.ASMUniqueKey,
|
||||
AsmId = Config.Default.ServerManagerUniqueKey,
|
||||
InstallDirectory = installDirectory,
|
||||
ProfileId = profileId,
|
||||
LocalEndpoint = localEndpoint,
|
||||
|
|
|
|||
|
|
@ -15,48 +15,53 @@
|
|||
/>
|
||||
<target name="debugFile" xsi:type="File"
|
||||
fileName="${logDir}/ServerManager_Debug.log"
|
||||
layout="${time} ${message}"
|
||||
layout="${time} [${level:uppercase=true}] ${message}"
|
||||
archiveFileName="${logDir}/ServerManager_Debug.{#}.log"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
archiveDateFormat="yyyyMMdd"
|
||||
maxArchiveFiles="30"
|
||||
maxArchiveDays="30"
|
||||
/>
|
||||
<target name="errorFile" xsi:type="File"
|
||||
fileName="${logDir}/ServerManager_Error.log"
|
||||
layout="${time} ${message}"
|
||||
layout="${time} [${level:uppercase=true}] ${message}"
|
||||
archiveFileName="${logDir}/ServerManager_Error.{#}.log"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
archiveDateFormat="yyyyMMdd"
|
||||
maxArchiveFiles="30"
|
||||
maxArchiveDays="30"
|
||||
/>
|
||||
<target name="scripts" xsi:type="File"
|
||||
fileName="${logDir}/ServerManager_Scripts.log"
|
||||
layout="${time} ${message}"
|
||||
layout="${time} [${level:uppercase=true}] ${message}"
|
||||
archiveFileName="${logDir}/ServerManager_Scripts.{#}.log"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
archiveDateFormat="yyyyMMdd"
|
||||
maxArchiveFiles="30"
|
||||
maxArchiveDays="30"
|
||||
/>
|
||||
<target name="statuswatcher" xsi:type="File"
|
||||
fileName="${logDir}/ServerManager_ServerStatus.log"
|
||||
layout="${time} ${message}"
|
||||
layout="${time} [${level:uppercase=true}] ${message}"
|
||||
archiveFileName="${logDir}/ServerManager_ServerStatus.{#}.log"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
archiveDateFormat="yyyyMMdd"
|
||||
maxArchiveFiles="30"
|
||||
maxArchiveDays="30"
|
||||
/>
|
||||
<target name="taskscheduler" xsi:type="File"
|
||||
fileName="${logDir}/ServerManager_TaskScheduler.log"
|
||||
layout="${time} ${message}"
|
||||
layout="${time} [${level:uppercase=true}] ${message}"
|
||||
archiveFileName="${logDir}/ServerManager_TaskScheduler.{#}.log"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
archiveDateFormat="yyyyMMdd"
|
||||
maxArchiveFiles="30"
|
||||
maxArchiveDays="30"
|
||||
/>
|
||||
</targets>
|
||||
|
||||
|
|
|
|||
|
|
@ -763,6 +763,8 @@
|
|||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
|
|
@ -780,7 +782,11 @@
|
|||
<CheckBox Grid.Row="3" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_SteamCmdRemoveQuitLabel}" IsChecked="{Binding CommonConfig.SteamCmdRemoveQuit, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_SteamCmdRemoveQuitTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="3" Grid.Column="1" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsLabel}" IsChecked="{Binding Config.UpdateDirectoryPermissions, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsTooltip}" HorizontalAlignment="Left"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="4" Grid.Column="0" Margin="1" Label="{DynamicResource GlobalSettings_WorldSaveDelayLabel}" Value="{Binding Config.ServerShutdown_WorldSaveDelay, Converter={cc:IntRangeValueConverter 10, 300}}" Minimum="10" Maximum="300" SmallChange="10" LargeChange="50" TickFrequency="1" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" Suffix="{DynamicResource SliderUnits_Seconds}" ToolTip="{DynamicResource GlobalSettings_WorldSaveDelayTooltip}"/>
|
||||
<CheckBox Grid.Row="4" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_EnableLoggingLabel}" IsChecked="{Binding Config.LoggingEnabled, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_EnableLoggingTooltip}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
<cctl:AnnotatedSlider Grid.Row="4" Grid.Column="1" Margin="0" Label="{DynamicResource GlobalSettings_WorldSaveDelayLabel}" Value="{Binding Config.ServerShutdown_WorldSaveDelay, Converter={cc:IntRangeValueConverter 10, 300}}" Minimum="10" Maximum="300" SmallChange="10" LargeChange="50" TickFrequency="1" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" Suffix="{DynamicResource SliderUnits_Seconds}" ToolTip="{DynamicResource GlobalSettings_WorldSaveDelayTooltip}"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="5" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysLabel}" Value="{Binding Config.LoggingMaxArchiveDays}" Minimum="1" Maximum="365" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Days}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
<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>
|
||||
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ namespace ServerManagerTool
|
|||
|
||||
Config.DiscordBotWhitelist.Clear();
|
||||
Config.DiscordBotWhitelist.AddRange(DiscordBotWhitelist.Select(i => i.BotId).ToArray());
|
||||
|
||||
App.ReconfigureLogging();
|
||||
}
|
||||
|
||||
private string GetDeployedVersion()
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ namespace ServerManagerTool
|
|||
comment.AppendLine($"Game Server Version: {this.Settings.LastInstalledVersion}");
|
||||
comment.AppendLine($"Server Manager Version: {App.Instance.Version}");
|
||||
comment.AppendLine($"Server Manager Code: {Config.Default.ServerManagerCode}");
|
||||
comment.AppendLine($"Server Manager Key: {Config.Default.ASMUniqueKey}");
|
||||
comment.AppendLine($"Server Manager Key: {Config.Default.ServerManagerUniqueKey}");
|
||||
comment.AppendLine($"Server Manager Directory: {Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}");
|
||||
|
||||
comment.AppendLine($"MachinePublicIP: {Config.Default.MachinePublicIP}");
|
||||
|
|
|
|||
|
|
@ -9,13 +9,18 @@
|
|||
|
||||
<entry>
|
||||
<id>urn:uuid:3E33DCB2-ECFE-4489-B1A4-56F5D386F9DC</id>
|
||||
<title>1.1.413 (1.1.413.10)</title>
|
||||
<summary>1.1.413.10</summary>
|
||||
<title>1.1.413 (1.1.413.11)</title>
|
||||
<summary>1.1.413.11</summary>
|
||||
<link href="" />
|
||||
<updated>2021-12-18T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed the cleanup of the log files generated by the auto processes (Backup, Update and Shutdown/Restart).<br/>NOTE: It will not cleanup the existing files, you need to do that manually.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
|
|
@ -23,6 +28,7 @@
|
|||
<li>Global Settings - Discord Bot section - Added a log level droplist.</li>
|
||||
<li>Global Settings - Discord Bot section - Added a checkbox to allow all bots.</li>
|
||||
<li>Global Settings - Discord Bot section - Added a whitelist to allow bots to send commands to the server manager.</li>
|
||||
<li>Global Settings - Added new Log settings which allow you to turn if on/off and set the number of days/files to retain.</li>
|
||||
<li>Server Settings - Discord Bot section - Added an alias that can be used with the discord command instead of the profile id.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,39 @@
|
|||
<link href="http://arkservermanager.freeforums.net/" />
|
||||
<updated>2021-12-16T00:00:00Z</updated>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:A652172B-F29A-4050-8A0C-8A34F6DDF1FA</id>
|
||||
<title>1.1.413 (1.1.413.11)</title>
|
||||
<summary>1.1.413.11</summary>
|
||||
<link href="" />
|
||||
<updated>2021-12-18T00:00:00Z</updated>
|
||||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed the cleanup of the log files generated by the auto processes (Backup, Update and Shutdown/Restart).<br/>NOTE: It will not cleanup the existing files, you need to do that manually.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Global Settings - Added new Log settings which allow you to turn if on/off and set the number of days/files to retain.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">CHANGE</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>zh-CN Translation file updated.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</content>
|
||||
<author>
|
||||
<name>bletch</name>
|
||||
<email>bletch1971@hotmail.com</email>
|
||||
</author>
|
||||
</entry>
|
||||
|
||||
<entry>
|
||||
<id>urn:uuid:D1CFECED-7968-47FD-B1DE-2FECD7878BDA</id>
|
||||
<title>1.1.413 (1.1.413.10)</title>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ namespace ServerManagerTool
|
|||
|
||||
private void PluginsForum_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Process.Start(Config.Default.ASMPluginUrl);
|
||||
Process.Start(Config.Default.ServerManagerPluginUrl);
|
||||
}
|
||||
|
||||
private void RemovePlugin_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue