Improve debugging experience

This commit is contained in:
JustArchi
2017-06-26 01:37:14 +02:00
parent d6db96b0f7
commit a7fd20e587
3 changed files with 29 additions and 2 deletions

View File

@@ -56,9 +56,12 @@ namespace ArchiSteamFarm {
return;
}
Bot.ArchiLogger.LogGenericTrace(Strings.Starting);
for (byte i = 0; (i < MaxSingleQueuesDaily) && (await IsDiscoveryQueueAvailable().ConfigureAwait(false)).GetValueOrDefault(); i++) {
HashSet<uint> queue = await Bot.ArchiWebHandler.GenerateNewDiscoveryQueue().ConfigureAwait(false);
if ((queue == null) || (queue.Count == 0)) {
Bot.ArchiLogger.LogGenericTrace(string.Format(Strings.ErrorIsEmpty, nameof(queue)));
break;
}
@@ -76,6 +79,8 @@ namespace ArchiSteamFarm {
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.DoneClearingDiscoveryQueue, i));
}
Bot.ArchiLogger.LogGenericTrace(Strings.Done);
}
private async Task<bool?> IsDiscoveryQueueAvailable() {
@@ -96,6 +101,8 @@ namespace ArchiSteamFarm {
return null;
}
Bot.ArchiLogger.LogGenericTrace(text);
// It'd make more sense to check against "Come back tomorrow", but it might not cover out-of-the-event queue
bool result = text.StartsWith("You can get ", StringComparison.Ordinal);
return result;