From 8118fe06903b5185760412caa089a676f019ebbc Mon Sep 17 00:00:00 2001 From: JustArchi Date: Tue, 26 Apr 2016 22:05:58 +0200 Subject: [PATCH] Misc --- ArchiSteamFarm/CardsFarmer.cs | 16 ++++++++-------- ArchiSteamFarm/JSON/GitHub.cs | 16 ++++++++-------- ArchiSteamFarm/Program.cs | 4 ++-- ConfigGenerator/ASFConfig.cs | 2 +- ConfigGenerator/BotConfig.cs | 2 +- ConfigGenerator/ConfigPage.cs | 2 +- ConfigGenerator/DialogBox.cs | 6 +++--- ConfigGenerator/MainForm.cs | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 4cb21e32c..680e46944 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -38,7 +38,7 @@ namespace ArchiSteamFarm { internal readonly HashSet CurrentGamesFarming = new HashSet(); private readonly ManualResetEventSlim FarmResetEvent = new ManualResetEventSlim(false); - private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1); + private readonly SemaphoreSlim FarmingSemaphore = new SemaphoreSlim(1); private readonly Bot Bot; private readonly Timer Timer; @@ -84,15 +84,15 @@ namespace ArchiSteamFarm { return; } - await Semaphore.WaitAsync().ConfigureAwait(false); + await FarmingSemaphore.WaitAsync().ConfigureAwait(false); if (NowFarming || ManualMode) { - Semaphore.Release(); // We have nothing to do, don't forget to release semaphore + FarmingSemaphore.Release(); // We have nothing to do, don't forget to release semaphore return; } if (!await IsAnythingToFarm().ConfigureAwait(false)) { - Semaphore.Release(); // We have nothing to do, don't forget to release semaphore + FarmingSemaphore.Release(); // We have nothing to do, don't forget to release semaphore Logging.LogGenericInfo("We don't have anything to farm on this account!", Bot.BotName); await Bot.OnFarmingFinished().ConfigureAwait(false); return; @@ -100,7 +100,7 @@ namespace ArchiSteamFarm { Logging.LogGenericInfo("We have a total of " + GamesToFarm.Count + " games to farm on this account...", Bot.BotName); NowFarming = true; - Semaphore.Release(); // From this point we allow other calls to shut us down + FarmingSemaphore.Release(); // From this point we allow other calls to shut us down do { // Now the algorithm used for farming depends on whether account is restricted or not @@ -153,10 +153,10 @@ namespace ArchiSteamFarm { return; } - await Semaphore.WaitAsync().ConfigureAwait(false); + await FarmingSemaphore.WaitAsync().ConfigureAwait(false); if (!NowFarming) { - Semaphore.Release(); + FarmingSemaphore.Release(); return; } @@ -174,7 +174,7 @@ namespace ArchiSteamFarm { FarmResetEvent.Reset(); Logging.LogGenericInfo("Farming stopped!", Bot.BotName); - Semaphore.Release(); + FarmingSemaphore.Release(); } internal async Task RestartFarming() { diff --git a/ArchiSteamFarm/JSON/GitHub.cs b/ArchiSteamFarm/JSON/GitHub.cs index e77d78c80..208318b57 100644 --- a/ArchiSteamFarm/JSON/GitHub.cs +++ b/ArchiSteamFarm/JSON/GitHub.cs @@ -27,15 +27,15 @@ using System.Collections.Generic; namespace ArchiSteamFarm { internal static class GitHub { - internal sealed class Asset { - [JsonProperty(PropertyName = "name", Required = Required.Always)] - internal string Name { get; private set; } - - [JsonProperty(PropertyName = "browser_download_url", Required = Required.Always)] - internal string DownloadURL { get; private set; } - } - internal sealed class ReleaseResponse { + internal sealed class Asset { + [JsonProperty(PropertyName = "name", Required = Required.Always)] + internal string Name { get; private set; } + + [JsonProperty(PropertyName = "browser_download_url", Required = Required.Always)] + internal string DownloadURL { get; private set; } + } + [JsonProperty(PropertyName = "tag_name", Required = Required.Always)] internal string Tag { get; private set; } diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 323b8f26b..36cb429ce 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -48,7 +48,7 @@ namespace ArchiSteamFarm { WCFHostname } - internal enum EMode : byte { + private enum EMode : byte { Unknown, Normal, // Standard most common usage Client, // WCF client only @@ -183,7 +183,7 @@ namespace ArchiSteamFarm { return; } - GitHub.Asset binaryAsset = null; + GitHub.ReleaseResponse.Asset binaryAsset = null; foreach (var asset in releaseResponse.Assets) { if (string.IsNullOrEmpty(asset.Name) || !asset.Name.Equals(ExecutableName, StringComparison.OrdinalIgnoreCase)) { continue; diff --git a/ConfigGenerator/ASFConfig.cs b/ConfigGenerator/ASFConfig.cs index d7c18d6e2..18d5509f2 100644 --- a/ConfigGenerator/ASFConfig.cs +++ b/ConfigGenerator/ASFConfig.cs @@ -28,7 +28,7 @@ using System.Collections.Generic; using System.IO; namespace ConfigGenerator { - internal class ASFConfig { + internal abstract class ASFConfig { internal static readonly HashSet ASFConfigs = new HashSet(); internal string FilePath { get; set; } diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index 3d40e9b39..bd087e253 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -39,8 +39,8 @@ namespace ConfigGenerator { [JsonProperty] public string SteamLogin { get; set; } = null; - [PasswordPropertyText(true)] [JsonProperty] + [PasswordPropertyText(true)] public string SteamPassword { get; set; } = null; [JsonProperty] diff --git a/ConfigGenerator/ConfigPage.cs b/ConfigGenerator/ConfigPage.cs index 7eaf7a843..ae3a2cb83 100644 --- a/ConfigGenerator/ConfigPage.cs +++ b/ConfigGenerator/ConfigPage.cs @@ -26,7 +26,7 @@ using System.IO; using System.Windows.Forms; namespace ConfigGenerator { - internal class ConfigPage : TabPage { + internal sealed class ConfigPage : TabPage { internal readonly ASFConfig ASFConfig; internal ConfigPage(ASFConfig config) { diff --git a/ConfigGenerator/DialogBox.cs b/ConfigGenerator/DialogBox.cs index 52e7c0d76..595b2489b 100644 --- a/ConfigGenerator/DialogBox.cs +++ b/ConfigGenerator/DialogBox.cs @@ -27,8 +27,8 @@ using System.Drawing; using System.Windows.Forms; namespace ConfigGenerator { - class DialogBox { - public static DialogResult InputBox(string title, string promptText, out string value) { + internal sealed class DialogBox { + internal static DialogResult InputBox(string title, string promptText, out string value) { if (string.IsNullOrEmpty(title) || string.IsNullOrEmpty(promptText)) { value = null; return DialogResult.Abort; @@ -75,7 +75,7 @@ namespace ConfigGenerator { return dialogResult; } - public static DialogResult YesNoBox(string title, string promptText) { + internal static DialogResult YesNoBox(string title, string promptText) { if (string.IsNullOrEmpty(title) || string.IsNullOrEmpty(promptText)) { return DialogResult.Abort; } diff --git a/ConfigGenerator/MainForm.cs b/ConfigGenerator/MainForm.cs index a7523716f..66696f997 100644 --- a/ConfigGenerator/MainForm.cs +++ b/ConfigGenerator/MainForm.cs @@ -30,7 +30,7 @@ using System.Text.RegularExpressions; using System.Windows.Forms; namespace ConfigGenerator { - public partial class MainForm : Form { + internal sealed partial class MainForm : Form { private const byte ReservedTabs = 3; private readonly TabPage NewTab = new TabPage { Text = "+" }; @@ -40,7 +40,7 @@ namespace ConfigGenerator { private ConfigPage ASFTab; private TabPage OldTab; - public MainForm() { + internal MainForm() { InitializeComponent(); }