Add --no-config-watch command-line argument

This commit is contained in:
JustArchi
2021-01-02 01:33:31 +01:00
parent 454e69b144
commit 0c727603a2
2 changed files with 9 additions and 2 deletions

View File

@@ -130,7 +130,9 @@ namespace ArchiSteamFarm {
await RegisterBots().ConfigureAwait(false);
InitEvents();
if (Program.ConfigWatch) {
InitConfigWatchEvents();
}
}
internal static async Task InitGlobalConfig(GlobalConfig globalConfig) {
@@ -404,7 +406,7 @@ namespace ArchiSteamFarm {
Bot.Init(botsComparer);
}
private static void InitEvents() {
private static void InitConfigWatchEvents() {
if ((FileSystemWatcher != null) || (LastWriteEvents != null)) {
return;
}

View File

@@ -38,6 +38,7 @@ using SteamKit2;
namespace ArchiSteamFarm {
internal static class Program {
internal static bool ConfigWatch { get; private set; } = true;
internal static string? NetworkGroup { get; private set; }
internal static bool ProcessRequired { get; private set; }
internal static bool RestartAllowed { get; private set; } = true;
@@ -471,6 +472,10 @@ namespace ArchiSteamFarm {
case "--network-group" when !cryptKeyNext && !networkGroupNext && !pathNext:
networkGroupNext = true;
break;
case "--no-config-watch" when !cryptKeyNext && !networkGroupNext && !pathNext:
ConfigWatch = false;
break;
case "--no-restart" when !cryptKeyNext && !networkGroupNext && !pathNext:
RestartAllowed = false;