Compare commits

..

22 Commits

Author SHA1 Message Date
JustArchi
74881094ab Never allow clearing of OwnedPackageIDs, especially on invalid Valve callbacks 2020-06-23 00:09:27 +02:00
JustArchi
ee98282475 Bump 2020-06-22 17:28:58 +02:00
JustArchi
e49ec14c41 Translations update 2020-06-22 16:49:23 +02:00
JustArchi
56f4604819 Misc 2020-06-22 16:43:02 +02:00
JustArchi
56eb5ba8a8 Misc 2020-06-22 16:41:54 +02:00
JustArchi
8206dff4c1 Slightly improve session refresh
Previous solution of assuming that session is valid for at least N amount of seconds is pretty optimistic, too optimistic for real usage, instead, we won't assume anything like that and force every request to go through session refresh, but at the same time limit session refresh checks to just one at a time - if additional requests asked for session refresh, they'll use already-calculated value.

This way sending 100 requests at once won't always trigger 100 session refreshes but most likely around 2-3, while still allowing ASF to check session refresh with every request, if deemed necessary (due to delay between session checks
2020-06-22 16:40:49 +02:00
JustArchi
f7426a4439 Bump 2020-06-21 11:26:21 +02:00
JustArchi
c478ca691d Translations update 2020-06-21 11:25:23 +02:00
JustArchi
a3ff3cafa4 Skip 5 minutes wait if we didn't send any trade 2020-06-21 11:21:15 +02:00
JustArchi
313d353ae5 Misc edge case 2020-06-21 01:05:54 +02:00
JustArchi
dabf391576 Bump 2020-06-21 00:45:35 +02:00
JustArchi
8ad552b0da Slightly improve ASF's algorithm for picking users to match 2020-06-21 00:44:24 +02:00
JustArchi
c16c25da77 Translations update 2020-06-21 00:19:15 +02:00
JustArchi
aa1fc829b7 Misc 2020-06-21 00:15:06 +02:00
JustArchi
e5eea110f1 Skip fair bots with huge inventories when active matching 2020-06-21 00:06:17 +02:00
JustArchi
2e5828779f Update Bug_report.md 2020-06-20 17:55:40 +02:00
JustArchi
cc2e73ae5a Misc 2020-06-20 17:12:18 +02:00
dependabot-preview[bot]
b89840f103 Bump Swashbuckle.AspNetCore from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 10:25:06 +00:00
dependabot-preview[bot]
12b32472ba Bump Swashbuckle.AspNetCore.Newtonsoft from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore.Newtonsoft](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 10:03:24 +00:00
dependabot-preview[bot]
86ac2ade1e Bump Swashbuckle.AspNetCore.Annotations from 5.4.1 to 5.5.0
Bumps [Swashbuckle.AspNetCore.Annotations](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases)
- [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v5.4.1...v5.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 09:38:34 +00:00
JustArchi
a180c46b5d Update config.yml 2020-06-19 10:12:41 +02:00
JustArchi
34555f8bb5 Bump 2020-06-18 23:42:14 +02:00
13 changed files with 83 additions and 72 deletions

View File

@@ -40,7 +40,7 @@ Feel free to remove our notice and fill the template below with your details.
### Full log.txt recorded during reproducing the problem
```
```text
Paste here, in-between triple backtick tags
Ensure that your log is complete and was NOT recorded in Debug mode, as debug log may contain sensitive information that should not be shared publicly, as per our wiki statement. Standard ASF log does not include sensitive information.

View File

@@ -6,7 +6,7 @@ contact_links:
- name: Localization improvement
url: https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Localization
about: Please use our crowdin platform.
- name: Questions and technical issues
- name: Support question or technical issue
url: https://github.com/JustArchiNET/ArchiSteamFarm/blob/master/SUPPORT.md
about: Please review our support guidelines.
- name: Negative feedback, complaints and demands

2
ASF-ui

Submodule ASF-ui updated: 5400bcdd1f...b74e43068e

View File

@@ -262,6 +262,10 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
break;
}
if (!bot.IsConnectedAndLoggedOn) {
return;
}
bot.ArchiLogger.LogGenericInfo($"Retrieving {appIDsThisRound.Count} app access tokens...");
SteamApps.PICSTokensCallback response;
@@ -274,6 +278,12 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
return;
}
if (response == null) {
bot.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningFailedWithError, nameof(response)));
return;
}
bot.ArchiLogger.LogGenericInfo($"Finished retrieving {appIDsThisRound.Count} app access tokens.");
appIDsThisRound.Clear();
@@ -297,6 +307,10 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
break;
}
if (!bot.IsConnectedAndLoggedOn) {
return;
}
bot.ArchiLogger.LogGenericInfo($"Retrieving {appIDsThisRound.Count} app infos...");
AsyncJobMultiple<SteamApps.PICSProductInfoCallback>.ResultSet response;

