This commit is contained in:
Archi
2024-03-17 02:54:28 +01:00
parent ff55e09783
commit b86f83a634
12 changed files with 24 additions and 24 deletions

View File

@@ -158,7 +158,7 @@ internal static class Backend {
return null; return null;
} }
return (response.StatusCode, response.Content?.Result ?? ImmutableHashSet<ListedUser>.Empty); return (response.StatusCode, response.Content?.Result ?? []);
} }
internal static async Task<ObjectResponse<GenericResponse<ImmutableHashSet<SetPart>>>?> GetSetParts(WebBrowser webBrowser, ulong steamID, IReadOnlyCollection<EAssetType> matchableTypes, IReadOnlyCollection<uint> realAppIDs, CancellationToken cancellationToken = default) { internal static async Task<ObjectResponse<GenericResponse<ImmutableHashSet<SetPart>>>?> GetSetParts(WebBrowser webBrowser, ulong steamID, IReadOnlyCollection<EAssetType> matchableTypes, IReadOnlyCollection<uint> realAppIDs, CancellationToken cancellationToken = default) {

View File

@@ -33,11 +33,11 @@ namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher.Data;
internal sealed class ListedUser { internal sealed class ListedUser {
[JsonInclude] [JsonInclude]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<AssetInInventory> Assets { get; private init; } = ImmutableHashSet<AssetInInventory>.Empty; internal ImmutableHashSet<AssetInInventory> Assets { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<EAssetType> MatchableTypes { get; private init; } = ImmutableHashSet<EAssetType>.Empty; internal ImmutableHashSet<EAssetType> MatchableTypes { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonRequired] [JsonRequired]

View File

@@ -31,31 +31,31 @@ internal sealed class SubmitResponseData {
[JsonInclude] [JsonInclude]
[JsonPropertyName("new_apps")] [JsonPropertyName("new_apps")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> NewApps { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> NewApps { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("new_depots")] [JsonPropertyName("new_depots")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> NewDepots { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> NewDepots { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("new_subs")] [JsonPropertyName("new_subs")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> NewPackages { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> NewPackages { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("verified_apps")] [JsonPropertyName("verified_apps")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> VerifiedApps { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> VerifiedApps { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("verified_depots")] [JsonPropertyName("verified_depots")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> VerifiedDepots { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> VerifiedDepots { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("verified_subs")] [JsonPropertyName("verified_subs")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> VerifiedPackages { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> VerifiedPackages { get; private init; } = [];
} }
#pragma warning restore CA1812 // False positive, the class is used during json deserialization #pragma warning restore CA1812 // False positive, the class is used during json deserialization

View File

@@ -35,17 +35,17 @@ public sealed class SteamTokenDumperConfig {
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
[SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)]
public ImmutableHashSet<uint> SecretAppIDs { get; private init; } = ImmutableHashSet<uint>.Empty; public ImmutableHashSet<uint> SecretAppIDs { get; private init; } = [];
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
[SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)]
public ImmutableHashSet<uint> SecretDepotIDs { get; private init; } = ImmutableHashSet<uint>.Empty; public ImmutableHashSet<uint> SecretDepotIDs { get; private init; } = [];
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
[SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)]
public ImmutableHashSet<uint> SecretPackageIDs { get; private init; } = ImmutableHashSet<uint>.Empty; public ImmutableHashSet<uint> SecretPackageIDs { get; private init; } = [];
[JsonInclude] [JsonInclude]
public bool SkipAutoGrantPackages { get; private init; } = true; public bool SkipAutoGrantPackages { get; private init; } = true;

View File

@@ -36,7 +36,7 @@ public sealed class BotRedeemRequest {
[JsonInclude] [JsonInclude]
[JsonRequired] [JsonRequired]
[Required] [Required]
public ImmutableHashSet<string> KeysToRedeem { get; private init; } = ImmutableHashSet<string>.Empty; public ImmutableHashSet<string> KeysToRedeem { get; private init; } = [];
[JsonConstructor] [JsonConstructor]
private BotRedeemRequest() { } private BotRedeemRequest() { }

View File

@@ -51,7 +51,7 @@ public sealed class TwoFactorAuthenticationConfirmationsRequest {
/// </summary> /// </summary>
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
public ImmutableHashSet<ulong> AcceptedCreatorIDs { get; private init; } = ImmutableHashSet<ulong>.Empty; public ImmutableHashSet<ulong> AcceptedCreatorIDs { get; private init; } = [];
/// <summary> /// <summary>
/// Specifies the type of confirmations to handle. If not provided, all confirmation types are considered for an action. /// Specifies the type of confirmations to handle. If not provided, all confirmation types are considered for an action.

View File

@@ -30,7 +30,7 @@ internal sealed class ConfirmationsResponse : BooleanResponse {
[JsonInclude] [JsonInclude]
[JsonPropertyName("conf")] [JsonPropertyName("conf")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<Confirmation> Confirmations { get; private init; } = ImmutableHashSet<Confirmation>.Empty; internal ImmutableHashSet<Confirmation> Confirmations { get; private init; } = [];
[JsonConstructor] [JsonConstructor]
private ConfirmationsResponse() { } private ConfirmationsResponse() { }

View File

@@ -36,12 +36,12 @@ internal sealed class InventoryResponse : OptionalResultResponse {
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
[JsonPropertyName("assets")] [JsonPropertyName("assets")]
internal ImmutableList<Asset> Assets { get; private init; } = ImmutableList<Asset>.Empty; internal ImmutableList<Asset> Assets { get; private init; } = [];
[JsonDisallowNull] [JsonDisallowNull]
[JsonInclude] [JsonInclude]
[JsonPropertyName("descriptions")] [JsonPropertyName("descriptions")]
internal ImmutableHashSet<InventoryDescription> Descriptions { get; private init; } = ImmutableHashSet<InventoryDescription>.Empty; internal ImmutableHashSet<InventoryDescription> Descriptions { get; private init; } = [];
internal EResult? ErrorCode { get; private init; } internal EResult? ErrorCode { get; private init; }
internal string? ErrorText { get; private init; } internal string? ErrorText { get; private init; }

View File

@@ -32,7 +32,7 @@ internal sealed class NewDiscoveryQueueResponse {
[JsonInclude] [JsonInclude]
[JsonPropertyName("queue")] [JsonPropertyName("queue")]
[JsonRequired] [JsonRequired]
internal ImmutableHashSet<uint> Queue { get; private init; } = ImmutableHashSet<uint>.Empty; internal ImmutableHashSet<uint> Queue { get; private init; } = [];
[JsonConstructor] [JsonConstructor]
private NewDiscoveryQueueResponse() { } private NewDiscoveryQueueResponse() { }

View File

@@ -117,13 +117,13 @@ public sealed class BotConfig {
internal const byte SteamTradeTokenLength = 8; internal const byte SteamTradeTokenLength = 8;
[PublicAPI] [PublicAPI]
public static readonly ImmutableHashSet<EAssetType> DefaultCompleteTypesToSend = ImmutableHashSet<EAssetType>.Empty; public static readonly ImmutableHashSet<EAssetType> DefaultCompleteTypesToSend = [];
[PublicAPI] [PublicAPI]
public static readonly ImmutableList<EFarmingOrder> DefaultFarmingOrders = ImmutableList<EFarmingOrder>.Empty; public static readonly ImmutableList<EFarmingOrder> DefaultFarmingOrders = [];
[PublicAPI] [PublicAPI]
public static readonly ImmutableList<uint> DefaultGamesPlayedWhileIdle = ImmutableList<uint>.Empty; public static readonly ImmutableList<uint> DefaultGamesPlayedWhileIdle = [];
[PublicAPI] [PublicAPI]
public static readonly ImmutableHashSet<EAssetType> DefaultLootableTypes = ImmutableHashSet.Create(EAssetType.BoosterPack, EAssetType.FoilTradingCard, EAssetType.TradingCard); public static readonly ImmutableHashSet<EAssetType> DefaultLootableTypes = ImmutableHashSet.Create(EAssetType.BoosterPack, EAssetType.FoilTradingCard, EAssetType.TradingCard);

View File

@@ -140,13 +140,13 @@ public sealed class GlobalConfig {
public const string? DefaultWebProxyUsername = null; public const string? DefaultWebProxyUsername = null;
[PublicAPI] [PublicAPI]
public static readonly ImmutableHashSet<uint> DefaultBlacklist = ImmutableHashSet<uint>.Empty; public static readonly ImmutableHashSet<uint> DefaultBlacklist = [];
[PublicAPI] [PublicAPI]
public static readonly Guid? DefaultLicenseID; public static readonly Guid? DefaultLicenseID;
[PublicAPI] [PublicAPI]
public static readonly ImmutableHashSet<string> DefaultPluginsUpdateList = ImmutableHashSet<string>.Empty; public static readonly ImmutableHashSet<string> DefaultPluginsUpdateList = [];
private static readonly FrozenSet<string> ForbiddenIPCPasswordPhrases = new HashSet<string>(5, StringComparer.InvariantCultureIgnoreCase) { "ipc", "api", "gui", "asf-ui", "asf-gui" }.ToFrozenSet(StringComparer.InvariantCultureIgnoreCase); private static readonly FrozenSet<string> ForbiddenIPCPasswordPhrases = new HashSet<string>(5, StringComparer.InvariantCultureIgnoreCase) { "ipc", "api", "gui", "asf-ui", "asf-gui" }.ToFrozenSet(StringComparer.InvariantCultureIgnoreCase);

View File

@@ -106,7 +106,7 @@ public sealed class ReleaseResponse {
[JsonInclude] [JsonInclude]
[JsonPropertyName("assets")] [JsonPropertyName("assets")]
[JsonRequired] [JsonRequired]
public ImmutableHashSet<ReleaseAsset> Assets { get; private init; } = ImmutableHashSet<ReleaseAsset>.Empty; public ImmutableHashSet<ReleaseAsset> Assets { get; private init; } = [];
[JsonInclude] [JsonInclude]
[JsonPropertyName("prerelease")] [JsonPropertyName("prerelease")]