Skip to content

Commit

Permalink
Add delay between loading inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
yakikotori committed May 9, 2023
1 parent 0c16446 commit 3a32cd0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions BotLooter/Steam/LootClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public LootClient(SteamAccountCredentials credentials, SteamSession steamSession
private async Task<(List<Asset>? Assets, string message)> GetAssetsToSend(SteamWeb web, ulong steamId64, List<string> inventories)
{
var assets = new List<Asset>();

var index = 0;

foreach (var inventory in inventories)
{
Expand All @@ -114,6 +116,15 @@ public LootClient(SteamAccountCredentials credentials, SteamSession steamSession
}

assets.AddRange(inventoryAssets);

var isLast = index == inventories.Count - 1;

if (!isLast)
{
await Task.Delay(TimeSpan.FromSeconds(3));
}

index++;
}

return (assets, "");
Expand Down

0 comments on commit 3a32cd0

Please sign in to comment.