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); internal static readonly ArchiLogger ArchiLogger = new ArchiLogger(SharedInfo.ASF);
private static readonly ConcurrentDictionary<Bot, DateTime> LastWriteTimes = new ConcurrentDictionary<Bot, DateTime>(); private static readonly ConcurrentDictionary<Bot, DateTime> LastWriteTimes = new ConcurrentDictionary<Bot, DateTime>();

View File

@@ -769,7 +769,7 @@ namespace ArchiSteamFarm {
if (!BotDatabase.MobileAuthenticator.HasCorrectDeviceID) { if (!BotDatabase.MobileAuthenticator.HasCorrectDeviceID) {
ArchiLogger.LogGenericWarning("Your DeviceID is incorrect or doesn't exist"); 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)) { if (string.IsNullOrEmpty(deviceID)) {
BotDatabase.MobileAuthenticator = null; BotDatabase.MobileAuthenticator = null;
return; return;
@@ -1825,7 +1825,7 @@ namespace ArchiSteamFarm {
private bool InitializeLoginAndPassword(bool requiresPassword) { private bool InitializeLoginAndPassword(bool requiresPassword) {
if (string.IsNullOrEmpty(BotConfig.SteamLogin)) { 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)) { if (string.IsNullOrEmpty(BotConfig.SteamLogin)) {
return false; return false;
} }
@@ -1835,7 +1835,7 @@ namespace ArchiSteamFarm {
return true; return true;
} }
BotConfig.SteamPassword = Program.GetUserInput(SharedInfo.EUserInputType.Password, BotName); BotConfig.SteamPassword = Program.GetUserInput(ASF.EUserInputType.Password, BotName);
return !string.IsNullOrEmpty(BotConfig.SteamPassword); return !string.IsNullOrEmpty(BotConfig.SteamPassword);
} }
@@ -2199,7 +2199,7 @@ namespace ArchiSteamFarm {
switch (callback.Result) { switch (callback.Result) {
case EResult.AccountLogonDenied: case EResult.AccountLogonDenied:
AuthCode = Program.GetUserInput(SharedInfo.EUserInputType.SteamGuard, BotName); AuthCode = Program.GetUserInput(ASF.EUserInputType.SteamGuard, BotName);
if (string.IsNullOrEmpty(AuthCode)) { if (string.IsNullOrEmpty(AuthCode)) {
Stop(); Stop();
} }
@@ -2207,7 +2207,7 @@ namespace ArchiSteamFarm {
break; break;
case EResult.AccountLoginDeniedNeedTwoFactor: case EResult.AccountLoginDeniedNeedTwoFactor:
if (BotDatabase.MobileAuthenticator == null) { if (BotDatabase.MobileAuthenticator == null) {
TwoFactorCode = Program.GetUserInput(SharedInfo.EUserInputType.TwoFactorAuthentication, BotName); TwoFactorCode = Program.GetUserInput(ASF.EUserInputType.TwoFactorAuthentication, BotName);
if (string.IsNullOrEmpty(TwoFactorCode)) { if (string.IsNullOrEmpty(TwoFactorCode)) {
Stop(); Stop();
} }
@@ -2236,7 +2236,7 @@ namespace ArchiSteamFarm {
} }
if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) { 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)) { if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) {
Stop(); Stop();
return; return;

View File

@@ -74,8 +74,8 @@ namespace ArchiSteamFarm {
Environment.Exit(0); Environment.Exit(0);
} }
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) {
if (userInputType == SharedInfo.EUserInputType.Unknown) { if (userInputType == ASF.EUserInputType.Unknown) {
return null; return null;
} }
@@ -88,35 +88,35 @@ namespace ArchiSteamFarm {
lock (ConsoleLock) { lock (ConsoleLock) {
Logging.OnUserInputStart(); Logging.OnUserInputStart();
switch (userInputType) { switch (userInputType) {
case SharedInfo.EUserInputType.DeviceID: case ASF.EUserInputType.DeviceID:
Console.Write("<" + botName + "> Please enter your Device ID (including \"android:\"): "); Console.Write("<" + botName + "> Please enter your Device ID (including \"android:\"): ");
break; break;
case SharedInfo.EUserInputType.Login: case ASF.EUserInputType.Login:
Console.Write("<" + botName + "> Please enter your login: "); Console.Write("<" + botName + "> Please enter your login: ");
break; break;
case SharedInfo.EUserInputType.Password: case ASF.EUserInputType.Password:
Console.Write("<" + botName + "> Please enter your password: "); Console.Write("<" + botName + "> Please enter your password: ");
break; break;
case SharedInfo.EUserInputType.PhoneNumber: case ASF.EUserInputType.PhoneNumber:
Console.Write("<" + botName + "> Please enter your full phone number (e.g. +1234567890): "); Console.Write("<" + botName + "> Please enter your full phone number (e.g. +1234567890): ");
break; break;
case SharedInfo.EUserInputType.SMS: case ASF.EUserInputType.SMS:
Console.Write("<" + botName + "> Please enter SMS code sent on your mobile: "); Console.Write("<" + botName + "> Please enter SMS code sent on your mobile: ");
break; break;
case SharedInfo.EUserInputType.SteamGuard: case ASF.EUserInputType.SteamGuard:
Console.Write("<" + botName + "> Please enter the auth code sent to your email: "); Console.Write("<" + botName + "> Please enter the auth code sent to your email: ");
break; break;
case SharedInfo.EUserInputType.SteamParentalPIN: case ASF.EUserInputType.SteamParentalPIN:
Console.Write("<" + botName + "> Please enter steam parental PIN: "); Console.Write("<" + botName + "> Please enter steam parental PIN: ");
break; break;
case SharedInfo.EUserInputType.RevocationCode: case ASF.EUserInputType.RevocationCode:
Console.WriteLine("<" + botName + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation); Console.WriteLine("<" + botName + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation);
Console.Write("<" + botName + "> Hit enter once ready..."); Console.Write("<" + botName + "> Hit enter once ready...");
break; break;
case SharedInfo.EUserInputType.TwoFactorAuthentication: case ASF.EUserInputType.TwoFactorAuthentication:
Console.Write("<" + botName + "> Please enter your 2 factor auth code from your authenticator app: "); Console.Write("<" + botName + "> Please enter your 2 factor auth code from your authenticator app: ");
break; break;
case SharedInfo.EUserInputType.WCFHostname: case ASF.EUserInputType.WCFHostname:
Console.Write("<" + botName + "> Please enter your WCF hostname: "); Console.Write("<" + botName + "> Please enter your WCF hostname: ");
break; break;
default: default:

View File

@@ -27,20 +27,6 @@ using System.Reflection;
namespace ArchiSteamFarm { namespace ArchiSteamFarm {
internal static class SharedInfo { 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 VersionNumber = "2.1.6.7";
internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016"; internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016";

View File

@@ -48,7 +48,7 @@ namespace ArchiSteamFarm {
internal static void Init() { internal static void Init() {
if (string.IsNullOrEmpty(Program.GlobalConfig.WCFHostname)) { 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)) { if (string.IsNullOrEmpty(Program.GlobalConfig.WCFHostname)) {
return; return;
} }

View File

@@ -15,7 +15,7 @@ namespace ArchiSteamFarm {
internal static GlobalDatabase GlobalDatabase { get; private set; } internal static GlobalDatabase GlobalDatabase { get; private set; }
internal static WebBrowser WebBrowser { 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 return null; // TODO
} }