From 3a32cd09e32b62698b381dd211e8659d4ffe30ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B3=A5?= <44732554+Lyrapuff@users.noreply.github.com> Date: Tue, 9 May 2023 16:48:30 +0300 Subject: [PATCH] Add delay between loading inventories --- BotLooter/Steam/LootClient.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BotLooter/Steam/LootClient.cs b/BotLooter/Steam/LootClient.cs index 500843e..c84df80 100644 --- a/BotLooter/Steam/LootClient.cs +++ b/BotLooter/Steam/LootClient.cs @@ -88,6 +88,8 @@ public LootClient(SteamAccountCredentials credentials, SteamSession steamSession private async Task<(List? Assets, string message)> GetAssetsToSend(SteamWeb web, ulong steamId64, List inventories) { var assets = new List(); + + var index = 0; foreach (var inventory in inventories) { @@ -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, "");