diff --git a/ArchiSteamFarm.sln.DotSettings b/ArchiSteamFarm.sln.DotSettings index bb4d3a62c..798f42643 100644 --- a/ArchiSteamFarm.sln.DotSettings +++ b/ArchiSteamFarm.sln.DotSettings @@ -105,6 +105,7 @@ False False LINE_BREAK + True True True END_OF_LINE diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index 1f4978d5b..302899e9b 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -38,13 +38,13 @@ using SteamKit2; namespace ArchiSteamFarm { internal sealed class ArchiWebHandler : IDisposable { - private const byte MinSessionTTL = GlobalConfig.DefaultHttpTimeout/4; // Assume session is valid for at least that amount of seconds + private const byte MinSessionTTL = GlobalConfig.DefaultHttpTimeout / 4; // Assume session is valid for at least that amount of seconds private const string SteamCommunityHost = "steamcommunity.com"; private const string SteamStoreHost = "store.steampowered.com"; private static string SteamCommunityURL = "https://" + SteamCommunityHost; private static string SteamStoreURL = "https://" + SteamStoreHost; - private static int Timeout = GlobalConfig.DefaultHttpTimeout*1000; // This must be int type + private static int Timeout = GlobalConfig.DefaultHttpTimeout * 1000; // This must be int type private readonly Bot Bot; private readonly SemaphoreSlim SessionSemaphore = new SemaphoreSlim(1); @@ -643,7 +643,7 @@ namespace ArchiSteamFarm { string request = SteamCommunityURL + "/mobileconf/multiajaxop"; - List> data = new List>(7 + confirmations.Count*2) { + List> data = new List>(7 + confirmations.Count * 2) { new KeyValuePair("op", accept ? "allow" : "cancel"), new KeyValuePair("p", deviceID), new KeyValuePair("a", SteamID.ToString()), @@ -663,7 +663,7 @@ namespace ArchiSteamFarm { } internal static void Init() { - Timeout = Program.GlobalConfig.HttpTimeout*1000; + Timeout = Program.GlobalConfig.HttpTimeout * 1000; SteamCommunityURL = (Program.GlobalConfig.ForceHttp ? "http://" : "https://") + SteamCommunityHost; SteamStoreURL = (Program.GlobalConfig.ForceHttp ? "http://" : "https://") + SteamStoreHost; } diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index a9a1e50f9..07866c627 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -199,7 +199,7 @@ namespace ArchiSteamFarm { Trading = new Trading(this); - HeartBeatTimer = new Timer(async e => await HeartBeat().ConfigureAwait(false), null, TimeSpan.FromMinutes(1) + TimeSpan.FromMinutes(0.2*Bots.Count), // Delay + HeartBeatTimer = new Timer(async e => await HeartBeat().ConfigureAwait(false), null, TimeSpan.FromMinutes(1) + TimeSpan.FromMinutes(0.2 * Bots.Count), // Delay TimeSpan.FromMinutes(1) // Period ); @@ -344,7 +344,7 @@ namespace ArchiSteamFarm { CardsFarmer.SetInitialState(BotConfig.Paused); if (BotConfig.AcceptConfirmationsPeriod > 0) { - TimeSpan delay = TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod) + TimeSpan.FromMinutes(0.2*Bots.Count); + TimeSpan delay = TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod) + TimeSpan.FromMinutes(0.2 * Bots.Count); TimeSpan period = TimeSpan.FromMinutes(BotConfig.AcceptConfirmationsPeriod); if (AcceptConfirmationsTimer == null) { @@ -789,7 +789,7 @@ namespace ArchiSteamFarm { private static async Task LimitGiftsRequestsAsync() { await GiftsSemaphore.WaitAsync().ConfigureAwait(false); Task.Run(async () => { - await Task.Delay(Program.GlobalConfig.GiftsLimiterDelay*1000).ConfigureAwait(false); + await Task.Delay(Program.GlobalConfig.GiftsLimiterDelay * 1000).ConfigureAwait(false); GiftsSemaphore.Release(); }).Forget(); } @@ -797,7 +797,7 @@ namespace ArchiSteamFarm { private static async Task LimitLoginRequestsAsync() { await LoginSemaphore.WaitAsync().ConfigureAwait(false); Task.Run(async () => { - await Task.Delay(Program.GlobalConfig.LoginLimiterDelay*1000).ConfigureAwait(false); + await Task.Delay(Program.GlobalConfig.LoginLimiterDelay * 1000).ConfigureAwait(false); LoginSemaphore.Release(); }).Forget(); } @@ -974,7 +974,7 @@ namespace ArchiSteamFarm { break; case EResult.RateLimitExceeded: ArchiLogger.LogGenericInfo("Will retry after 25 minutes..."); - await Task.Delay(25*60*1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25 + await Task.Delay(25 * 60 * 1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25 break; } diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 0b86fdb70..f4ee36115 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -62,7 +62,7 @@ namespace ArchiSteamFarm { Bot = bot; if (Program.GlobalConfig.IdleFarmingPeriod > 0) { - IdleFarmingTimer = new Timer(e => CheckGamesForFarming(), null, TimeSpan.FromHours(Program.GlobalConfig.IdleFarmingPeriod) + TimeSpan.FromMinutes(0.5*Bot.Bots.Count), // Delay + IdleFarmingTimer = new Timer(e => CheckGamesForFarming(), null, TimeSpan.FromHours(Program.GlobalConfig.IdleFarmingPeriod) + TimeSpan.FromMinutes(0.5 * Bot.Bots.Count), // Delay TimeSpan.FromHours(Program.GlobalConfig.IdleFarmingPeriod) // Period ); } @@ -418,7 +418,7 @@ namespace ArchiSteamFarm { Bot.ArchiLogger.LogGenericInfo("Still farming: " + game.AppID + " (" + game.GameName + ")"); DateTime startFarmingPeriod = DateTime.Now; - if (FarmResetEvent.Wait(60*1000*Program.GlobalConfig.FarmingDelay)) { + if (FarmResetEvent.Wait(60 * 1000 * Program.GlobalConfig.FarmingDelay)) { FarmResetEvent.Reset(); success = KeepFarming; } @@ -461,7 +461,7 @@ namespace ArchiSteamFarm { Bot.ArchiLogger.LogGenericInfo("Still farming: " + string.Join(", ", games.Select(game => game.AppID))); DateTime startFarmingPeriod = DateTime.Now; - if (FarmResetEvent.Wait(60*1000*Program.GlobalConfig.FarmingDelay)) { + if (FarmResetEvent.Wait(60 * 1000 * Program.GlobalConfig.FarmingDelay)) { FarmResetEvent.Reset(); success = KeepFarming; } diff --git a/ArchiSteamFarm/MobileAuthenticator.cs b/ArchiSteamFarm/MobileAuthenticator.cs index 6d41b609e..811784e29 100644 --- a/ArchiSteamFarm/MobileAuthenticator.cs +++ b/ArchiSteamFarm/MobileAuthenticator.cs @@ -285,7 +285,7 @@ namespace ArchiSteamFarm { byte[] sharedSecret = Convert.FromBase64String(SharedSecret); - byte[] timeArray = BitConverter.GetBytes((long) time/CodeInterval); + byte[] timeArray = BitConverter.GetBytes((long) time / CodeInterval); if (BitConverter.IsLittleEndian) { Array.Reverse(timeArray); } @@ -313,7 +313,7 @@ namespace ArchiSteamFarm { StringBuilder code = new StringBuilder(); for (byte i = 0; i < CodeDigits; i++) { - code.Append(CodeCharacters[fullCode%CodeCharacters.Length]); + code.Append(CodeCharacters[fullCode % CodeCharacters.Length]); fullCode /= (uint) CodeCharacters.Length; } diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index 46a8573b8..1f6a009b1 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -82,7 +82,7 @@ namespace ArchiSteamFarm { internal static async Task LimitInventoryRequestsAsync() { await InventorySemaphore.WaitAsync().ConfigureAwait(false); Task.Run(async () => { - await Task.Delay(Program.GlobalConfig.InventoryLimiterDelay*1000).ConfigureAwait(false); + await Task.Delay(Program.GlobalConfig.InventoryLimiterDelay * 1000).ConfigureAwait(false); InventorySemaphore.Release(); }).Forget(); } diff --git a/ArchiSteamFarm/WebBrowser.cs b/ArchiSteamFarm/WebBrowser.cs index 9d949fb77..b0516a4c9 100644 --- a/ArchiSteamFarm/WebBrowser.cs +++ b/ArchiSteamFarm/WebBrowser.cs @@ -69,7 +69,7 @@ namespace ArchiSteamFarm { ServicePointManager.DefaultConnectionLimit = MaxConnections; // Set max idle time from default of 100 seconds (100 * 1000) to desired value - ServicePointManager.MaxServicePointIdleTime = MaxIdleTime*1000; + ServicePointManager.MaxServicePointIdleTime = MaxIdleTime * 1000; // Don't use Expect100Continue, we're sure about our POSTs, save some TCP packets ServicePointManager.Expect100Continue = false;