Make it possible to enter login/password on each startup

This commit is contained in:
JustArchi
2015-10-28 23:29:50 +01:00
parent a17682e4e2
commit abcded9287
3 changed files with 46 additions and 11 deletions

View File

@@ -183,9 +183,19 @@ namespace ArchiSteamFarm {
sentryHash = CryptoHelper.SHAHash(sentryFileContent);
}
string steamLogin = SteamLogin;
if (string.IsNullOrEmpty(steamLogin) || steamLogin.Equals("null")) {
steamLogin = Program.GetUserInput(BotName, Program.EUserInputType.Login);
}
string steamPassword = SteamPassword;
if (string.IsNullOrEmpty(steamPassword) || steamPassword.Equals("null")) {
steamPassword = Program.GetUserInput(BotName, Program.EUserInputType.Password);
}
SteamUser.LogOn(new SteamUser.LogOnDetails {
Username = SteamLogin,
Password = SteamPassword,
Username = steamLogin,
Password = steamPassword,
AuthCode = AuthCode,
TwoFactorCode = TwoFactorAuth,
SentryFileHash = sentryHash
@@ -284,10 +294,10 @@ namespace ArchiSteamFarm {
EResult result = callback.Result;
switch (result) {
case EResult.AccountLogonDenied:
AuthCode = Program.GetSteamGuardCode(SteamLogin, false);
AuthCode = Program.GetUserInput(SteamLogin, Program.EUserInputType.SteamGuard);
break;
case EResult.AccountLoginDeniedNeedTwoFactor:
TwoFactorAuth = Program.GetSteamGuardCode(SteamLogin, true);
TwoFactorAuth = Program.GetUserInput(SteamLogin, Program.EUserInputType.TwoFactorAuthentication);
break;
case EResult.OK:
Logging.LogGenericInfo(BotName, "Successfully logged on!");