Add better fallback for parental timeouts

This commit is contained in:
JustArchi
2019-07-22 12:48:44 +02:00
parent 8a2598f1aa
commit 0ca7d40490
2 changed files with 15 additions and 0 deletions

View File

@@ -660,6 +660,10 @@ namespace ArchiSteamFarm {
CParental_GetParentalSettings_Response body = response.GetDeserializedResponse<CParental_GetParentalSettings_Response>();
if (body.settings == null) {
return null;
}
if (!body.settings.is_enabled) {
return (false, null);
}

View File

@@ -2036,6 +2036,7 @@ namespace ArchiSteamFarm {
EResult lastLogOnResult = LastLogOnResult;
LastLogOnResult = EResult.Invalid;
ItemsCount = TradesCount = HeartBeatFailures = 0;
SteamParentalActive = true;
StopConnectionFailureTimer();
StopPlayingWasBlockedTimer();
@@ -2440,6 +2441,16 @@ namespace ArchiSteamFarm {
} else {
SteamParentalActive = false;
}
} else if (SteamParentalActive && !string.IsNullOrEmpty(BotConfig.SteamParentalCode) && (BotConfig.SteamParentalCode.Length != BotConfig.SteamParentalCodeLength)) {
string steamParentalCode = await Logging.GetUserInput(ASF.EUserInputType.SteamParentalCode, BotName).ConfigureAwait(false);
if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != BotConfig.SteamParentalCodeLength)) {
Stop();
break;
}
SetUserInput(ASF.EUserInputType.SteamParentalCode, steamParentalCode);
}
ArchiWebHandler.OnVanityURLChanged(callback.VanityURL);