diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index ac18adad8..f48516ea3 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -660,6 +660,10 @@ namespace ArchiSteamFarm { CParental_GetParentalSettings_Response body = response.GetDeserializedResponse(); + if (body.settings == null) { + return null; + } + if (!body.settings.is_enabled) { return (false, null); } diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 7b71943da..f8c22750d 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -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);