This commit is contained in:
JustArchi
2016-11-09 09:26:07 +01:00
parent 7b9ab23a63
commit 7cec546749
6 changed files with 34 additions and 34 deletions

View File

@@ -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<Bot, DateTime> LastWriteTimes = new ConcurrentDictionary<Bot, DateTime>();

View File

@@ -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;

View File

@@ -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:

View File

@@ -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";

View File

@@ -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;
}

View File

@@ -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
}