* Initial .NET 8

* Make it compile in release mode ignoring warnings for now

* First round of improvements

* Second round of improvements

* Third round of improvements

* Use new throws

* Fix .NET Framework, YAY, thanks madness!

Madness devs are awesome

* Misc

* Misc

* AF_NETLINK might be required for some http calls

No clue why

* Fix service files

Doesn't do what it should

* Update CardsFarmer.cs

* New improvements

* Address feedback

* Misc

* Misc

* Misc refactor

* Misc
This commit is contained in:
Łukasz Domeradzki
2023-11-14 19:12:33 +01:00
committed by GitHub
parent 1e04acb904
commit b34f18497d
90 changed files with 635 additions and 1490 deletions

View File

@@ -45,9 +45,7 @@ internal static class Commands {
throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess));
}
if (string.IsNullOrEmpty(message)) {
throw new ArgumentNullException(nameof(message));
}
ArgumentException.ThrowIfNullOrEmpty(message);
if ((args == null) || (args.Length == 0)) {
throw new ArgumentNullException(nameof(args));
@@ -95,10 +93,7 @@ internal static class Commands {
}
ArgumentNullException.ThrowIfNull(bot);
if (string.IsNullOrEmpty(activationCode)) {
throw new ArgumentNullException(nameof(activationCode));
}
ArgumentException.ThrowIfNullOrEmpty(activationCode);
if (access < EAccess.Master) {
return access > EAccess.None ? bot.Commands.FormatBotResponse(Strings.ErrorAccessDenied) : null;
@@ -211,13 +206,8 @@ internal static class Commands {
throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess));
}
if (string.IsNullOrEmpty(botNames)) {
throw new ArgumentNullException(nameof(botNames));
}
if (string.IsNullOrEmpty(activationCode)) {
throw new ArgumentNullException(nameof(activationCode));
}
ArgumentException.ThrowIfNullOrEmpty(botNames);
ArgumentException.ThrowIfNullOrEmpty(activationCode);
if ((steamID != 0) && !new SteamID(steamID).IsIndividualAccount) {
throw new ArgumentOutOfRangeException(nameof(steamID));
@@ -310,9 +300,7 @@ internal static class Commands {
throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess));
}
if (string.IsNullOrEmpty(botNames)) {
throw new ArgumentNullException(nameof(botNames));
}
ArgumentException.ThrowIfNullOrEmpty(botNames);
if ((steamID != 0) && !new SteamID(steamID).IsIndividualAccount) {
throw new ArgumentOutOfRangeException(nameof(steamID));
@@ -391,9 +379,7 @@ internal static class Commands {
throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess));
}
if (string.IsNullOrEmpty(botNames)) {
throw new ArgumentNullException(nameof(botNames));
}
ArgumentException.ThrowIfNullOrEmpty(botNames);
if ((steamID != 0) && !new SteamID(steamID).IsIndividualAccount) {
throw new ArgumentOutOfRangeException(nameof(steamID));

View File

@@ -61,10 +61,7 @@ internal sealed class MaFileData {
internal MaFileData(CTwoFactor_AddAuthenticator_Response data, string deviceID) {
ArgumentNullException.ThrowIfNull(data);
if (string.IsNullOrEmpty(deviceID)) {
throw new ArgumentNullException(nameof(deviceID));
}
ArgumentException.ThrowIfNullOrEmpty(deviceID);
AccountName = data.account_name;
DeviceID = deviceID;

View File

@@ -33,9 +33,10 @@ internal sealed class MobileAuthenticatorHandler : ClientMsgHandler {
private readonly SteamUnifiedMessages.UnifiedService<ITwoFactor> UnifiedTwoFactorService;
internal MobileAuthenticatorHandler(ArchiLogger archiLogger, SteamUnifiedMessages steamUnifiedMessages) {
ArgumentNullException.ThrowIfNull(archiLogger);
ArgumentNullException.ThrowIfNull(steamUnifiedMessages);
ArchiLogger = archiLogger ?? throw new ArgumentNullException(nameof(archiLogger));
ArchiLogger = archiLogger;
UnifiedTwoFactorService = steamUnifiedMessages.CreateService<ITwoFactor>();
}
@@ -46,9 +47,7 @@ internal sealed class MobileAuthenticatorHandler : ClientMsgHandler {
throw new ArgumentOutOfRangeException(nameof(steamID));
}
if (string.IsNullOrEmpty(deviceID)) {
throw new ArgumentNullException(nameof(deviceID));
}
ArgumentException.ThrowIfNullOrEmpty(deviceID);
if (Client == null) {
throw new InvalidOperationException(nameof(Client));
@@ -90,17 +89,9 @@ internal sealed class MobileAuthenticatorHandler : ClientMsgHandler {
throw new ArgumentOutOfRangeException(nameof(steamID));
}
if (string.IsNullOrEmpty(activationCode)) {
throw new ArgumentNullException(nameof(activationCode));
}
if (string.IsNullOrEmpty(authenticatorCode)) {
throw new ArgumentNullException(nameof(authenticatorCode));
}
if (authenticatorTime <= 0) {
throw new ArgumentOutOfRangeException(nameof(authenticatorTime));
}
ArgumentException.ThrowIfNullOrEmpty(activationCode);
ArgumentException.ThrowIfNullOrEmpty(authenticatorCode);
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(authenticatorTime);
if (Client == null) {
throw new InvalidOperationException(nameof(Client));

View File

@@ -51,9 +51,7 @@ internal sealed class MobileAuthenticatorPlugin : OfficialPlugin, IBotCommand2,
throw new InvalidEnumArgumentException(nameof(access), (int) access, typeof(EAccess));
}
if (string.IsNullOrEmpty(message)) {
throw new ArgumentNullException(nameof(message));
}
ArgumentException.ThrowIfNullOrEmpty(message);
if ((args == null) || (args.Length == 0)) {
throw new ArgumentNullException(nameof(args));