From bdc354d07c09129e4c0df94bcceff73e1837b73c Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 5 Jan 2017 21:08:13 +0100 Subject: [PATCH] Misc readability improvement --- ArchiSteamFarm/ASF.cs | 5 ++++- ArchiSteamFarm/BotConfig.cs | 6 +++++- ArchiSteamFarm/CryptoHelper.cs | 14 ++++++++++---- ConfigGenerator/BotConfig.cs | 6 +++++- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ArchiSteamFarm/ASF.cs b/ArchiSteamFarm/ASF.cs index f6766d5bb..c4fe25697 100644 --- a/ArchiSteamFarm/ASF.cs +++ b/ArchiSteamFarm/ASF.cs @@ -66,7 +66,10 @@ namespace ArchiSteamFarm { } if ((AutoUpdatesTimer == null) && Program.GlobalConfig.AutoUpdates) { - AutoUpdatesTimer = new Timer(async e => await CheckForUpdate().ConfigureAwait(false), null, TimeSpan.FromDays(1), // Delay + AutoUpdatesTimer = new Timer( + async e => await CheckForUpdate().ConfigureAwait(false), + null, + TimeSpan.FromDays(1), // Delay TimeSpan.FromDays(1) // Period ); diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index 1f23fc7f2..2abf1e85a 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -73,7 +73,11 @@ namespace ArchiSteamFarm { internal readonly bool IsBotAccount = false; [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] - internal readonly HashSet LootableTypes = new HashSet { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard }; + internal readonly HashSet LootableTypes = new HashSet { + Steam.Item.EType.BoosterPack, + Steam.Item.EType.FoilTradingCard, + Steam.Item.EType.TradingCard + }; [JsonProperty(Required = Required.DisallowNull)] internal readonly CryptoHelper.ECryptoMethod PasswordFormat = CryptoHelper.ECryptoMethod.PlainText; diff --git a/ArchiSteamFarm/CryptoHelper.cs b/ArchiSteamFarm/CryptoHelper.cs index 9d6d6264e..e830924e3 100644 --- a/ArchiSteamFarm/CryptoHelper.cs +++ b/ArchiSteamFarm/CryptoHelper.cs @@ -103,8 +103,11 @@ namespace ArchiSteamFarm { } try { - byte[] decryptedData = ProtectedData.Unprotect(Convert.FromBase64String(encrypted), EncryptionKey, // This is used as salt only and it's fine that it's known - DataProtectionScope.CurrentUser); + byte[] decryptedData = ProtectedData.Unprotect( + Convert.FromBase64String(encrypted), + EncryptionKey, // This is used as salt only and it's fine that it's known + DataProtectionScope.CurrentUser + ); return Encoding.UTF8.GetString(decryptedData); } catch (Exception e) { @@ -141,8 +144,11 @@ namespace ArchiSteamFarm { } try { - byte[] encryptedData = ProtectedData.Protect(Encoding.UTF8.GetBytes(decrypted), EncryptionKey, // This is used as salt only and it's fine that it's known - DataProtectionScope.CurrentUser); + byte[] encryptedData = ProtectedData.Protect( + Encoding.UTF8.GetBytes(decrypted), + EncryptionKey, // This is used as salt only and it's fine that it's known + DataProtectionScope.CurrentUser + ); return Convert.ToBase64String(encryptedData); } catch (Exception e) { diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index b52691dd2..6e5029b65 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -80,7 +80,11 @@ namespace ConfigGenerator { [Category("\tAdvanced")] [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)] - public List LootableTypes { get; set; } = new List { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard }; + public List LootableTypes { get; set; } = new List { + Steam.Item.EType.BoosterPack, + Steam.Item.EType.FoilTradingCard, + Steam.Item.EType.TradingCard + }; [Category("\tAccess")] [JsonProperty(Required = Required.DisallowNull)]