diff --git a/ArchiSteamFarm/ASF.cs b/ArchiSteamFarm/ASF.cs index aff328001..43a11fd00 100644 --- a/ArchiSteamFarm/ASF.cs +++ b/ArchiSteamFarm/ASF.cs @@ -615,7 +615,7 @@ namespace ArchiSteamFarm { Login, Password, SteamGuard, - SteamParentalPIN, + SteamParentalCode, TwoFactorAuthentication } } diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index d85c9548f..68ace8112 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -1025,9 +1025,9 @@ namespace ArchiSteamFarm { internal async Task HasValidApiKey() => !string.IsNullOrEmpty(await GetApiKey().ConfigureAwait(false)); - internal async Task Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalPin) { - if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce) || string.IsNullOrEmpty(parentalPin)) { - Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(universe) + " || " + nameof(webAPIUserNonce) + " || " + nameof(parentalPin)); + internal async Task Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalCode = null) { + if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce)) { + Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(universe) + " || " + nameof(webAPIUserNonce)); return false; } @@ -1109,8 +1109,8 @@ namespace ArchiSteamFarm { Bot.ArchiLogger.LogGenericInfo(Strings.Success); // Unlock Steam Parental if needed - if (!parentalPin.Equals("0")) { - if (!await UnlockParentalAccount(parentalPin).ConfigureAwait(false)) { + if (!string.IsNullOrEmpty(parentalCode) && (parentalCode.Length == 4)) { + if (!await UnlockParentalAccount(parentalCode).ConfigureAwait(false)) { return false; } } @@ -1622,20 +1622,20 @@ namespace ArchiSteamFarm { return await UrlPostWithSession(SteamCommunityURL, request, data).ConfigureAwait(false); } - private async Task UnlockParentalAccount(string parentalPin) { - if (string.IsNullOrEmpty(parentalPin)) { - Bot.ArchiLogger.LogNullError(nameof(parentalPin)); + private async Task UnlockParentalAccount(string parentalCode) { + if (string.IsNullOrEmpty(parentalCode)) { + Bot.ArchiLogger.LogNullError(nameof(parentalCode)); return false; } Bot.ArchiLogger.LogGenericInfo(Strings.UnlockingParentalAccount); - if (!await UnlockParentalAccountForService(SteamCommunityURL, parentalPin).ConfigureAwait(false)) { + if (!await UnlockParentalAccountForService(SteamCommunityURL, parentalCode).ConfigureAwait(false)) { Bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed); return false; } - if (!await UnlockParentalAccountForService(SteamStoreURL, parentalPin).ConfigureAwait(false)) { + if (!await UnlockParentalAccountForService(SteamStoreURL, parentalCode).ConfigureAwait(false)) { Bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed); return false; } @@ -1644,9 +1644,9 @@ namespace ArchiSteamFarm { return true; } - private async Task UnlockParentalAccountForService(string serviceURL, string parentalPin, byte maxTries = WebBrowser.MaxTries) { - if (string.IsNullOrEmpty(serviceURL) || string.IsNullOrEmpty(parentalPin)) { - Bot.ArchiLogger.LogNullError(nameof(serviceURL) + " || " + nameof(parentalPin)); + private async Task UnlockParentalAccountForService(string serviceURL, string parentalCode, byte maxTries = WebBrowser.MaxTries) { + if (string.IsNullOrEmpty(serviceURL) || string.IsNullOrEmpty(parentalCode)) { + Bot.ArchiLogger.LogNullError(nameof(serviceURL) + " || " + nameof(parentalCode)); return false; } @@ -1658,7 +1658,7 @@ namespace ArchiSteamFarm { return false; } - Dictionary data = new Dictionary(1) { { "pin", parentalPin } }; + Dictionary data = new Dictionary(1) { { "pin", parentalCode } }; // This request doesn't go through UrlPostRetryWithSession as we have no access to session refresh capability (this is in fact session initialization) WebBrowser.BasicResponse response = await WebLimitRequest(serviceURL, async () => await WebBrowser.UrlPost(serviceURL + request, data, serviceURL).ConfigureAwait(false)).ConfigureAwait(false); @@ -1670,7 +1670,7 @@ namespace ArchiSteamFarm { // Under special brain-damaged circumstances, Steam might just return our own profile as a response to the request, for absolutely no reason whatsoever - just try again in this case if (await IsProfileUri(response.FinalUri, false).ConfigureAwait(false)) { Bot.ArchiLogger.LogGenericDebug(string.Format(Strings.WarningWorkaroundTriggered, nameof(IsProfileUri))); - return await UnlockParentalAccountForService(serviceURL, parentalPin, --maxTries).ConfigureAwait(false); + return await UnlockParentalAccountForService(serviceURL, parentalCode, --maxTries).ConfigureAwait(false); } return true; diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 69611c404..e45887fe8 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -828,7 +828,7 @@ namespace ArchiSteamFarm { return false; } - if (await ArchiWebHandler.Init(CachedSteamID, SteamClient.Universe, callback.Nonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) { + if (await ArchiWebHandler.Init(CachedSteamID, SteamClient.Universe, callback.Nonce, BotConfig.SteamParentalCode).ConfigureAwait(false)) { return true; } @@ -987,16 +987,16 @@ namespace ArchiSteamFarm { break; case ASF.EUserInputType.Password: if (BotConfig != null) { - BotConfig.OriginalSteamPassword = inputValue; + BotConfig.DecryptedSteamPassword = inputValue; } break; case ASF.EUserInputType.SteamGuard: AuthCode = inputValue; break; - case ASF.EUserInputType.SteamParentalPIN: + case ASF.EUserInputType.SteamParentalCode: if (BotConfig != null) { - BotConfig.SteamParentalPIN = inputValue; + BotConfig.SteamParentalCode = inputValue; } break; @@ -1352,7 +1352,7 @@ namespace ArchiSteamFarm { SetUserInput(ASF.EUserInputType.Login, steamLogin); } - if (requiresPassword && string.IsNullOrEmpty(BotConfig.OriginalSteamPassword)) { + if (requiresPassword && string.IsNullOrEmpty(BotConfig.DecryptedSteamPassword)) { string steamPassword = Program.GetUserInput(ASF.EUserInputType.Password, BotName); if (string.IsNullOrEmpty(steamPassword)) { return false; @@ -1536,7 +1536,7 @@ namespace ArchiSteamFarm { string username = Regex.Replace(BotConfig.SteamLogin, nonAsciiPattern, "", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - string password = BotConfig.OriginalSteamPassword; + string password = BotConfig.DecryptedSteamPassword; if (!string.IsNullOrEmpty(password)) { password = Regex.Replace(password, nonAsciiPattern, "", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); } @@ -1916,19 +1916,19 @@ namespace ArchiSteamFarm { } } - if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) { - string steamParentalPIN = Program.GetUserInput(ASF.EUserInputType.SteamParentalPIN, BotName); - if (string.IsNullOrEmpty(steamParentalPIN)) { + if (!string.IsNullOrEmpty(BotConfig.SteamParentalCode) && (BotConfig.SteamParentalCode.Length != 4)) { + string steamParentalCode = Program.GetUserInput(ASF.EUserInputType.SteamParentalCode, BotName); + if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != 4)) { Stop(); break; } - SetUserInput(ASF.EUserInputType.SteamParentalPIN, steamParentalPIN); + SetUserInput(ASF.EUserInputType.SteamParentalCode, steamParentalCode); } ArchiWebHandler.OnVanityURLChanged(callback.VanityURL); - if (!await ArchiWebHandler.Init(callback.ClientSteamID, SteamClient.Universe, callback.WebAPIUserNonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) { + if (!await ArchiWebHandler.Init(callback.ClientSteamID, SteamClient.Universe, callback.WebAPIUserNonce, BotConfig.SteamParentalCode).ConfigureAwait(false)) { if (!await RefreshSession().ConfigureAwait(false)) { break; } diff --git a/ArchiSteamFarm/BotConfig.cs b/ArchiSteamFarm/BotConfig.cs index af59ea6b8..b7bbceeec 100644 --- a/ArchiSteamFarm/BotConfig.cs +++ b/ArchiSteamFarm/BotConfig.cs @@ -52,7 +52,7 @@ namespace ArchiSteamFarm { private const bool DefaultShutdownOnFarmingFinished = false; private const string DefaultSteamLogin = null; private const ulong DefaultSteamMasterClanID = 0; - private const string DefaultSteamParentalPIN = "0"; + private const string DefaultSteamParentalCode = null; private const string DefaultSteamPassword = null; private const string DefaultSteamTradeToken = null; private const ETradingPreferences DefaultTradingPreferences = ETradingPreferences.None; @@ -138,6 +138,97 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal readonly bool UseLoginKeys = DefaultUseLoginKeys; + internal string DecryptedSteamPassword { + get { + if (string.IsNullOrEmpty(SteamPassword)) { + return null; + } + + if (PasswordFormat == ArchiCryptoHelper.ECryptoMethod.PlainText) { + return SteamPassword; + } + + string decryptedPassword = ArchiCryptoHelper.Decrypt(PasswordFormat, SteamPassword); + if (string.IsNullOrEmpty(decryptedPassword)) { + ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(SteamPassword))); + return null; + } + + return decryptedPassword; + } + set { + if (string.IsNullOrEmpty(value)) { + ASF.ArchiLogger.LogNullError(nameof(value)); + return; + } + + SteamPassword = PasswordFormat == ArchiCryptoHelper.ECryptoMethod.PlainText ? value : ArchiCryptoHelper.Encrypt(PasswordFormat, value); + } + } + + internal bool IsSteamLoginSet { get; private set; } + internal bool IsSteamParentalCodeSet { get; private set; } + internal bool IsSteamPasswordSet { get; private set; } + internal bool ShouldSerializeEverything { private get; set; } = true; + + [JsonProperty] + internal string SteamLogin { + get => _SteamLogin; + set { + IsSteamLoginSet = true; + _SteamLogin = value; + } + } + + [JsonProperty(Required = Required.DisallowNull)] + internal ulong SteamMasterClanID { get; private set; } = DefaultSteamMasterClanID; + + [JsonProperty] + internal string SteamParentalCode { + get => _SteamParentalCode; + set { + IsSteamParentalCodeSet = true; + _SteamParentalCode = value; + } + } + + [JsonProperty] + internal string SteamPassword { + get => _SteamPassword; + set { + IsSteamPasswordSet = true; + _SteamPassword = value; + } + } + + private string _SteamLogin = DefaultSteamLogin; + private string _SteamParentalCode = DefaultSteamParentalCode; + private string _SteamPassword = DefaultSteamPassword; + private bool ShouldSerializeSensitiveDetails = true; + + [JsonProperty(PropertyName = SharedInfo.UlongCompatibilityStringPrefix + nameof(SteamMasterClanID), Required = Required.DisallowNull)] + private string SSteamMasterClanID { + get => SteamMasterClanID.ToString(); + set { + if (string.IsNullOrEmpty(value) || !ulong.TryParse(value, out ulong result)) { + ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(SSteamMasterClanID))); + return; + } + + SteamMasterClanID = result; + } + } + + [JsonProperty] + private string SteamParentalPIN { + set { + if (string.IsNullOrEmpty(value) || (value != "0")) { + ASF.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningDeprecated, nameof(SteamParentalPIN), nameof(SteamParentalCode))); + SteamParentalCode = string.IsNullOrEmpty(value) ? "0" : value; + } + } + } + internal (bool Valid, string ErrorMessage) CheckValidation() { if (BotBehaviour > EBotBehaviour.All) { return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(BotBehaviour), BotBehaviour)); @@ -181,6 +272,10 @@ namespace ArchiSteamFarm { return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(SteamMasterClanID), SteamMasterClanID)); } + if (!string.IsNullOrEmpty(SteamParentalCode) && (SteamParentalCode != "0") && (SteamParentalCode.Length != 4)) { + return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(SteamParentalCode), SteamParentalCode)); + } + foreach (EPermission permission in SteamUserPermissions.Values.Where(permission => !Enum.IsDefined(typeof(EPermission), permission))) { return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(SteamUserPermissions), permission)); } @@ -188,63 +283,6 @@ namespace ArchiSteamFarm { return TradingPreferences <= ETradingPreferences.All ? (true, null) : (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(TradingPreferences), TradingPreferences)); } - internal string OriginalSteamPassword { - get { - if (string.IsNullOrEmpty(SteamPassword)) { - return null; - } - - if (PasswordFormat == ArchiCryptoHelper.ECryptoMethod.PlainText) { - return SteamPassword; - } - - string decryptedPassword = ArchiCryptoHelper.Decrypt(PasswordFormat, SteamPassword); - if (string.IsNullOrEmpty(decryptedPassword)) { - ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(SteamPassword))); - return null; - } - - return decryptedPassword; - } - set { - if (string.IsNullOrEmpty(value)) { - ASF.ArchiLogger.LogNullError(nameof(value)); - return; - } - - SteamPassword = PasswordFormat == ArchiCryptoHelper.ECryptoMethod.PlainText ? value : ArchiCryptoHelper.Encrypt(PasswordFormat, value); - } - } - - internal bool ShouldSerializeEverything { private get; set; } = true; - - [JsonProperty] - internal string SteamLogin { get; set; } = DefaultSteamLogin; - - [JsonProperty(Required = Required.DisallowNull)] - internal ulong SteamMasterClanID { get; private set; } = DefaultSteamMasterClanID; - - [JsonProperty] - internal string SteamParentalPIN { get; set; } = DefaultSteamParentalPIN; - - private bool ShouldSerializeSensitiveDetails = true; - - [JsonProperty] - private string SteamPassword = DefaultSteamPassword; - - [JsonProperty(PropertyName = SharedInfo.UlongCompatibilityStringPrefix + nameof(SteamMasterClanID), Required = Required.DisallowNull)] - private string SSteamMasterClanID { - get => SteamMasterClanID.ToString(); - set { - if (string.IsNullOrEmpty(value) || !ulong.TryParse(value, out ulong result)) { - ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, nameof(SSteamMasterClanID))); - return; - } - - SteamMasterClanID = result; - } - } - internal static async Task Load(string filePath) { if (string.IsNullOrEmpty(filePath)) { ASF.ArchiLogger.LogNullError(nameof(filePath)); @@ -395,7 +433,7 @@ namespace ArchiSteamFarm { public bool ShouldSerializeSSteamMasterClanID() => ShouldSerializeEverything; // We never serialize helper properties public bool ShouldSerializeSteamLogin() => ShouldSerializeSensitiveDetails && (ShouldSerializeEverything || (SteamLogin != DefaultSteamLogin)); public bool ShouldSerializeSteamMasterClanID() => ShouldSerializeEverything || (SteamMasterClanID != DefaultSteamMasterClanID); - public bool ShouldSerializeSteamParentalPIN() => ShouldSerializeSensitiveDetails && (ShouldSerializeEverything || (SteamParentalPIN != DefaultSteamParentalPIN)); + public bool ShouldSerializeSteamParentalCode() => ShouldSerializeSensitiveDetails && (ShouldSerializeEverything || (SteamParentalCode != DefaultSteamParentalCode)); public bool ShouldSerializeSteamPassword() => ShouldSerializeSensitiveDetails && (ShouldSerializeEverything || (SteamPassword != DefaultSteamPassword)); public bool ShouldSerializeSteamTradeToken() => ShouldSerializeEverything || (SteamTradeToken != DefaultSteamTradeToken); public bool ShouldSerializeSteamUserPermissions() => ShouldSerializeEverything || ((SteamUserPermissions != DefaultSteamUserPermissions) && ((SteamUserPermissions.Count != DefaultSteamUserPermissions.Count) || SteamUserPermissions.Except(DefaultSteamUserPermissions).Any())); diff --git a/ArchiSteamFarm/Commands.cs b/ArchiSteamFarm/Commands.cs index 76f18097b..3c379dcb7 100644 --- a/ArchiSteamFarm/Commands.cs +++ b/ArchiSteamFarm/Commands.cs @@ -1350,11 +1350,11 @@ namespace ArchiSteamFarm { return null; } - if (string.IsNullOrEmpty(Bot.BotConfig.OriginalSteamPassword)) { - return FormatBotResponse(string.Format(Strings.ErrorIsEmpty, nameof(BotConfig.OriginalSteamPassword))); + if (string.IsNullOrEmpty(Bot.BotConfig.DecryptedSteamPassword)) { + return FormatBotResponse(string.Format(Strings.ErrorIsEmpty, nameof(BotConfig.DecryptedSteamPassword))); } - string response = FormatBotResponse(string.Format(Strings.BotEncryptedPassword, ArchiCryptoHelper.ECryptoMethod.AES, ArchiCryptoHelper.Encrypt(ArchiCryptoHelper.ECryptoMethod.AES, Bot.BotConfig.OriginalSteamPassword))) + FormatBotResponse(string.Format(Strings.BotEncryptedPassword, ArchiCryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, ArchiCryptoHelper.Encrypt(ArchiCryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, Bot.BotConfig.OriginalSteamPassword))); + string response = FormatBotResponse(string.Format(Strings.BotEncryptedPassword, ArchiCryptoHelper.ECryptoMethod.AES, ArchiCryptoHelper.Encrypt(ArchiCryptoHelper.ECryptoMethod.AES, Bot.BotConfig.DecryptedSteamPassword))) + FormatBotResponse(string.Format(Strings.BotEncryptedPassword, ArchiCryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, ArchiCryptoHelper.Encrypt(ArchiCryptoHelper.ECryptoMethod.ProtectedDataForCurrentUser, Bot.BotConfig.DecryptedSteamPassword))); return response; } diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index 671eeb423..3b1d257e5 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -183,6 +183,7 @@ namespace ArchiSteamFarm { } } + internal bool IsWebProxyPasswordSet { get; private set; } internal bool ShouldSerializeEverything { private get; set; } = true; [JsonProperty(Required = Required.DisallowNull)] @@ -192,9 +193,16 @@ namespace ArchiSteamFarm { internal ProtocolTypes SteamProtocols { get; private set; } = DefaultSteamProtocols; [JsonProperty] - internal string WebProxyPassword { get; set; } = DefaultWebProxyPassword; + internal string WebProxyPassword { + get => _WebProxyPassword; + set { + IsWebProxyPasswordSet = true; + _WebProxyPassword = value; + } + } private WebProxy _WebProxy; + private string _WebProxyPassword = DefaultWebProxyPassword; private bool ShouldSerializeSensitiveDetails = true; [JsonProperty(PropertyName = SharedInfo.UlongCompatibilityStringPrefix + nameof(SteamOwnerID), Required = Required.DisallowNull)] diff --git a/ArchiSteamFarm/IPC/Controllers/Api/ASFController.cs b/ArchiSteamFarm/IPC/Controllers/Api/ASFController.cs index 547e230ca..a4f021a58 100644 --- a/ArchiSteamFarm/IPC/Controllers/Api/ASFController.cs +++ b/ArchiSteamFarm/IPC/Controllers/Api/ASFController.cs @@ -58,10 +58,8 @@ namespace ArchiSteamFarm.IPC.Controllers.Api { return BadRequest(new GenericResponse(false, errorMessage)); } - if (request.KeepSensitiveDetails) { - if (string.IsNullOrEmpty(request.GlobalConfig.WebProxyPassword) && !string.IsNullOrEmpty(Program.GlobalConfig.WebProxyPassword)) { - request.GlobalConfig.WebProxyPassword = Program.GlobalConfig.WebProxyPassword; - } + if (!request.GlobalConfig.IsWebProxyPasswordSet && Program.GlobalConfig.IsWebProxyPasswordSet) { + request.GlobalConfig.WebProxyPassword = Program.GlobalConfig.WebProxyPassword; } request.GlobalConfig.ShouldSerializeEverything = false; diff --git a/ArchiSteamFarm/IPC/Controllers/Api/BotController.cs b/ArchiSteamFarm/IPC/Controllers/Api/BotController.cs index 10d1090cb..f0086e5f1 100644 --- a/ArchiSteamFarm/IPC/Controllers/Api/BotController.cs +++ b/ArchiSteamFarm/IPC/Controllers/Api/BotController.cs @@ -77,17 +77,17 @@ namespace ArchiSteamFarm.IPC.Controllers.Api { return BadRequest(new GenericResponse(false, errorMessage)); } - if (request.KeepSensitiveDetails && Bot.Bots.TryGetValue(botName, out Bot bot)) { - if (string.IsNullOrEmpty(request.BotConfig.SteamLogin) && !string.IsNullOrEmpty(bot.BotConfig.SteamLogin)) { + if (Bot.Bots.TryGetValue(botName, out Bot bot)) { + if (!request.BotConfig.IsSteamLoginSet && bot.BotConfig.IsSteamLoginSet) { request.BotConfig.SteamLogin = bot.BotConfig.SteamLogin; } - if (string.IsNullOrEmpty(request.BotConfig.SteamParentalPIN) && !string.IsNullOrEmpty(bot.BotConfig.SteamParentalPIN)) { - request.BotConfig.SteamParentalPIN = bot.BotConfig.SteamParentalPIN; + if (!request.BotConfig.IsSteamPasswordSet && bot.BotConfig.IsSteamPasswordSet) { + request.BotConfig.DecryptedSteamPassword = bot.BotConfig.DecryptedSteamPassword; } - if (string.IsNullOrEmpty(request.BotConfig.OriginalSteamPassword) && !string.IsNullOrEmpty(bot.BotConfig.OriginalSteamPassword)) { - request.BotConfig.OriginalSteamPassword = bot.BotConfig.OriginalSteamPassword; + if (!request.BotConfig.IsSteamParentalCodeSet && bot.BotConfig.IsSteamParentalCodeSet) { + request.BotConfig.SteamParentalCode = bot.BotConfig.SteamParentalCode; } } diff --git a/ArchiSteamFarm/IPC/Requests/ASFRequest.cs b/ArchiSteamFarm/IPC/Requests/ASFRequest.cs index a03e9e4e7..48590a9ed 100644 --- a/ArchiSteamFarm/IPC/Requests/ASFRequest.cs +++ b/ArchiSteamFarm/IPC/Requests/ASFRequest.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; namespace ArchiSteamFarm.IPC.Requests { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] - public sealed class ASFRequest : SensitiveDetailsRequest { + public sealed class ASFRequest { [JsonProperty(Required = Required.Always)] internal readonly GlobalConfig GlobalConfig; diff --git a/ArchiSteamFarm/IPC/Requests/BotRequest.cs b/ArchiSteamFarm/IPC/Requests/BotRequest.cs index ba62ef41a..0958815d5 100644 --- a/ArchiSteamFarm/IPC/Requests/BotRequest.cs +++ b/ArchiSteamFarm/IPC/Requests/BotRequest.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; namespace ArchiSteamFarm.IPC.Requests { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] - public sealed class BotRequest : SensitiveDetailsRequest { + public sealed class BotRequest { [JsonProperty(Required = Required.Always)] internal readonly BotConfig BotConfig; diff --git a/ArchiSteamFarm/IPC/Requests/SensitiveDetailsRequest.cs b/ArchiSteamFarm/IPC/Requests/SensitiveDetailsRequest.cs deleted file mode 100644 index 7591002eb..000000000 --- a/ArchiSteamFarm/IPC/Requests/SensitiveDetailsRequest.cs +++ /dev/null @@ -1,29 +0,0 @@ -// _ _ _ ____ _ _____ -// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ -// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ -// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | -// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| -// -// Copyright 2015-2018 Łukasz "JustArchi" Domeradzki -// Contact: JustArchi@JustArchi.net -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Newtonsoft.Json; - -namespace ArchiSteamFarm.IPC.Requests { - public abstract class SensitiveDetailsRequest { - [JsonProperty(Required = Required.DisallowNull)] - internal readonly bool KeepSensitiveDetails = true; - } -} diff --git a/ArchiSteamFarm/Localization/Strings.Designer.cs b/ArchiSteamFarm/Localization/Strings.Designer.cs index eba9a490a..e6989535d 100644 --- a/ArchiSteamFarm/Localization/Strings.Designer.cs +++ b/ArchiSteamFarm/Localization/Strings.Designer.cs @@ -1343,11 +1343,11 @@ namespace ArchiSteamFarm.Localization { } /// - /// Wyszukuje zlokalizowany ciąg podobny do ciągu Please enter Steam parental PIN: . + /// Wyszukuje zlokalizowany ciąg podobny do ciągu Please enter Steam parental code: . /// - internal static string UserInputSteamParentalPIN { + internal static string UserInputSteamParentalCode { get { - return ResourceManager.GetString("UserInputSteamParentalPIN", resourceCulture); + return ResourceManager.GetString("UserInputSteamParentalCode", resourceCulture); } } diff --git a/ArchiSteamFarm/Localization/Strings.resx b/ArchiSteamFarm/Localization/Strings.resx index 13fbb008f..9d40bd02a 100644 --- a/ArchiSteamFarm/Localization/Strings.resx +++ b/ArchiSteamFarm/Localization/Strings.resx @@ -264,8 +264,8 @@ StackTrace: Please enter your Steam login: Please note that this translation should end with space - - Please enter Steam parental PIN: + + Please enter Steam parental code: Please note that this translation should end with space diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index b34c6eef9..5b9e24e58 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -98,8 +98,8 @@ namespace ArchiSteamFarm { Console.Write(Bot.FormatBotResponse(Strings.UserInputSteamGuard, botName)); result = Console.ReadLine(); break; - case ASF.EUserInputType.SteamParentalPIN: - Console.Write(Bot.FormatBotResponse(Strings.UserInputSteamParentalPIN, botName)); + case ASF.EUserInputType.SteamParentalCode: + Console.Write(Bot.FormatBotResponse(Strings.UserInputSteamParentalCode, botName)); result = Utilities.ReadLineMasked(); break; case ASF.EUserInputType.TwoFactorAuthentication: diff --git a/ArchiSteamFarm/config/example.json b/ArchiSteamFarm/config/example.json index 32148f1d1..4e4df20a3 100644 --- a/ArchiSteamFarm/config/example.json +++ b/ArchiSteamFarm/config/example.json @@ -27,7 +27,7 @@ "ShutdownOnFarmingFinished": false, "SteamLogin": null, "SteamMasterClanID": 0, - "SteamParentalPIN": "0", + "SteamParentalCode": null, "SteamPassword": null, "SteamTradeToken": null, "SteamUserPermissions": {},