From 3dec189e1428bb29667153806e6ee9c4518e63bd Mon Sep 17 00:00:00 2001 From: Archi Date: Fri, 20 Aug 2021 14:31:12 +0200 Subject: [PATCH] Misc --- .../PeriodicGCPlugin.cs | 2 +- .../SteamTokenDumperPlugin.cs | 2 +- ArchiSteamFarm/Core/ASF.cs | 2 +- ArchiSteamFarm/Core/Statistics.cs | 2 +- ArchiSteamFarm/Steam/Bot.cs | 14 +++++++------- ArchiSteamFarm/Steam/Cards/CardsFarmer.cs | 2 +- .../Steam/Integration/SteamPICSChanges.cs | 2 +- ArchiSteamFarm/Steam/Integration/SteamSaleEvent.cs | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ArchiSteamFarm.CustomPlugins.PeriodicGC/PeriodicGCPlugin.cs b/ArchiSteamFarm.CustomPlugins.PeriodicGC/PeriodicGCPlugin.cs index 59ced47d4..e1ceab284 100644 --- a/ArchiSteamFarm.CustomPlugins.PeriodicGC/PeriodicGCPlugin.cs +++ b/ArchiSteamFarm.CustomPlugins.PeriodicGC/PeriodicGCPlugin.cs @@ -50,7 +50,7 @@ namespace ArchiSteamFarm.CustomPlugins.PeriodicGC { } } - private static void PerformGC(object? state) { + private static void PerformGC(object? state = null) { ASF.ArchiLogger.LogGenericWarning("Performing GC, current memory: " + (GC.GetTotalMemory(false) / 1024) + " KB."); lock (LockObject) { diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs index 2b0e50fa6..88fdea875 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs @@ -453,7 +453,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { } } - private static async void SubmitData(object? state) { + private static async void SubmitData(object? state = null) { if (Bot.Bots == null) { throw new InvalidOperationException(nameof(Bot.Bots)); } diff --git a/ArchiSteamFarm/Core/ASF.cs b/ArchiSteamFarm/Core/ASF.cs index 30e9b5077..62482fb49 100644 --- a/ArchiSteamFarm/Core/ASF.cs +++ b/ArchiSteamFarm/Core/ASF.cs @@ -438,7 +438,7 @@ namespace ArchiSteamFarm.Core { } } - private static async void OnAutoUpdatesTimer(object? state) => await UpdateAndRestart().ConfigureAwait(false); + private static async void OnAutoUpdatesTimer(object? state = null) => await UpdateAndRestart().ConfigureAwait(false); private static async void OnChanged(object sender, FileSystemEventArgs e) { if (sender == null) { diff --git a/ArchiSteamFarm/Core/Statistics.cs b/ArchiSteamFarm/Core/Statistics.cs index c0a534bf5..f4c696665 100644 --- a/ArchiSteamFarm/Core/Statistics.cs +++ b/ArchiSteamFarm/Core/Statistics.cs @@ -318,7 +318,7 @@ namespace ArchiSteamFarm.Core { return true; } - private async void MatchActively(object? state) { + private async void MatchActively(object? state = null) { if (!Bot.IsConnectedAndLoggedOn || Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchEverything) || !Bot.BotConfig.TradingPreferences.HasFlag(BotConfig.ETradingPreferences.MatchActively) || (await IsEligibleForMatching().ConfigureAwait(false) != true)) { Bot.ArchiLogger.LogGenericTrace(Strings.ErrorAborted); diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index 653d4ce4b..c66d58f54 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -911,7 +911,7 @@ namespace ArchiSteamFarm.Steam { BotDatabase.AddGamesToRedeemInBackground(gamesToRedeemInBackground); if ((GamesRedeemerInBackgroundTimer == null) && BotDatabase.HasGamesToRedeemInBackground && IsConnectedAndLoggedOn) { - Utilities.InBackground(() => RedeemGamesInBackground(this)); + Utilities.InBackground(() => RedeemGamesInBackground()); } } @@ -1884,7 +1884,7 @@ namespace ArchiSteamFarm.Steam { } } - private async void HeartBeat(object? state) { + private async void HeartBeat(object? state = null) { if (ASF.GlobalConfig == null) { throw new InvalidOperationException(nameof(ASF.GlobalConfig)); } @@ -2052,7 +2052,7 @@ namespace ArchiSteamFarm.Steam { await PluginsCore.OnBotInitModules(this, BotConfig.AdditionalProperties).ConfigureAwait(false); } - private async void InitPermanentConnectionFailure(object? state) { + private async void InitPermanentConnectionFailure(object? state = null) { if (!KeepRunning) { return; } @@ -2808,7 +2808,7 @@ namespace ArchiSteamFarm.Steam { Utilities.InBackground(ArchiWebHandler.HasValidApiKey); if ((GamesRedeemerInBackgroundTimer == null) && BotDatabase.HasGamesToRedeemInBackground) { - Utilities.InBackground(() => RedeemGamesInBackground(this)); + Utilities.InBackground(() => RedeemGamesInBackground()); } ArchiHandler.SetCurrentMode(BotConfig.UserInterfaceMode); @@ -3019,7 +3019,7 @@ namespace ArchiSteamFarm.Steam { await CheckOccupationStatus().ConfigureAwait(false); } - private async void OnSendItemsTimer(object? state) => await Actions.SendInventory(filterFunction: item => BotConfig.LootableTypes.Contains(item.Type)).ConfigureAwait(false); + private async void OnSendItemsTimer(object? state = null) => await Actions.SendInventory(filterFunction: item => BotConfig.LootableTypes.Contains(item.Type)).ConfigureAwait(false); private async void OnServiceMethod(SteamUnifiedMessages.ServiceMethodNotification notification) { if (notification == null) { @@ -3131,7 +3131,7 @@ namespace ArchiSteamFarm.Steam { WalletCurrency = callback.Currency; } - private async void RedeemGamesInBackground(object? state) { + private async void RedeemGamesInBackground(object? state = null) { if (!await GamesRedeemerInBackgroundSemaphore.WaitAsync(0).ConfigureAwait(false)) { return; } @@ -3279,7 +3279,7 @@ namespace ArchiSteamFarm.Steam { await ArchiHandler.PlayGames(BotConfig.GamesPlayedWhileIdle, BotConfig.CustomGamePlayedWhileIdle).ConfigureAwait(false); } - private void ResetPlayingWasBlockedWithTimer(object? state) { + private void ResetPlayingWasBlockedWithTimer(object? state = null) { PlayingWasBlocked = false; StopPlayingWasBlockedTimer(); } diff --git a/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs b/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs index a764d1415..ca3527ee2 100644 --- a/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs +++ b/ArchiSteamFarm/Steam/Cards/CardsFarmer.cs @@ -385,7 +385,7 @@ namespace ArchiSteamFarm.Steam.Cards { } } - private async void CheckGamesForFarming(object? state) { + private async void CheckGamesForFarming(object? state = null) { if (NowFarming || Paused || !Bot.IsConnectedAndLoggedOn) { return; } diff --git a/ArchiSteamFarm/Steam/Integration/SteamPICSChanges.cs b/ArchiSteamFarm/Steam/Integration/SteamPICSChanges.cs index 66160062b..7e38b593f 100644 --- a/ArchiSteamFarm/Steam/Integration/SteamPICSChanges.cs +++ b/ArchiSteamFarm/Steam/Integration/SteamPICSChanges.cs @@ -57,7 +57,7 @@ namespace ArchiSteamFarm.Steam.Integration { } } - private static async void RefreshChanges(object? state) { + private static async void RefreshChanges(object? state = null) { if (!await RefreshSemaphore.WaitAsync(0).ConfigureAwait(false)) { return; } diff --git a/ArchiSteamFarm/Steam/Integration/SteamSaleEvent.cs b/ArchiSteamFarm/Steam/Integration/SteamSaleEvent.cs index 31d0c10ef..807bbbc0a 100644 --- a/ArchiSteamFarm/Steam/Integration/SteamSaleEvent.cs +++ b/ArchiSteamFarm/Steam/Integration/SteamSaleEvent.cs @@ -54,7 +54,7 @@ namespace ArchiSteamFarm.Steam.Integration { public async ValueTask DisposeAsync() => await SaleEventTimer.DisposeAsync().ConfigureAwait(false); - private async void ExploreDiscoveryQueue(object? state) { + private async void ExploreDiscoveryQueue(object? state = null) { if (!Bot.IsConnectedAndLoggedOn) { return; }