diff --git a/ArchiSteamFarm/ASF.cs b/ArchiSteamFarm/ASF.cs index 8e83d91b0..d5ee1b6e3 100644 --- a/ArchiSteamFarm/ASF.cs +++ b/ArchiSteamFarm/ASF.cs @@ -42,6 +42,20 @@ namespace ArchiSteamFarm { } } + internal enum EUserInputType : byte { + Unknown, + DeviceID, + Login, + Password, + PhoneNumber, + SMS, + SteamGuard, + SteamParentalPIN, + RevocationCode, + TwoFactorAuthentication, + WCFHostname + } + internal static readonly ArchiLogger ArchiLogger = new ArchiLogger(SharedInfo.ASF); private static readonly ConcurrentDictionary LastWriteTimes = new ConcurrentDictionary(); diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 3a033fc98..72be094a8 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -769,7 +769,7 @@ namespace ArchiSteamFarm { if (!BotDatabase.MobileAuthenticator.HasCorrectDeviceID) { ArchiLogger.LogGenericWarning("Your DeviceID is incorrect or doesn't exist"); - string deviceID = Program.GetUserInput(SharedInfo.EUserInputType.DeviceID, BotName); + string deviceID = Program.GetUserInput(ASF.EUserInputType.DeviceID, BotName); if (string.IsNullOrEmpty(deviceID)) { BotDatabase.MobileAuthenticator = null; return; @@ -1825,7 +1825,7 @@ namespace ArchiSteamFarm { private bool InitializeLoginAndPassword(bool requiresPassword) { if (string.IsNullOrEmpty(BotConfig.SteamLogin)) { - BotConfig.SteamLogin = Program.GetUserInput(SharedInfo.EUserInputType.Login, BotName); + BotConfig.SteamLogin = Program.GetUserInput(ASF.EUserInputType.Login, BotName); if (string.IsNullOrEmpty(BotConfig.SteamLogin)) { return false; } @@ -1835,7 +1835,7 @@ namespace ArchiSteamFarm { return true; } - BotConfig.SteamPassword = Program.GetUserInput(SharedInfo.EUserInputType.Password, BotName); + BotConfig.SteamPassword = Program.GetUserInput(ASF.EUserInputType.Password, BotName); return !string.IsNullOrEmpty(BotConfig.SteamPassword); } @@ -2199,7 +2199,7 @@ namespace ArchiSteamFarm { switch (callback.Result) { case EResult.AccountLogonDenied: - AuthCode = Program.GetUserInput(SharedInfo.EUserInputType.SteamGuard, BotName); + AuthCode = Program.GetUserInput(ASF.EUserInputType.SteamGuard, BotName); if (string.IsNullOrEmpty(AuthCode)) { Stop(); } @@ -2207,7 +2207,7 @@ namespace ArchiSteamFarm { break; case EResult.AccountLoginDeniedNeedTwoFactor: if (BotDatabase.MobileAuthenticator == null) { - TwoFactorCode = Program.GetUserInput(SharedInfo.EUserInputType.TwoFactorAuthentication, BotName); + TwoFactorCode = Program.GetUserInput(ASF.EUserInputType.TwoFactorAuthentication, BotName); if (string.IsNullOrEmpty(TwoFactorCode)) { Stop(); } @@ -2236,7 +2236,7 @@ namespace ArchiSteamFarm { } if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) { - BotConfig.SteamParentalPIN = Program.GetUserInput(SharedInfo.EUserInputType.SteamParentalPIN, BotName); + BotConfig.SteamParentalPIN = Program.GetUserInput(ASF.EUserInputType.SteamParentalPIN, BotName); if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) { Stop(); return; diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 5e7831c20..6871e50d4 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -74,8 +74,8 @@ namespace ArchiSteamFarm { Environment.Exit(0); } - internal static string GetUserInput(SharedInfo.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) { - if (userInputType == SharedInfo.EUserInputType.Unknown) { + internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) { + if (userInputType == ASF.EUserInputType.Unknown) { return null; } @@ -88,35 +88,35 @@ namespace ArchiSteamFarm { lock (ConsoleLock) { Logging.OnUserInputStart(); switch (userInputType) { - case SharedInfo.EUserInputType.DeviceID: + case ASF.EUserInputType.DeviceID: Console.Write("<" + botName + "> Please enter your Device ID (including \"android:\"): "); break; - case SharedInfo.EUserInputType.Login: + case ASF.EUserInputType.Login: Console.Write("<" + botName + "> Please enter your login: "); break; - case SharedInfo.EUserInputType.Password: + case ASF.EUserInputType.Password: Console.Write("<" + botName + "> Please enter your password: "); break; - case SharedInfo.EUserInputType.PhoneNumber: + case ASF.EUserInputType.PhoneNumber: Console.Write("<" + botName + "> Please enter your full phone number (e.g. +1234567890): "); break; - case SharedInfo.EUserInputType.SMS: + case ASF.EUserInputType.SMS: Console.Write("<" + botName + "> Please enter SMS code sent on your mobile: "); break; - case SharedInfo.EUserInputType.SteamGuard: + case ASF.EUserInputType.SteamGuard: Console.Write("<" + botName + "> Please enter the auth code sent to your email: "); break; - case SharedInfo.EUserInputType.SteamParentalPIN: + case ASF.EUserInputType.SteamParentalPIN: Console.Write("<" + botName + "> Please enter steam parental PIN: "); break; - case SharedInfo.EUserInputType.RevocationCode: + case ASF.EUserInputType.RevocationCode: Console.WriteLine("<" + botName + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation); Console.Write("<" + botName + "> Hit enter once ready..."); break; - case SharedInfo.EUserInputType.TwoFactorAuthentication: + case ASF.EUserInputType.TwoFactorAuthentication: Console.Write("<" + botName + "> Please enter your 2 factor auth code from your authenticator app: "); break; - case SharedInfo.EUserInputType.WCFHostname: + case ASF.EUserInputType.WCFHostname: Console.Write("<" + botName + "> Please enter your WCF hostname: "); break; default: diff --git a/ArchiSteamFarm/SharedInfo.cs b/ArchiSteamFarm/SharedInfo.cs index 16016fc11..2088138c5 100644 --- a/ArchiSteamFarm/SharedInfo.cs +++ b/ArchiSteamFarm/SharedInfo.cs @@ -27,20 +27,6 @@ using System.Reflection; namespace ArchiSteamFarm { internal static class SharedInfo { - internal enum EUserInputType : byte { - Unknown, - DeviceID, - Login, - Password, - PhoneNumber, - SMS, - SteamGuard, - SteamParentalPIN, - RevocationCode, - TwoFactorAuthentication, - WCFHostname - } - internal const string VersionNumber = "2.1.6.7"; internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016"; diff --git a/ArchiSteamFarm/WCF.cs b/ArchiSteamFarm/WCF.cs index 5a1e24821..191ee90f9 100644 --- a/ArchiSteamFarm/WCF.cs +++ b/ArchiSteamFarm/WCF.cs @@ -48,7 +48,7 @@ namespace ArchiSteamFarm { internal static void Init() { if (string.IsNullOrEmpty(Program.GlobalConfig.WCFHostname)) { - Program.GlobalConfig.WCFHostname = Program.GetUserInput(SharedInfo.EUserInputType.WCFHostname); + Program.GlobalConfig.WCFHostname = Program.GetUserInput(ASF.EUserInputType.WCFHostname); if (string.IsNullOrEmpty(Program.GlobalConfig.WCFHostname)) { return; } diff --git a/GUI/Program.cs b/GUI/Program.cs index 819be2964..4e4c9ca17 100644 --- a/GUI/Program.cs +++ b/GUI/Program.cs @@ -15,7 +15,7 @@ namespace ArchiSteamFarm { internal static GlobalDatabase GlobalDatabase { get; private set; } internal static WebBrowser WebBrowser { get; private set; } - internal static string GetUserInput(SharedInfo.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) { + internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) { return null; // TODO }