mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Closes #1513
This commit is contained in:
@@ -820,12 +820,8 @@ namespace ArchiSteamFarm {
|
||||
return true;
|
||||
}
|
||||
|
||||
internal enum EFileType : byte {
|
||||
Config,
|
||||
Database
|
||||
}
|
||||
|
||||
internal enum EUserInputType : byte {
|
||||
[PublicAPI]
|
||||
public enum EUserInputType : byte {
|
||||
Unknown,
|
||||
DeviceID,
|
||||
Login,
|
||||
@@ -834,5 +830,10 @@ namespace ArchiSteamFarm {
|
||||
SteamParentalCode,
|
||||
TwoFactorAuthentication
|
||||
}
|
||||
|
||||
internal enum EFileType : byte {
|
||||
Config,
|
||||
Database
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,6 +453,51 @@ namespace ArchiSteamFarm {
|
||||
};
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public void SetUserInput(ASF.EUserInputType inputType, string inputValue) {
|
||||
if ((inputType == ASF.EUserInputType.Unknown) || !Enum.IsDefined(typeof(ASF.EUserInputType), inputValue) || string.IsNullOrEmpty(inputValue)) {
|
||||
ArchiLogger.LogNullError(nameof(inputType) + " || " + nameof(inputValue));
|
||||
}
|
||||
|
||||
// This switch should cover ONLY bot properties
|
||||
switch (inputType) {
|
||||
case ASF.EUserInputType.DeviceID:
|
||||
DeviceID = inputValue;
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.Login:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.SteamLogin = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.Password:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.DecryptedSteamPassword = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamGuard:
|
||||
AuthCode = inputValue;
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamParentalCode:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.SteamParentalCode = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.TwoFactorAuthentication:
|
||||
TwoFactorCode = inputValue;
|
||||
|
||||
break;
|
||||
default:
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningUnknownValuePleaseReport, nameof(inputType), inputType));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal void AddGamesToRedeemInBackground(IOrderedDictionary gamesToRedeemInBackground) {
|
||||
if ((gamesToRedeemInBackground == null) || (gamesToRedeemInBackground.Count == 0)) {
|
||||
ArchiLogger.LogNullError(nameof(gamesToRedeemInBackground));
|
||||
@@ -1354,50 +1399,6 @@ namespace ArchiSteamFarm {
|
||||
return await ArchiHandler.SendTypingStatus(steamID).ConfigureAwait(false) == EResult.OK;
|
||||
}
|
||||
|
||||
internal void SetUserInput(ASF.EUserInputType inputType, string inputValue) {
|
||||
if ((inputType == ASF.EUserInputType.Unknown) || string.IsNullOrEmpty(inputValue)) {
|
||||
ArchiLogger.LogNullError(nameof(inputType) + " || " + nameof(inputValue));
|
||||
}
|
||||
|
||||
// This switch should cover ONLY bot properties
|
||||
switch (inputType) {
|
||||
case ASF.EUserInputType.DeviceID:
|
||||
DeviceID = inputValue;
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.Login:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.SteamLogin = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.Password:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.DecryptedSteamPassword = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamGuard:
|
||||
AuthCode = inputValue;
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamParentalCode:
|
||||
if (BotConfig != null) {
|
||||
BotConfig.SteamParentalCode = inputValue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.TwoFactorAuthentication:
|
||||
TwoFactorCode = inputValue;
|
||||
|
||||
break;
|
||||
default:
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningUnknownValuePleaseReport, nameof(inputType), inputType));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task Start() {
|
||||
if (KeepRunning) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user