Skip to content

Commit

Permalink
Feat: make MaxItemsPerTrade being less than 8192 be a config validati…
Browse files Browse the repository at this point in the history
…on error
  • Loading branch information
yakikotori committed Jul 5, 2024
1 parent 05295ed commit 852756e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BotLooter/Looting/LootClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public async Task<LootResult> TryLoot(TradeOfferUrl tradeOfferUrl, Configuration
}

assets = assets
.Take(Math.Min(configuration.MaxItemsPerTrade, 8192))
.Take(configuration.MaxItemsPerTrade)
.ToList();

return (assets, "");
Expand Down
5 changes: 5 additions & 0 deletions BotLooter/Resources/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ В параметре конфига 'Inventories' не указаны инве
...
""");
}

if (config.MaxItemsPerTrade < 8192)
{
return (null, $"Параметр конфига 'MaxItemsPerTrade' не должен быть меньше 8192, текущее значение: {config.MaxItemsPerTrade}");
}

return (config, "");
}
Expand Down

0 comments on commit 852756e

Please sign in to comment.