STD: Implement SkipAutoGrantPackages

This commit is contained in:
JustArchi
2021-05-03 13:20:34 +02:00
parent 823f077cf2
commit eb39a081d7
2 changed files with 4 additions and 1 deletions

View File

@@ -38,6 +38,9 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
[JsonProperty(Required = Required.DisallowNull)]
public ImmutableHashSet<uint> SecretPackageIDs { get; private set; } = ImmutableHashSet<uint>.Empty;
[JsonProperty(Required = Required.DisallowNull)]
public bool SkipAutoGrantPackages { get; private set; }
[JsonConstructor]
internal SteamTokenDumperConfig() { }
}

View File

@@ -272,7 +272,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
throw new InvalidOperationException(nameof(GlobalCache));
}
Dictionary<uint, ulong> packageTokens = callback.LicenseList.Where(license => !Config.SecretPackageIDs.Contains(license.PackageID)).GroupBy(license => license.PackageID).ToDictionary(group => group.Key, group => group.OrderByDescending(license => license.TimeCreated).First().AccessToken);
Dictionary<uint, ulong> packageTokens = callback.LicenseList.Where(license => !Config.SecretPackageIDs.Contains(license.PackageID) && ((license.PaymentMethod != EPaymentMethod.AutoGrant) || !Config.SkipAutoGrantPackages)).GroupBy(license => license.PackageID).ToDictionary(group => group.Key, group => group.OrderByDescending(license => license.TimeCreated).First().AccessToken);
GlobalCache.UpdatePackageTokens(packageTokens);