mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Avoid matching the same set with the same user as well
In several cases ASF sent more than 1 trade considering the same items, this happens when we have more possible matches than just one but for the same card of other side. Since we do not preserve the state (due to various reasons), the proper thing to do is to make set exclusive not only to user, but also to a single trade offer. At worst we'll just finish remaining part of it in the next round, if by any chance our trade offer is so huge it stumbles upon 255 items limit.
This commit is contained in:
@@ -343,7 +343,7 @@ namespace ArchiSteamFarm {
|
||||
Dictionary<ulong, uint> classIDsToGive = new Dictionary<ulong, uint>();
|
||||
Dictionary<ulong, uint> classIDsToReceive = new Dictionary<ulong, uint>();
|
||||
|
||||
foreach (((uint AppID, Steam.Asset.EType Type) set, Dictionary<ulong, uint> ourFullItems) in fullState.Where(set => listedUser.MatchableTypes.Contains(set.Key.Type) && set.Value.Values.Any(count => count > 1))) {
|
||||
foreach (((uint AppID, Steam.Asset.EType Type) set, Dictionary<ulong, uint> ourFullItems) in fullState.Where(set => !skippedSetsThisUser.Contains(set.Key) && listedUser.MatchableTypes.Contains(set.Key.Type) && set.Value.Values.Any(count => count > 1))) {
|
||||
if (!tradableState.TryGetValue(set, out Dictionary<ulong, uint> ourTradableItems) || (ourTradableItems.Count == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user