From c632c025cb3307a2e79c02182c049a7fe85b3d73 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 9 Mar 2016 05:02:07 +0100 Subject: [PATCH] Move Statistics to global config --- ArchiSteamFarm/Bot.cs | 2 +- ArchiSteamFarm/BotConfig.cs | 5 ----- ArchiSteamFarm/GlobalConfig.cs | 3 +++ ArchiSteamFarm/config/ASF.json | 1 + ArchiSteamFarm/config/example.json | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index d453ffcc4..4b0ffd2f2 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -1218,7 +1218,7 @@ namespace ArchiSteamFarm { JoinMasterChat(); } - if (BotConfig.Statistics) { + if (Program.GlobalConfig.Statistics) { await ArchiWebHandler.JoinClan(ArchiSCFarmGroup).ConfigureAwait(false); SteamFriends.JoinChat(ArchiSCFarmGroup); } diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index 641e98b9f..eb5bd36cb 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -93,9 +93,6 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal HashSet GamesPlayedWhileIdle { get; private set; } = new HashSet() { 0 }; - [JsonProperty(Required = Required.DisallowNull)] - internal bool Statistics { get; private set; } = true; - internal static BotConfig Load(string path) { if (!File.Exists(path)) { @@ -200,8 +197,6 @@ namespace ArchiSteamFarm { } break; case "Statistics": - botConfig.Statistics = bool.Parse(value); - break; case "Blacklist": case "SteamNickname": break; diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index 92f82b9ef..d4676c4a9 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -62,6 +62,9 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal ushort WCFPort { get; private set; } = 1242; + [JsonProperty(Required = Required.DisallowNull)] + internal bool Statistics { get; private set; } = true; + [JsonProperty(Required = Required.DisallowNull)] internal HashSet Blacklist { get; private set; } = new HashSet(GlobalBlacklist); diff --git a/ArchiSteamFarm/config/ASF.json b/ArchiSteamFarm/config/ASF.json index c58e24b45..871fcad82 100644 --- a/ArchiSteamFarm/config/ASF.json +++ b/ArchiSteamFarm/config/ASF.json @@ -7,6 +7,7 @@ "RequestLimiterDelay": 7, "WCFHostname": "localhost", "WCFPort": 1242, + "Statistics": true, "Blacklist": [ 267420, 303700, diff --git a/ArchiSteamFarm/config/example.json b/ArchiSteamFarm/config/example.json index 97b248f57..abc344a0c 100644 --- a/ArchiSteamFarm/config/example.json +++ b/ArchiSteamFarm/config/example.json @@ -21,6 +21,5 @@ "CustomGamePlayedWhileIdle": null, "GamesPlayedWhileIdle": [ 0 - ], - "Statistics": true + ] } \ No newline at end of file