From 9534d2b9f057a9d77649eb456097b133d7858482 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 8 Sep 2018 00:46:40 +0200 Subject: [PATCH] R# cleanup --- ArchiSteamFarm.Tests/Trading.cs | 173 +++++++++++++++---- ArchiSteamFarm.sln.DotSettings | 7 +- ArchiSteamFarm/ArchiHandler.cs | 2 +- ArchiSteamFarm/ArchiWebHandler.cs | 36 ++-- ArchiSteamFarm/Bot.cs | 22 +-- ArchiSteamFarm/CardsFarmer.cs | 15 +- ArchiSteamFarm/Changelog.html | 2 +- ArchiSteamFarm/ConcurrentHashSet.cs | 2 +- ArchiSteamFarm/ConcurrentSortedHashSet.cs | 2 +- ArchiSteamFarm/ConfigGenerator.html | 2 +- ArchiSteamFarm/Debugging.cs | 2 +- ArchiSteamFarm/Events.cs | 2 +- ArchiSteamFarm/FixedSizeConcurrentQueue.cs | 2 +- ArchiSteamFarm/GlobalConfig.cs | 2 +- ArchiSteamFarm/GlobalDatabase.cs | 2 +- ArchiSteamFarm/HistoryTarget.cs | 4 +- ArchiSteamFarm/InMemoryServerListProvider.cs | 2 +- ArchiSteamFarm/Json/Steam.cs | 2 +- ArchiSteamFarm/MobileAuthenticator.cs | 4 +- ArchiSteamFarm/ServerRecordEndPoint.cs | 2 +- ArchiSteamFarm/Statistics.cs | 9 +- ArchiSteamFarm/SteamSaleEvent.cs | 4 +- ArchiSteamFarm/SteamTarget.cs | 4 +- ArchiSteamFarm/Trading.cs | 2 +- ArchiSteamFarm/WebBrowser.cs | 4 +- 25 files changed, 219 insertions(+), 91 deletions(-) diff --git a/ArchiSteamFarm.Tests/Trading.cs b/ArchiSteamFarm.Tests/Trading.cs index 2d7d08441..0d7908143 100644 --- a/ArchiSteamFarm.Tests/Trading.cs +++ b/ArchiSteamFarm.Tests/Trading.cs @@ -38,9 +38,21 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3Type2Game2X9 = GenerateSteamCommunityItem(3, 9, 730, Steam.Asset.EType.Emoticon); Steam.Asset item4Type2Game2 = GenerateSteamCommunityItem(4, 1, 730, Steam.Asset.EType.Emoticon); - HashSet inventory = new HashSet { item1Type1Game1X9, item3Type2Game2X9, item4Type2Game2 }; - HashSet itemsToGive = new HashSet { item1Type1Game1, item4Type2Game2 }; - HashSet itemsToReceive = new HashSet { item2Type1Game1, item3Type2Game2 }; + HashSet inventory = new HashSet { + item1Type1Game1X9, + item3Type2Game2X9, + item4Type2Game2 + }; + + HashSet itemsToGive = new HashSet { + item1Type1Game1, + item4Type2Game2 + }; + + HashSet itemsToReceive = new HashSet { + item2Type1Game1, + item3Type2Game2 + }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -54,9 +66,20 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3Type2Game2 = GenerateSteamCommunityItem(3, 1, 730, Steam.Asset.EType.Emoticon); Steam.Asset item4Type2Game2 = GenerateSteamCommunityItem(4, 1, 730, Steam.Asset.EType.Emoticon); - HashSet inventory = new HashSet { item1Type1Game1X9, item3Type2Game2 }; - HashSet itemsToGive = new HashSet { item1Type1Game1, item3Type2Game2 }; - HashSet itemsToReceive = new HashSet { item2Type1Game1, item4Type2Game2 }; + HashSet inventory = new HashSet { + item1Type1Game1X9, + item3Type2Game2 + }; + + HashSet itemsToGive = new HashSet { + item1Type1Game1, + item3Type2Game2 + }; + + HashSet itemsToReceive = new HashSet { + item2Type1Game1, + item4Type2Game2 + }; Assert.IsTrue(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -70,10 +93,21 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item1Game2 = GenerateSteamCommunityItem(3, 1, 730, Steam.Asset.EType.TradingCard); Steam.Asset item2Game2 = GenerateSteamCommunityItem(4, 1, 730, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1Game1X9, item1Game2, item2Game2 }; + HashSet inventory = new HashSet { + item1Game1X9, + item1Game2, + item2Game2 + }; - HashSet itemsToGive = new HashSet { item1Game1, item1Game2 }; - HashSet itemsToReceive = new HashSet { item2Game1, item2Game2 }; + HashSet itemsToGive = new HashSet { + item1Game1, + item1Game2 + }; + + HashSet itemsToReceive = new HashSet { + item2Game1, + item2Game2 + }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -87,9 +121,20 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item1Game2 = GenerateSteamCommunityItem(3, 1, 730, Steam.Asset.EType.TradingCard); Steam.Asset item2Game2 = GenerateSteamCommunityItem(4, 1, 730, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1Game1X2, item1Game2 }; - HashSet itemsToGive = new HashSet { item1Game1, item1Game2 }; - HashSet itemsToReceive = new HashSet { item2Game1, item2Game2 }; + HashSet inventory = new HashSet { + item1Game1X2, + item1Game2 + }; + + HashSet itemsToGive = new HashSet { + item1Game1, + item1Game2 + }; + + HashSet itemsToReceive = new HashSet { + item2Game1, + item2Game2 + }; Assert.IsTrue(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -104,9 +149,21 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3Type2X9 = GenerateSteamCommunityItem(3, 9, 570, Steam.Asset.EType.Emoticon); Steam.Asset item4Type2 = GenerateSteamCommunityItem(4, 1, 570, Steam.Asset.EType.Emoticon); - HashSet inventory = new HashSet { item1Type1X9, item3Type2X9, item4Type2 }; - HashSet itemsToGive = new HashSet { item1Type1, item4Type2 }; - HashSet itemsToReceive = new HashSet { item2Type1, item3Type2 }; + HashSet inventory = new HashSet { + item1Type1X9, + item3Type2X9, + item4Type2 + }; + + HashSet itemsToGive = new HashSet { + item1Type1, + item4Type2 + }; + + HashSet itemsToReceive = new HashSet { + item2Type1, + item3Type2 + }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -120,9 +177,20 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3Type2 = GenerateSteamCommunityItem(3, 1, 570, Steam.Asset.EType.Emoticon); Steam.Asset item4Type2 = GenerateSteamCommunityItem(4, 1, 570, Steam.Asset.EType.Emoticon); - HashSet inventory = new HashSet { item1Type1X9, item3Type2 }; - HashSet itemsToGive = new HashSet { item1Type1, item3Type2 }; - HashSet itemsToReceive = new HashSet { item2Type1, item4Type2 }; + HashSet inventory = new HashSet { + item1Type1X9, + item3Type2 + }; + + HashSet itemsToGive = new HashSet { + item1Type1, + item3Type2 + }; + + HashSet itemsToReceive = new HashSet { + item2Type1, + item4Type2 + }; Assert.IsTrue(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -134,8 +202,18 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3 = GenerateSteamCommunityItem(3, 1, 570, Steam.Asset.EType.TradingCard); Steam.Asset item4X3 = GenerateSteamCommunityItem(4, 3, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1, item2, item3 }; - HashSet itemsToGive = new HashSet { item1, item2, item3 }; + HashSet inventory = new HashSet { + item1, + item2, + item3 + }; + + HashSet itemsToGive = new HashSet { + item1, + item2, + item3 + }; + HashSet itemsToReceive = new HashSet { item4X3 }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); @@ -147,8 +225,16 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item2X2 = GenerateSteamCommunityItem(2, 2, 570, Steam.Asset.EType.TradingCard); Steam.Asset item3X3 = GenerateSteamCommunityItem(3, 3, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1, item2X2 }; - HashSet itemsToGive = new HashSet { item1, item2X2 }; + HashSet inventory = new HashSet { + item1, + item2X2 + }; + + HashSet itemsToGive = new HashSet { + item1, + item2X2 + }; + HashSet itemsToReceive = new HashSet { item3X3 }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); @@ -161,8 +247,16 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item2 = GenerateSteamCommunityItem(2, 1, 570, Steam.Asset.EType.TradingCard); Steam.Asset item3X2 = GenerateSteamCommunityItem(3, 2, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1X2, item2 }; - HashSet itemsToGive = new HashSet { item1, item2 }; + HashSet inventory = new HashSet { + item1X2, + item2 + }; + + HashSet itemsToGive = new HashSet { + item1, + item2 + }; + HashSet itemsToReceive = new HashSet { item3X2 }; Assert.IsTrue(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); @@ -173,7 +267,11 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item1 = GenerateSteamCommunityItem(1, 1, 570, Steam.Asset.EType.TradingCard); Steam.Asset item2 = GenerateSteamCommunityItem(2, 1, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1, item2 }; + HashSet inventory = new HashSet { + item1, + item2 + }; + HashSet itemsToGive = new HashSet { item1 }; HashSet itemsToReceive = new HashSet { item2 }; @@ -189,9 +287,18 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item3 = GenerateSteamCommunityItem(3, 1, 570, Steam.Asset.EType.TradingCard); Steam.Asset item3X2 = GenerateSteamCommunityItem(3, 2, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1X2, item2X2, item3X2 }; + HashSet inventory = new HashSet { + item1X2, + item2X2, + item3X2 + }; + HashSet itemsToGive = new HashSet { item2 }; - HashSet itemsToReceive = new HashSet { item1, item3 }; + + HashSet itemsToReceive = new HashSet { + item1, + item3 + }; Assert.IsFalse(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } @@ -229,9 +336,17 @@ namespace ArchiSteamFarm.Tests { Steam.Asset item2X2 = GenerateSteamCommunityItem(2, 2, 570, Steam.Asset.EType.TradingCard); Steam.Asset item3 = GenerateSteamCommunityItem(3, 1, 570, Steam.Asset.EType.TradingCard); - HashSet inventory = new HashSet { item1X2, item2X2 }; + HashSet inventory = new HashSet { + item1X2, + item2X2 + }; + HashSet itemsToGive = new HashSet { item2 }; - HashSet itemsToReceive = new HashSet { item1, item3 }; + + HashSet itemsToReceive = new HashSet { + item1, + item3 + }; Assert.IsTrue(AcceptsTrade(inventory, itemsToGive, itemsToReceive)); } diff --git a/ArchiSteamFarm.sln.DotSettings b/ArchiSteamFarm.sln.DotSettings index 24d3d074d..7880f129f 100644 --- a/ArchiSteamFarm.sln.DotSettings +++ b/ArchiSteamFarm.sln.DotSettings @@ -58,6 +58,7 @@ SUGGESTION SUGGESTION SUGGESTION + HINT SUGGESTION SUGGESTION SUGGESTION @@ -140,6 +141,7 @@ SUGGESTION SUGGESTION SUGGESTION + HINT SUGGESTION SUGGESTION SUGGESTION @@ -532,6 +534,7 @@ limitations under the License. True 8 True - True + True True - True \ No newline at end of file + True + True diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index a4619006d..50188e0bb 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -261,7 +261,7 @@ namespace ArchiSteamFarm { byte maxGamesCount = MaxGamesPlayedConcurrently; if (!string.IsNullOrEmpty(gameName)) { - // If we have custom name to display, we must workaround the Steam network fuckup and send request on clean non-playing session + // If we have custom name to display, we must workaround the Steam network broken behaviour and send request on clean non-playing session // This ensures that custom name will in fact display properly Client.Send(request); await Task.Delay(Bot.CallbackSleep).ConfigureAwait(false); diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index 27b9a10aa..d85c9548f 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -84,9 +84,9 @@ namespace ArchiSteamFarm { WebBrowser.Dispose(); } - internal async Task AcceptDigitalGiftCard(ulong gid) { - if (gid == 0) { - Bot.ArchiLogger.LogNullError(nameof(gid)); + internal async Task AcceptDigitalGiftCard(ulong giftCardID) { + if (giftCardID == 0) { + Bot.ArchiLogger.LogNullError(nameof(giftCardID)); return false; } @@ -95,7 +95,7 @@ namespace ArchiSteamFarm { // Extra entry for sessionID Dictionary data = new Dictionary(3) { { "accept", "1" }, - { "giftcardid", gid.ToString() } + { "giftcardid", giftCardID.ToString() } }; Steam.NumberResponse result = await UrlPostToJsonObjectWithSession(SteamStoreURL, request, data).ConfigureAwait(false); @@ -474,23 +474,23 @@ namespace ArchiSteamFarm { } HashSet results = new HashSet(); - foreach (string gidText in htmlNodes.Select(node => node.GetAttributeValue("id", null))) { - if (string.IsNullOrEmpty(gidText)) { - Bot.ArchiLogger.LogNullError(nameof(gidText)); + foreach (string giftCardIDText in htmlNodes.Select(node => node.GetAttributeValue("id", null))) { + if (string.IsNullOrEmpty(giftCardIDText)) { + Bot.ArchiLogger.LogNullError(nameof(giftCardIDText)); return null; } - if (gidText.Length <= 13) { - Bot.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(gidText))); + if (giftCardIDText.Length <= 13) { + Bot.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(giftCardIDText))); return null; } - if (!ulong.TryParse(gidText.Substring(13), out ulong gid) || (gid == 0)) { - Bot.ArchiLogger.LogGenericError(string.Format(Strings.ErrorParsingObject, nameof(gid))); + if (!ulong.TryParse(giftCardIDText.Substring(13), out ulong giftCardID) || (giftCardID == 0)) { + Bot.ArchiLogger.LogGenericError(string.Format(Strings.ErrorParsingObject, nameof(giftCardID))); return null; } - results.Add(gid); + results.Add(giftCardID); } return results; @@ -1037,17 +1037,17 @@ namespace ArchiSteamFarm { byte[] sessionKey = CryptoHelper.GenerateRandomBlock(32); // RSA encrypt it with the public key for the universe we're on - byte[] cryptedSessionKey; + byte[] encryptedSessionKey; using (RSACrypto rsa = new RSACrypto(KeyDictionary.GetPublicKey(universe))) { - cryptedSessionKey = rsa.Encrypt(sessionKey); + encryptedSessionKey = rsa.Encrypt(sessionKey); } // Copy our login key byte[] loginKey = new byte[webAPIUserNonce.Length]; Array.Copy(Encoding.ASCII.GetBytes(webAPIUserNonce), loginKey, webAPIUserNonce.Length); - // AES encrypt the loginkey with our session key - byte[] cryptedLoginKey = CryptoHelper.SymmetricEncrypt(loginKey, sessionKey); + // AES encrypt the login key with our session key + byte[] encryptedLoginKey = CryptoHelper.SymmetricEncrypt(loginKey, sessionKey); // Do the magic Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.LoggingIn, ISteamUserAuth)); @@ -1065,10 +1065,10 @@ namespace ArchiSteamFarm { WebAPI.DefaultBaseAddress.Host, // ReSharper disable once AccessToDisposedClosure async () => await iSteamUserAuth.AuthenticateUser( - encrypted_loginkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedLoginKey, 0, cryptedLoginKey.Length)), + encrypted_loginkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(encryptedLoginKey, 0, encryptedLoginKey.Length)), method: WebRequestMethods.Http.Post, secure: true, - sessionkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedSessionKey, 0, cryptedSessionKey.Length)), + sessionkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(encryptedSessionKey, 0, encryptedSessionKey.Length)), steamid: steamID ) ).ConfigureAwait(false); diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 7704e6747..fca453b2d 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -41,7 +41,7 @@ using SteamKit2.Unified.Internal; namespace ArchiSteamFarm { public sealed class Bot : IDisposable { - internal const ushort CallbackSleep = 500; // In miliseconds + internal const ushort CallbackSleep = 500; // In milliseconds internal const ushort MaxMessagePrefixLength = MaxMessageLength - ReservedMessageLength - 2; // 2 for a minimum of 2 characters (escape one and real one) internal const byte MinPlayingBlockedTTL = 60; // Delay in seconds added when account was occupied during our disconnect, to not disconnect other Steam client session too soon @@ -329,18 +329,18 @@ namespace ArchiSteamFarm { ProcessingGiftsScheduled = false; } - HashSet gids = await ArchiWebHandler.GetDigitalGiftCards().ConfigureAwait(false); - if ((gids == null) || (gids.Count == 0)) { + HashSet giftCardIDs = await ArchiWebHandler.GetDigitalGiftCards().ConfigureAwait(false); + if ((giftCardIDs == null) || (giftCardIDs.Count == 0)) { return; } - foreach (ulong gid in gids.Where(gid => !HandledGifts.Contains(gid))) { - HandledGifts.Add(gid); + foreach (ulong giftCardID in giftCardIDs.Where(gid => !HandledGifts.Contains(gid))) { + HandledGifts.Add(giftCardID); - ArchiLogger.LogGenericInfo(string.Format(Strings.BotAcceptingGift, gid)); + ArchiLogger.LogGenericInfo(string.Format(Strings.BotAcceptingGift, giftCardID)); await LimitGiftsRequestsAsync().ConfigureAwait(false); - bool result = await ArchiWebHandler.AcceptDigitalGiftCard(gid).ConfigureAwait(false); + bool result = await ArchiWebHandler.AcceptDigitalGiftCard(giftCardID).ConfigureAwait(false); if (result) { ArchiLogger.LogGenericInfo(Strings.Success); } else { @@ -1427,7 +1427,7 @@ namespace ArchiSteamFarm { if (!force) { Stop(); } else { - // Stop() will most likely block due to fuckup, don't wait for it + // Stop() will most likely block due to connection freeze, don't wait for it Utilities.InBackground(() => Stop()); } @@ -2079,7 +2079,7 @@ namespace ArchiSteamFarm { if (!string.IsNullOrEmpty(notification.message_no_bbcode)) { message = notification.message_no_bbcode; } else if (!string.IsNullOrEmpty(notification.message)) { - message = Unescape(notification.message); + message = UnEscape(notification.message); } else { return; } @@ -2117,7 +2117,7 @@ namespace ArchiSteamFarm { if (!string.IsNullOrEmpty(notification.message_no_bbcode)) { message = notification.message_no_bbcode; } else if (!string.IsNullOrEmpty(notification.message)) { - message = Unescape(notification.message); + message = UnEscape(notification.message); } else { return; } @@ -5397,7 +5397,7 @@ namespace ArchiSteamFarm { PlayingWasBlockedTimer = null; } - private static string Unescape(string message) { + private static string UnEscape(string message) { if (string.IsNullOrEmpty(message)) { ASF.ArchiLogger.LogNullError(nameof(message)); return null; diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 7b49593be..c57d253fd 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -43,7 +43,13 @@ namespace ArchiSteamFarm { private const byte HoursToIgnore = 24; // How many hours we ignore unreleased appIDs and don't bother checking them again private static readonly ConcurrentDictionary IgnoredAppIDs = new ConcurrentDictionary(); // Reserved for unreleased games - private static readonly HashSet UntrustedAppIDs = new HashSet { 440, 570, 730 }; // Games that were confirmed to show false status on general badges page + + // Games that were confirmed to show false status on general badges page + private static readonly HashSet UntrustedAppIDs = new HashSet { + 440, // Team Fortress 2 + 570, // Dota 2 + 730 // Counter-Strike: Global Offensive + }; [JsonProperty] internal readonly ConcurrentHashSet CurrentGamesFarming = new ConcurrentHashSet(); @@ -449,9 +455,8 @@ namespace ArchiSteamFarm { // If we have no cardsRemaining and no cardsEarned, it's either: // - A game we don't own physically, but we have cards from it in inventory // - F2P game that we didn't spend any money in, but we have cards from it in inventory - // - Steam fuckup - // As you can guess, we must follow the rest of the logic in case of Steam fuckup - // Please kill me ;_; + // - Steam issue + // As you can guess, we must follow the rest of the logic in case of Steam issue } // Hours @@ -546,7 +551,7 @@ namespace ArchiSteamFarm { // Done with parsing, we have two possible cases here // Either we have decent info about appID, name, hours, cardsRemaining (cardsRemaining > 0) and level - // OR we strongly believe that Steam lied to us, in this case we will need to check game invidually (cardsRemaining == 0) + // OR we strongly believe that Steam lied to us, in this case we will need to check game individually (cardsRemaining == 0) if (cardsRemaining > 0) { GamesToFarm.Add(new Game(appID, name, hours, cardsRemaining, badgeLevel)); } else { diff --git a/ArchiSteamFarm/Changelog.html b/ArchiSteamFarm/Changelog.html index 3f0d65a3c..90093191b 100644 --- a/ArchiSteamFarm/Changelog.html +++ b/ArchiSteamFarm/Changelog.html @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/ArchiSteamFarm/ConcurrentHashSet.cs b/ArchiSteamFarm/ConcurrentHashSet.cs index 984e5fab4..295db89fe 100644 --- a/ArchiSteamFarm/ConcurrentHashSet.cs +++ b/ArchiSteamFarm/ConcurrentHashSet.cs @@ -128,4 +128,4 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/ConcurrentSortedHashSet.cs b/ArchiSteamFarm/ConcurrentSortedHashSet.cs index af905923f..72c606c1b 100644 --- a/ArchiSteamFarm/ConcurrentSortedHashSet.cs +++ b/ArchiSteamFarm/ConcurrentSortedHashSet.cs @@ -241,4 +241,4 @@ namespace ArchiSteamFarm { public void Reset() => Enumerator.Reset(); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/ConfigGenerator.html b/ArchiSteamFarm/ConfigGenerator.html index f9e3a0355..b253b158c 100644 --- a/ArchiSteamFarm/ConfigGenerator.html +++ b/ArchiSteamFarm/ConfigGenerator.html @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/ArchiSteamFarm/Debugging.cs b/ArchiSteamFarm/Debugging.cs index 8af6630e0..0d6d67d6f 100644 --- a/ArchiSteamFarm/Debugging.cs +++ b/ArchiSteamFarm/Debugging.cs @@ -42,4 +42,4 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/Events.cs b/ArchiSteamFarm/Events.cs index 16d9f87fc..65885ba9b 100644 --- a/ArchiSteamFarm/Events.cs +++ b/ArchiSteamFarm/Events.cs @@ -42,4 +42,4 @@ namespace ArchiSteamFarm { await Program.Exit().ConfigureAwait(false); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/FixedSizeConcurrentQueue.cs b/ArchiSteamFarm/FixedSizeConcurrentQueue.cs index 7b9643b73..d097e45b3 100644 --- a/ArchiSteamFarm/FixedSizeConcurrentQueue.cs +++ b/ArchiSteamFarm/FixedSizeConcurrentQueue.cs @@ -65,4 +65,4 @@ namespace ArchiSteamFarm { BackingQueue.TryDequeue(out _); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index dc8f8a2c3..4e594180c 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -62,8 +62,8 @@ namespace ArchiSteamFarm { private const string DefaultWebProxyUsername = null; internal static readonly ImmutableHashSet SalesBlacklist = ImmutableHashSet.Create(267420, 303700, 335590, 368020, 425280, 480730, 566020, 639900, 762800, 876740); - private static readonly ImmutableHashSet DefaultBlacklist = ImmutableHashSet.Create(); + private static readonly ImmutableHashSet DefaultBlacklist = ImmutableHashSet.Create(); private static readonly SemaphoreSlim WriteSemaphore = new SemaphoreSlim(1, 1); [JsonProperty(Required = Required.DisallowNull)] diff --git a/ArchiSteamFarm/GlobalDatabase.cs b/ArchiSteamFarm/GlobalDatabase.cs index 73fb9db7a..a5e4fed9a 100644 --- a/ArchiSteamFarm/GlobalDatabase.cs +++ b/ArchiSteamFarm/GlobalDatabase.cs @@ -173,4 +173,4 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/HistoryTarget.cs b/ArchiSteamFarm/HistoryTarget.cs index f4717dcb4..e3f47b697 100644 --- a/ArchiSteamFarm/HistoryTarget.cs +++ b/ArchiSteamFarm/HistoryTarget.cs @@ -50,7 +50,7 @@ namespace ArchiSteamFarm { } } - // This parameterless(!) constructor is intentionally public, as NLog uses it for creating targets + // This parameter-less constructor is intentionally public, as NLog uses it for creating targets // It must stay like this as we want to have our targets defined in our NLog.config [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public HistoryTarget() { } @@ -79,4 +79,4 @@ namespace ArchiSteamFarm { internal NewHistoryEntryArgs(string message) => Message = message ?? throw new ArgumentNullException(nameof(message)); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/InMemoryServerListProvider.cs b/ArchiSteamFarm/InMemoryServerListProvider.cs index a1c8a0e19..8b79677db 100644 --- a/ArchiSteamFarm/InMemoryServerListProvider.cs +++ b/ArchiSteamFarm/InMemoryServerListProvider.cs @@ -51,4 +51,4 @@ namespace ArchiSteamFarm { internal event EventHandler ServerListUpdated; } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/Json/Steam.cs b/ArchiSteamFarm/Json/Steam.cs index 1c5765bc9..aa0c837c7 100644 --- a/ArchiSteamFarm/Json/Steam.cs +++ b/ArchiSteamFarm/Json/Steam.cs @@ -245,7 +245,7 @@ namespace ArchiSteamFarm.Json { return _Type; } - // Normally this should be reported, but under some specific fuckups we might actually receive this one + // Normally this should be reported, but under some specific circumstances we might actually receive this one _Type = EType.Generic; return _Type; } diff --git a/ArchiSteamFarm/MobileAuthenticator.cs b/ArchiSteamFarm/MobileAuthenticator.cs index fb7910f3f..5ed32e39c 100644 --- a/ArchiSteamFarm/MobileAuthenticator.cs +++ b/ArchiSteamFarm/MobileAuthenticator.cs @@ -228,7 +228,7 @@ namespace ArchiSteamFarm { return true; } - // Our multi request failed, this is almost always Steam fuckup that happens randomly + // Our multi request failed, this is almost always Steam issue that happens randomly // In this case, we'll accept all pending confirmations one-by-one, synchronously (as Steam can't handle them in parallel) // We totally ignore actual result returned by those calls, abort only if request timed out foreach (Confirmation confirmation in confirmations) { @@ -389,4 +389,4 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/ServerRecordEndPoint.cs b/ArchiSteamFarm/ServerRecordEndPoint.cs index 79bb52805..b58639c5c 100644 --- a/ArchiSteamFarm/ServerRecordEndPoint.cs +++ b/ArchiSteamFarm/ServerRecordEndPoint.cs @@ -51,4 +51,4 @@ namespace ArchiSteamFarm { private bool Equals(ServerRecordEndPoint other) => string.Equals(Host, other.Host) && (Port == other.Port) && (ProtocolTypes == other.ProtocolTypes); } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/Statistics.cs b/ArchiSteamFarm/Statistics.cs index c92fe25ba..13077f24d 100644 --- a/ArchiSteamFarm/Statistics.cs +++ b/ArchiSteamFarm/Statistics.cs @@ -35,7 +35,12 @@ namespace ArchiSteamFarm { private const byte MinPersonaStateTTL = 8; // Minimum amount of hours we must wait before requesting persona state update private const string URL = "https://" + SharedInfo.StatisticsServer; - private static readonly HashSet AcceptedMatchableTypes = new HashSet { Steam.Asset.EType.Emoticon, Steam.Asset.EType.FoilTradingCard, Steam.Asset.EType.ProfileBackground, Steam.Asset.EType.TradingCard }; + private static readonly HashSet AcceptedMatchableTypes = new HashSet { + Steam.Asset.EType.Emoticon, + Steam.Asset.EType.FoilTradingCard, + Steam.Asset.EType.ProfileBackground, + Steam.Asset.EType.TradingCard + }; private readonly Bot Bot; private readonly SemaphoreSlim RequestsSemaphore = new SemaphoreSlim(1, 1); @@ -174,4 +179,4 @@ namespace ArchiSteamFarm { return await Bot.ArchiWebHandler.HasValidApiKey().ConfigureAwait(false); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/SteamSaleEvent.cs b/ArchiSteamFarm/SteamSaleEvent.cs index 15b888c8b..e4473a59e 100644 --- a/ArchiSteamFarm/SteamSaleEvent.cs +++ b/ArchiSteamFarm/SteamSaleEvent.cs @@ -139,7 +139,7 @@ namespace ArchiSteamFarm { return; } - // Random a game we'll actually vote for, we don't want to make GabeN angry by rigging votes... + // Random a game we'll actually vote for, we don't want to make anybody angry by rigging votes... HtmlNode voteNode = voteNodes[Utilities.RandomNext(voteNodes.Count)]; string appIDText = voteNode.GetAttributeValue("data-vote-appid", null); @@ -157,4 +157,4 @@ namespace ArchiSteamFarm { } } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/SteamTarget.cs b/ArchiSteamFarm/SteamTarget.cs index 7d444d5ed..19de21bb3 100644 --- a/ArchiSteamFarm/SteamTarget.cs +++ b/ArchiSteamFarm/SteamTarget.cs @@ -48,7 +48,7 @@ namespace ArchiSteamFarm { [RequiredParameter] public ulong SteamID { get; set; } - // This parameterless(!) constructor is intentionally public, as NLog uses it for creating targets + // This parameter-less constructor is intentionally public, as NLog uses it for creating targets // It must stay like this as we want to have our targets defined in our NLog.config // Keeping date in default layout also doesn't make much sense (Steam offers that), so we remove it by default public SteamTarget() => Layout = "${level:uppercase=true}|${logger}|${message}"; @@ -120,4 +120,4 @@ namespace ArchiSteamFarm { await bot.SendMessage(SteamID, message).ConfigureAwait(false); } } -} \ No newline at end of file +} diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index f5d12edaf..197ca41d9 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -299,7 +299,7 @@ namespace ArchiSteamFarm { // Check if it's donation trade switch (tradeOffer.ItemsToGive.Count) { case 0 when tradeOffer.ItemsToReceive.Count == 0: - // If it's steam fuckup, temporarily ignore it + // If it's steam issue, temporarily ignore it return new ParseTradeResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.RejectedTemporarily); case 0: // Otherwise react accordingly, depending on our preference diff --git a/ArchiSteamFarm/WebBrowser.cs b/ArchiSteamFarm/WebBrowser.cs index a388cbbc4..ef17ba91d 100644 --- a/ArchiSteamFarm/WebBrowser.cs +++ b/ArchiSteamFarm/WebBrowser.cs @@ -49,7 +49,7 @@ namespace ArchiSteamFarm { ArchiLogger = archiLogger ?? throw new ArgumentNullException(nameof(archiLogger)); HttpClientHandler httpClientHandler = new HttpClientHandler { - AllowAutoRedirect = false, // This must be false if we want to handle custom redirection schemes such as "steammobile" + AllowAutoRedirect = false, // This must be false if we want to handle custom redirection schemes such as "steammobile://" AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip, CookieContainer = CookieContainer, Proxy = webProxy, @@ -388,7 +388,7 @@ namespace ArchiSteamFarm { return response; } - // WARNING: We still have undisposed response by now, make sure to dispose it ASAP if we're not returning it! + // WARNING: We still have not disposed response by now, make sure to dispose it ASAP if we're not returning it! if ((response.StatusCode >= HttpStatusCode.Ambiguous) && (response.StatusCode < HttpStatusCode.BadRequest) && (maxRedirections > 0)) { Uri redirectUri = response.Headers.Location;