Skip to content

Commit

Permalink
Misc correction
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Jul 20, 2019
1 parent 767471b commit 248f940
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ArchiSteamFarm/ArchiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ public sealed class ArchiHandler : ClientMsgHandler {
return (false, null);
}

if ((steamParentalCode != null) && (steamParentalCode.Length > 4)) {
if ((steamParentalCode != null) && (steamParentalCode.Length == BotConfig.SteamParentalCodeLength)) {
byte i = 0;
byte[] password = new byte[steamParentalCode.Length];

Expand Down
2 changes: 1 addition & 1 deletion ArchiSteamFarm/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,7 @@ public sealed class Bot : IDisposable {
} else {
string steamParentalCode = await Logging.GetUserInput(ASF.EUserInputType.SteamParentalCode, BotName).ConfigureAwait(false);

if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != 4)) {
if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != BotConfig.SteamParentalCodeLength)) {
Stop();

break;
Expand Down
4 changes: 3 additions & 1 deletion ArchiSteamFarm/BotConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
namespace ArchiSteamFarm {
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
public sealed class BotConfig {
internal const byte SteamParentalCodeLength = 4;

private const bool DefaultAcceptGifts = false;
private const bool DefaultAutoSteamSaleEvent = false;
private const EBotBehaviour DefaultBotBehaviour = EBotBehaviour.None;
Expand Down Expand Up @@ -283,7 +285,7 @@ public sealed class BotConfig {
return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(SteamMasterClanID), SteamMasterClanID));
}

if (!string.IsNullOrEmpty(SteamParentalCode) && (SteamParentalCode != "0") && (SteamParentalCode.Length != 4)) {
if (!string.IsNullOrEmpty(SteamParentalCode) && (SteamParentalCode != "0") && (SteamParentalCode.Length != SteamParentalCodeLength)) {
return (false, string.Format(Strings.ErrorConfigPropertyInvalid, nameof(SteamParentalCode), SteamParentalCode));
}

Expand Down

0 comments on commit 248f940

Please sign in to comment.