From c37d935a1daa170d49fccd5180915c36d3689649 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 16 Nov 2020 00:44:37 +0100 Subject: [PATCH] Final touches --- .../ExamplePlugin.cs | 2 +- .../SteamTokenDumperPlugin.cs | 11 ++++++----- ArchiSteamFarm/ArchiSteamFarm.csproj | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/ExamplePlugin.cs b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/ExamplePlugin.cs index 7a60aaca9..fa6bceb54 100644 --- a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/ExamplePlugin.cs +++ b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/ExamplePlugin.cs @@ -49,7 +49,7 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin { // This will be displayed to the user and written in the log file, typically you should point it to the version of your library, but alternatively you can do some more advanced logic if you'd like to // Please note that this property can have direct dependencies only on structures that were initialized by the constructor, as it's possible to be called before OnLoaded() takes place - public Version Version => typeof(ExamplePlugin).Assembly.GetName().Version ?? throw new ArgumentNullException(nameof(Version)); + public Version Version => typeof(ExamplePlugin).Assembly.GetName().Version ?? throw new InvalidOperationException(nameof(Version)); // This method, apart from being called before any bot initialization takes place, allows you to read custom global config properties that are not recognized by ASF // Thanks to that, you can extend default ASF config with your own stuff, then parse it here in order to customize your plugin during runtime diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs index 62a94c3d0..ff09ca0fb 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperPlugin.cs @@ -23,6 +23,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Composition; +using System.Globalization; using System.Linq; using System.Net; using System.Threading; @@ -50,7 +51,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { public override string Name => nameof(SteamTokenDumperPlugin); [JsonProperty] - public override Version Version => typeof(SteamTokenDumperPlugin).Assembly.GetName().Version ?? throw new ArgumentNullException(nameof(Version)); + public override Version Version => typeof(SteamTokenDumperPlugin).Assembly.GetName().Version ?? throw new InvalidOperationException(nameof(Version)); public Task GetPreferredChangeNumberToStartFrom() => Task.FromResult(IsEnabled ? GlobalCache?.LastChangeNumber ?? 0 : 0); @@ -177,7 +178,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { } if (GlobalCache == null) { - throw new ArgumentNullException(nameof(GlobalCache)); + throw new InvalidOperationException(nameof(GlobalCache)); } await GlobalCache.OnPICSChanges(currentChangeNumber, appChanges).ConfigureAwait(false); @@ -240,7 +241,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { } if (!BotSynchronizations.TryGetValue(bot, out (SemaphoreSlim RefreshSemaphore, Timer RefreshTimer) synchronization)) { - throw new ArgumentNullException(nameof(synchronization)); + throw new InvalidOperationException(nameof(synchronization)); } if (!await synchronization.RefreshSemaphore.WaitAsync(0).ConfigureAwait(false)) { @@ -302,7 +303,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { } if (response == null) { - bot.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningFailedWithError, nameof(response))); + bot.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(response))); return; } @@ -347,7 +348,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { } if (response.Results == null) { - bot.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningFailedWithError, nameof(response.Results))); + bot.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(response.Results))); return; } diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index 04cb9bc46..6ba6e0302 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -50,7 +50,6 @@ -