Modify AppInfosPerSingleRequest for STD

This commit is contained in:
JustArchi 2020-06-15 16:25:28 +02:00
parent ce5443ca9a
commit e201d88e7a
2 changed files with 6 additions and 5 deletions

View file

@ -23,13 +23,13 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
internal static class SharedInfo {
internal const byte ApiVersion = 1;
internal const string ConfigurationPropertyEnabled = nameof(SteamTokenDumperPlugin) + "Enabled";
internal const ushort ItemsPerSingleRequest = 2048; // Should be synchronized with TimeoutForLongRunningTasksInSeconds
internal const byte AppInfosPerSingleRequest = byte.MaxValue;
internal const byte MaximumHoursBetweenRefresh = 8; // Per single bot account, makes sense to be 2 or 3 times less than MinimumHoursBetweenUploads
internal const byte MaximumMinutesBeforeFirstUpload = 60; // Must be greater or equal to MinimumMinutesBeforeFirstUpload
internal const byte MinimumHoursBetweenUploads = 24;
internal const byte MinimumMinutesBeforeFirstUpload = 10; // Must be less or equal to MaximumMinutesBeforeFirstUpload
internal const string ServerURL = "https://asf-token-dumper.xpaw.me";
internal const byte TimeoutForLongRunningTasksInSeconds = 60; // Should be synchronized with ItemsPerSingleRequest
internal const byte TimeoutForLongRunningTasksInSeconds = 60;
internal const string Token = "STEAM_TOKEN_DUMPER_TOKEN";
internal static bool HasValidToken => Token.Length == 128;

View file

@ -250,11 +250,11 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
bot.ArchiLogger.LogGenericInfo($"Retrieving a total of {appIDsToRefresh.Count} app access tokens...");
HashSet<uint> appIDsThisRound = new HashSet<uint>(Math.Min(appIDsToRefresh.Count, SharedInfo.ItemsPerSingleRequest));
HashSet<uint> appIDsThisRound = new HashSet<uint>(Math.Min(appIDsToRefresh.Count, SharedInfo.AppInfosPerSingleRequest));
using (HashSet<uint>.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) {
while (true) {
while ((appIDsThisRound.Count < SharedInfo.ItemsPerSingleRequest) && enumerator.MoveNext()) {
while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) {
appIDsThisRound.Add(enumerator.Current);
}
@ -289,7 +289,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
using (HashSet<uint>.Enumerator enumerator = appIDsToRefresh.GetEnumerator()) {
while (true) {
while ((appIDsThisRound.Count < SharedInfo.ItemsPerSingleRequest) && enumerator.MoveNext()) {
while ((appIDsThisRound.Count < SharedInfo.AppInfosPerSingleRequest) && enumerator.MoveNext()) {
appIDsThisRound.Add(enumerator.Current);
}
@ -320,6 +320,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
appIDsThisRound.Clear();
Dictionary<uint, uint> appChangeNumbers = new Dictionary<uint, uint>();
HashSet<Task<SteamApps.DepotKeyCallback>> depotTasks = new HashSet<Task<SteamApps.DepotKeyCallback>>();
foreach (SteamApps.PICSProductInfoCallback.PICSProductInfo app in response.Results.SelectMany(result => result.Apps.Values)) {