Fix for accounts without SG timestamp

Initially I added check against zero as bullet-proofing for unexpected events, but some accounts actually report 0.

Assume 0 is older than needed, if we don't have information available, we shouldn't jump to conclusions.
This commit is contained in:
Archi
2023-05-18 12:01:48 +02:00
parent d81694c7f0
commit a557b62e0b

View File

@@ -537,7 +537,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable {
}
// Bot must have SteamGuard active for at least 15 days
if (!steamGuardStatus.is_steamguard_enabled || (steamGuardStatus.timestamp_steamguard_enabled == 0) || ((DateTimeOffset.UtcNow - DateTimeOffset.FromUnixTimeSeconds(steamGuardStatus.timestamp_steamguard_enabled)).TotalDays < MinimumSteamGuardEnabledDays)) {
if (!steamGuardStatus.is_steamguard_enabled || ((steamGuardStatus.timestamp_steamguard_enabled > 0) && ((DateTimeOffset.UtcNow - DateTimeOffset.FromUnixTimeSeconds(steamGuardStatus.timestamp_steamguard_enabled)).TotalDays < MinimumSteamGuardEnabledDays))) {
Bot.ArchiLogger.LogGenericTrace(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, $"{nameof(steamGuardStatus.is_steamguard_enabled)}/{nameof(steamGuardStatus.timestamp_steamguard_enabled)}: {steamGuardStatus.is_steamguard_enabled}/{steamGuardStatus.timestamp_steamguard_enabled}"));
return false;