mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
Fix for multiple licenses for the same package
This commit is contained in:
parent
574e8739c1
commit
6804f5b5f7
2 changed files with 2 additions and 2 deletions
|
@ -197,7 +197,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
|
|||
throw new ArgumentNullException(nameof(GlobalCache));
|
||||
}
|
||||
|
||||
Dictionary<uint, ulong> packageTokens = callback.LicenseList.ToDictionary(license => license.PackageID, license => license.AccessToken);
|
||||
Dictionary<uint, ulong> packageTokens = callback.LicenseList.GroupBy(license => license.PackageID).ToDictionary(group => group.Key, group => group.OrderByDescending(license => license.TimeCreated).First().AccessToken);
|
||||
|
||||
await GlobalCache.UpdatePackageTokens(packageTokens).ConfigureAwait(false);
|
||||
await Refresh(bot, packageTokens.Keys).ConfigureAwait(false);
|
||||
|
|
|
@ -2376,7 +2376,7 @@ namespace ArchiSteamFarm {
|
|||
Dictionary<uint, ulong> packageAccessTokens = new Dictionary<uint, ulong>();
|
||||
Dictionary<uint, uint> packagesToRefresh = new Dictionary<uint, uint>();
|
||||
|
||||
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList) {
|
||||
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList.GroupBy(license => license.PackageID).Select(group => group.OrderByDescending(license => license.TimeCreated).First())) {
|
||||
OwnedPackageIDs[license.PackageID] = (license.PaymentMethod, license.TimeCreated);
|
||||
|
||||
if (!ASF.GlobalDatabase.PackageAccessTokensReadOnly.TryGetValue(license.PackageID, out ulong packageAccessToken) || (packageAccessToken != license.AccessToken)) {
|
||||
|
|
Loading…
Reference in a new issue