View File

@@ -27,9 +27,9 @@
<PackageReference Include="NLog" Version="4.7.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.2" />
<PackageReference Include="SteamKit2" Version="2.3.0-beta.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.5.0" />
<PackageReference Include="System.Composition" Version="1.4.1" />
<PackageReference Include="System.Linq.Async" Version="4.1.1" />
</ItemGroup>

View File

@@ -50,13 +50,13 @@ namespace ArchiSteamFarm {
[PublicAPI]
public const string SteamStoreURL = "https://" + SteamStoreHost;
internal const ushort MaxItemsInSingleInventoryRequest = 5000;
private const string IEconService = "IEconService";
private const string IPlayerService = "IPlayerService";
private const string ISteamApps = "ISteamApps";
private const string ISteamUserAuth = "ISteamUserAuth";
private const string ITwoFactorService = "ITwoFactorService";
private const ushort MaxItemsInSingleInventoryRequest = 5000;
private const byte MinSessionValidityInSeconds = GlobalConfig.DefaultConnectionTimeout / 6;
private const string SteamCommunityHost = "steamcommunity.com";
private const string SteamHelpHost = "help.steampowered.com";
private const string SteamStoreHost = "store.steampowered.com";
@@ -2392,14 +2392,16 @@ namespace ArchiSteamFarm {
}
private async Task<bool?> IsSessionExpired() {
if (DateTime.UtcNow < LastSessionCheck.AddSeconds(MinSessionValidityInSeconds)) {
DateTime triggeredAt = DateTime.UtcNow;
if (triggeredAt <= LastSessionCheck) {
return LastSessionCheck != LastSessionRefresh;
}
await SessionSemaphore.WaitAsync().ConfigureAwait(false);
try {
if (DateTime.UtcNow < LastSessionCheck.AddSeconds(MinSessionValidityInSeconds)) {
if (triggeredAt <= LastSessionCheck) {
return LastSessionCheck != LastSessionRefresh;
}
@@ -2521,15 +2523,15 @@ namespace ArchiSteamFarm {
DateTime triggeredAt = DateTime.UtcNow;
if (triggeredAt < LastSessionRefresh.AddSeconds(MinSessionValidityInSeconds)) {
return true;
if (triggeredAt <= LastSessionCheck) {
return LastSessionCheck == LastSessionRefresh;
}
await SessionSemaphore.WaitAsync().ConfigureAwait(false);
try {
if (triggeredAt < LastSessionRefresh.AddSeconds(MinSessionValidityInSeconds)) {
return true;
if (triggeredAt <= LastSessionCheck) {
return LastSessionCheck == LastSessionRefresh;
}
if (!Bot.IsConnectedAndLoggedOn) {
@@ -2539,10 +2541,14 @@ namespace ArchiSteamFarm {
Bot.ArchiLogger.LogGenericInfo(Strings.RefreshingOurSession);
bool result = await Bot.RefreshSession().ConfigureAwait(false);
DateTime now = DateTime.UtcNow;
if (result) {
LastSessionCheck = LastSessionRefresh = DateTime.UtcNow;
LastSessionRefresh = now;
}
LastSessionCheck = now;
return result;
} finally {
SessionSemaphore.Release();

View File

@@ -23,6 +23,7 @@ using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
@@ -122,8 +123,6 @@ namespace ArchiSteamFarm {
internal readonly ArchiHandler ArchiHandler;
internal readonly BotDatabase BotDatabase;
internal readonly ConcurrentDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)> OwnedPackageIDs = new ConcurrentDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)>();
internal bool CanReceiveSteamCards => !IsAccountLimited && !IsAccountLocked;
internal bool IsAccountLimited => AccountFlags.HasFlag(EAccountFlags.LimitedUser) || AccountFlags.HasFlag(EAccountFlags.LimitedUserForce);
internal bool IsAccountLocked => AccountFlags.HasFlag(EAccountFlags.Lockdown);
@@ -195,6 +194,7 @@ namespace ArchiSteamFarm {
[PublicAPI]
public ECurrencyCode WalletCurrency { get; private set; }
internal ImmutableDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)> OwnedPackageIDs { get; private set; } = ImmutableDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)>.Empty;
internal bool PlayingBlocked { get; private set; }
internal bool PlayingWasBlocked { get; private set; }
@@ -2160,7 +2160,6 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericInfo(Strings.BotDisconnected);
OwnedPackageIDs.Clear();
PastNotifications.Clear();
Actions.OnDisconnected();
@@ -2384,16 +2383,21 @@ namespace ArchiSteamFarm {
return;
}
bool initialLogin = OwnedPackageIDs.Count == 0;
if (callback.LicenseList.Count == 0) {
ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsEmpty, nameof(callback.LicenseList)));
return;
}
Commands.OnNewLicenseList();
OwnedPackageIDs.Clear();
Dictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)> ownedPackageIDs = new Dictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)>();
Dictionary<uint, ulong> packageAccessTokens = new Dictionary<uint, ulong>();
Dictionary<uint, uint> packagesToRefresh = new Dictionary<uint, uint>();
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList.GroupBy(license => license.PackageID, (packageID, licenses) => licenses.OrderByDescending(license => license.TimeCreated).First())) {
OwnedPackageIDs[license.PackageID] = (license.PaymentMethod, license.TimeCreated);
ownedPackageIDs[license.PackageID] = (license.PaymentMethod, license.TimeCreated);
if (!ASF.GlobalDatabase.PackageAccessTokensReadOnly.TryGetValue(license.PackageID, out ulong packageAccessToken) || (packageAccessToken != license.AccessToken)) {
packageAccessTokens[license.PackageID] = license.AccessToken;
@@ -2405,6 +2409,8 @@ namespace ArchiSteamFarm {
}
}
OwnedPackageIDs = ownedPackageIDs.ToImmutableDictionary();
if (packageAccessTokens.Count > 0) {
ASF.GlobalDatabase.RefreshPackageAccessTokens(packageAccessTokens);
}
@@ -2415,11 +2421,6 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericTrace(Strings.Done);
}
if (initialLogin && CardsFarmer.Paused) {
// Emit initial game playing status in this case
await ResetGamesPlayed().ConfigureAwait(false);
}
await CardsFarmer.OnNewGameAdded().ConfigureAwait(false);
}
@@ -2623,6 +2624,11 @@ namespace ArchiSteamFarm {
);
}
if (CardsFarmer.Paused) {
// Emit initial game playing status in this case
Utilities.InBackground(ResetGamesPlayed);
}
SteamPICSChanges.OnBotLoggedOn();
await PluginsCore.OnBotLoggedOn(this).ConfigureAwait(false);

View File

@@ -36,12 +36,12 @@ using SteamKit2;
namespace ArchiSteamFarm {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
public sealed class GlobalConfig {
internal const byte DefaultConnectionTimeout = 90;
internal const byte DefaultLoginLimiterDelay = 10;
private const bool DefaultAutoRestart = true;
private const string DefaultCommandPrefix = "!";
private const byte DefaultConfirmationsLimiterDelay = 10;
private const byte DefaultConnectionTimeout = 90;
private const string DefaultCurrentCulture = null;
private const bool DefaultDebug = false;
private const byte DefaultFarmingDelay = 15;

View File

@@ -136,8 +136,8 @@ namespace ArchiSteamFarm {
return globalDatabase;
}
internal HashSet<uint> GetPackageIDs(uint appID, ICollection<uint> packageIDs) {
if ((appID == 0) || (packageIDs == null) || (packageIDs.Count == 0)) {
internal HashSet<uint> GetPackageIDs(uint appID, IEnumerable<uint> packageIDs) {
if ((appID == 0) || (packageIDs == null)) {
ASF.ArchiLogger.LogNullError(nameof(appID) + " || " + nameof(packageIDs));
return null;

View File

@@ -34,8 +34,8 @@ using Newtonsoft.Json;
namespace ArchiSteamFarm {
internal sealed class Statistics : IAsyncDisposable {
private const ushort MaxItemsForFairBots = ArchiWebHandler.MaxItemsInSingleInventoryRequest * WebBrowser.MaxTries; // Determines which fair bots we'll deprioritize when matching due to excessive number of inventory requests they need to make, which are likely to fail in the process or cause excessive delays
private const byte MaxMatchedBotsHard = 40; // Determines how many bots we can attempt to match in total, where match attempt is equal to analyzing bot's inventory
private const byte MaxMatchedBotsSoft = MaxMatchedBotsHard / 2; // Determines how many consecutive empty matches we need to get before we decide to skip bots from the same category
private const byte MaxMatchingRounds = 10; // Determines maximum amount of matching rounds we're going to consider before leaving the rest of work for the next batch
private const byte MinAnnouncementCheckTTL = 6; // Minimum amount of hours we must wait before checking eligibility for Announcement, should be lower than MinPersonaStateTTL
private const byte MinHeartBeatTTL = 10; // Minimum amount of minutes we must wait before sending next HeartBeat
@@ -325,10 +325,11 @@ namespace ArchiSteamFarm {
Dictionary<ulong, (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs)> triedSteamIDs = new Dictionary<ulong, (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs)>();
bool match = true;
bool shouldContinueMatching = true;
bool tradedSomething = false;
for (byte i = 0; (i < MaxMatchingRounds) && match; i++) {
if (i > 0) {
for (byte i = 0; (i < MaxMatchingRounds) && shouldContinueMatching; i++) {
if ((i > 0) && tradedSomething) {
// After each round we wait at least 5 minutes for all bots to react
await Task.Delay(5 * 60 * 1000).ConfigureAwait(false);
}
@@ -341,7 +342,7 @@ namespace ArchiSteamFarm {
using (await Bot.Actions.GetTradingLock().ConfigureAwait(false)) {
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.ActivelyMatchingItems, i));
match = await MatchActivelyRound(acceptedMatchableTypes, triedSteamIDs).ConfigureAwait(false);
(shouldContinueMatching, tradedSomething) = await MatchActivelyRound(acceptedMatchableTypes, triedSteamIDs).ConfigureAwait(false);
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.DoneActivelyMatchingItems, i));
}
}
@@ -352,11 +353,11 @@ namespace ArchiSteamFarm {
}
}
private async Task<bool> MatchActivelyRound(IReadOnlyCollection<Steam.Asset.EType> acceptedMatchableTypes, IDictionary<ulong, (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs)> triedSteamIDs) {
private async Task<(bool ShouldContinueMatching, bool TradedSomething)> MatchActivelyRound(IReadOnlyCollection<Steam.Asset.EType> acceptedMatchableTypes, IDictionary<ulong, (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs)> triedSteamIDs) {
if ((acceptedMatchableTypes == null) || (acceptedMatchableTypes.Count == 0) || (triedSteamIDs == null)) {
Bot.ArchiLogger.LogNullError(nameof(acceptedMatchableTypes) + " || " + nameof(triedSteamIDs));
return false;
return (false, false);
}
HashSet<Steam.Asset> ourInventory;
@@ -364,17 +365,17 @@ namespace ArchiSteamFarm {
try {
ourInventory = await Bot.ArchiWebHandler.GetInventoryAsync().Where(item => acceptedMatchableTypes.Contains(item.Type)).ToHashSetAsync().ConfigureAwait(false);
} catch (HttpRequestException) {
return false;
return (false, false);
} catch (Exception e) {
Bot.ArchiLogger.LogGenericException(e);
return false;
return (false, false);
}
if (ourInventory.Count == 0) {
Bot.ArchiLogger.LogGenericTrace(string.Format(Strings.ErrorIsEmpty, nameof(ourInventory)));
return false;
return (false, false);
}
(Dictionary<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity), Dictionary<ulong, uint>> ourFullState, Dictionary<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity), Dictionary<ulong, uint>> ourTradableState) = Trading.GetDividedInventoryState(ourInventory);
@@ -383,7 +384,7 @@ namespace ArchiSteamFarm {
// User doesn't have any more dupes in the inventory
Bot.ArchiLogger.LogGenericTrace(string.Format(Strings.ErrorIsEmpty, nameof(ourFullState) + " || " + nameof(ourTradableState)));
return false;
return (false, false);
}
ImmutableHashSet<ListedUser> listedUsers = await GetListedUsers().ConfigureAwait(false);
@@ -391,20 +392,14 @@ namespace ArchiSteamFarm {
if ((listedUsers == null) || (listedUsers.Count == 0)) {
Bot.ArchiLogger.LogGenericTrace(string.Format(Strings.ErrorIsEmpty, nameof(listedUsers)));
return false;
return (false, false);
}
bool skipAnyBots = false;
byte emptyMatches = 0;
byte totalMatches = 0;
HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)> skippedSetsThisRound = new HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)>();
foreach (ListedUser listedUser in listedUsers.Where(listedUser => (listedUser.SteamID != Bot.SteamID) && acceptedMatchableTypes.Any(listedUser.MatchableTypes.Contains) && (!triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) || (attempt.Tries < byte.MaxValue)) && !Bot.IsBlacklistedFromTrades(listedUser.SteamID)).OrderBy(listedUser => triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) ? attempt.Tries : 0).ThenByDescending(listedUser => listedUser.MatchEverything).ThenByDescending(listedUser => listedUser.Score)) {
if (listedUser.MatchEverything && skipAnyBots) {
continue;
}
foreach (ListedUser listedUser in listedUsers.Where(listedUser => (listedUser.SteamID != Bot.SteamID) && acceptedMatchableTypes.Any(listedUser.MatchableTypes.Contains) && (!triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) || (attempt.Tries < byte.MaxValue)) && !Bot.IsBlacklistedFromTrades(listedUser.SteamID)).OrderBy(listedUser => triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) attempt) ? attempt.Tries : 0).ThenByDescending(listedUser => listedUser.MatchEverything).ThenByDescending(listedUser => listedUser.MatchEverything || (listedUser.ItemsCount < MaxItemsForFairBots)).ThenByDescending(listedUser => listedUser.Score)) {
HashSet<(uint RealAppID, Steam.Asset.EType Type, Steam.Asset.ERarity Rarity)> wantedSets = ourTradableState.Keys.Where(set => !skippedSetsThisRound.Contains(set) && listedUser.MatchableTypes.Contains(set.Type)).ToHashSet();
if (wantedSets.Count == 0) {
@@ -468,7 +463,7 @@ namespace ArchiSteamFarm {
if (!ourFullSet.TryGetValue(classID, out uint fullAmount) || (fullAmount == 0) || (fullAmount < amount)) {
Bot.ArchiLogger.LogNullError(nameof(fullAmount));
return false;
return (false, skippedSetsThisRound.Count > 0);
}
if (fullAmount > amount) {
@@ -480,7 +475,7 @@ namespace ArchiSteamFarm {
if (!ourTradableSet.TryGetValue(classID, out uint tradableAmount) || (tradableAmount == 0) || (tradableAmount < amount)) {
Bot.ArchiLogger.LogNullError(nameof(tradableAmount));
return false;
return (false, skippedSetsThisRound.Count > 0);
}
if (fullAmount > amount) {
@@ -606,7 +601,7 @@ namespace ArchiSteamFarm {
// Failsafe
Bot.ArchiLogger.LogGenericError(string.Format(Strings.WarningFailedWithError, Strings.ErrorAborted));
return false;
return (false, skippedSetsThisRound.Count > 0);
}
if (triedSteamIDs.TryGetValue(listedUser.SteamID, out (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs) previousAttempt)) {
@@ -626,8 +621,6 @@ namespace ArchiSteamFarm {
triedSteamIDs[listedUser.SteamID] = (++previousAttempt.Tries, previousAttempt.GivenAssetIDs, previousAttempt.ReceivedAssetIDs);
emptyMatches = 0;
Bot.ArchiLogger.LogGenericTrace(Bot.SteamID + " <- " + string.Join(", ", itemsToReceive.Select(item => item.RealAppID + "/" + item.Type + "-" + item.ClassID + " #" + item.Amount)) + " | " + string.Join(", ", itemsToGive.Select(item => item.RealAppID + "/" + item.Type + "-" + item.ClassID + " #" + item.Amount)) + " -> " + listedUser.SteamID);
(bool success, HashSet<ulong> mobileTradeOfferIDs) = await Bot.ArchiWebHandler.SendTradeOffer(listedUser.SteamID, itemsToGive, itemsToReceive, listedUser.TradeToken, true).ConfigureAwait(false);
@@ -638,7 +631,7 @@ namespace ArchiSteamFarm {
if (!twoFactorSuccess) {
Bot.ArchiLogger.LogGenericTrace(Strings.WarningFailed);
return false;
return (false, skippedSetsThisRound.Count > 0);
}
}
@@ -661,15 +654,6 @@ namespace ArchiSteamFarm {
triedSteamIDs[listedUser.SteamID] = (byte.MaxValue, null, null);
}
if (++emptyMatches >= MaxMatchedBotsSoft) {
if (skipAnyBots) {
break;
}
skipAnyBots = true;
emptyMatches = 0;
}
continue;
}
@@ -691,11 +675,17 @@ namespace ArchiSteamFarm {
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.ActivelyMatchingItemsRound, skippedSetsThisRound.Count));
return skippedSetsThisRound.Count > 0;
// Keep matching when we either traded something this round (so it makes sense for a refresh) or if we didn't try all available bots yet (so it makes sense to keep going)
return ((totalMatches > 0) && ((skippedSetsThisRound.Count > 0) || triedSteamIDs.Values.All(data => data.Tries < 2)), skippedSetsThisRound.Count > 0);
}
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
private sealed class ListedUser {
#pragma warning disable 649
[JsonProperty(PropertyName = "items_count", Required = Required.Always)]
internal readonly ushort ItemsCount;
#pragma warning restore 649
internal readonly HashSet<Steam.Asset.EType> MatchableTypes = new HashSet<Steam.Asset.EType>();
#pragma warning disable 649
@@ -715,11 +705,6 @@ namespace ArchiSteamFarm {
private readonly ushort GamesCount;
#pragma warning restore 649
#pragma warning disable 649
[JsonProperty(PropertyName = "items_count", Required = Required.Always)]
private readonly ushort ItemsCount;
#pragma warning restore 649
internal bool MatchEverything { get; private set; }
#pragma warning disable IDE0051

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>4.2.2.8</Version>
<Version>4.2.3.2</Version>
</PropertyGroup>
<PropertyGroup>

2
wiki

Submodule wiki updated: d4db33893f...31e95fe1d8