mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-09 13:14:26 +00:00
Fix for multiple licenses for the same package
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user