Add logic for MaxGamesPlayedConcurrently

This is a limit introduced by Steam Network, limit for Steam Client is 30, but we don't have to respect that one
This commit is contained in:
JustArchi
2016-06-27 21:09:58 +02:00
parent ebc8c1674b
commit 93191f9066
4 changed files with 33 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
namespace ArchiSteamFarm {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
@@ -124,6 +125,15 @@ namespace ArchiSteamFarm {
return null;
}
// User might not know what he's doing
// Ensure that he can't screw core ASF variables
if (botConfig.GamesPlayedWhileIdle.Count <= CardsFarmer.MaxGamesPlayedConcurrently) {
return botConfig;
}
Logging.LogGenericWarning("Playing more than " + CardsFarmer.MaxGamesPlayedConcurrently + " games concurrently is not possible, only first " + CardsFarmer.MaxGamesPlayedConcurrently + " entries from GamesPlayedWhileIdle will be used");
botConfig.GamesPlayedWhileIdle = new HashSet<uint>(botConfig.GamesPlayedWhileIdle.Take(CardsFarmer.MaxGamesPlayedConcurrently));
return botConfig;
}