Do not send more than 5 trade offers at once, #81

This commit is contained in:
JustArchi
2016-01-23 23:57:46 +01:00
parent cad47368ac
commit ee73a12440
2 changed files with 3 additions and 2 deletions

View File

@@ -426,7 +426,7 @@ namespace ArchiSteamFarm {
List<SteamTradeOfferRequest> trades = new List<SteamTradeOfferRequest>();
SteamTradeOfferRequest singleTrade = null;
for (ushort i = 0; i < inventory.Count; i++) {
for (ushort i = 0; i < inventory.Count && i < Trading.MaxTradesPerAccount; i++) {
if (i % Trading.MaxItemsPerTrade == 0) {
singleTrade = new SteamTradeOfferRequest();
trades.Add(singleTrade);

View File

@@ -28,7 +28,8 @@ using System.Threading.Tasks;
namespace ArchiSteamFarm {
internal sealed class Trading {
internal const ushort MaxItemsPerTrade = 150;
internal const byte MaxItemsPerTrade = 150; // This is due to limit on POST size in WebBrowser
internal const byte MaxTradesPerAccount = 5; // This is limit introduced by Valve
private readonly Bot Bot;
private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1);