Correct redeem keys changing logic when running out of queue

https://steamcommunity.com/groups/ascfarm/discussions/1/1697174779852958220/
This commit is contained in:
JustArchi
2018-06-02 06:45:55 +02:00
parent ab6cce739e
commit 56d48ae210

View File

@@ -4283,8 +4283,11 @@ namespace ArchiSteamFarm {
string key = keysEnumerator.MoveNext() ? keysEnumerator.Current : null; // Initial key
while (!string.IsNullOrEmpty(key)) {
string startingKey = key;
using (IEnumerator<Bot> botsEnumerator = Bots.Where(bot => (bot.Value != this) && !rateLimitedBots.Contains(bot.Value) && bot.Value.IsConnectedAndLoggedOn && bot.Value.IsOperator(steamID)).OrderBy(bot => bot.Key).Select(bot => bot.Value).GetEnumerator()) {
Bot currentBot = this;
while (!string.IsNullOrEmpty(key) && (currentBot != null)) {
if (redeemFlags.HasFlag(ERedeemFlags.Validate) && !IsValidCdKey(key)) {
key = keysEnumerator.MoveNext() ? keysEnumerator.Current : null; // Next key
@@ -4428,11 +4431,11 @@ namespace ArchiSteamFarm {
currentBot = botsEnumerator.MoveNext() ? botsEnumerator.Current : null;
}
}
}
if (currentBot == null) {
// We ran out of bots to try for this key, so change it
key = keysEnumerator.MoveNext() ? keysEnumerator.Current : null; // Next key
}
if (key == startingKey) {
// We ran out of bots to try for this key, so change it to avoid infinite loop
key = keysEnumerator.MoveNext() ? keysEnumerator.Current : null; // Next key
}
}
}