mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Record input from the user in the logs as well
This commit is contained in:
@@ -792,4 +792,8 @@ Process uptime: {1}</value>
|
||||
<data name="CustomPluginUpdatesEnabled" xml:space="preserve">
|
||||
<value>Custom plugins have been registered for automatic updates. ASF team would like to remind you that, for your own safety, you should enable automatic updates only from trusted parties. If you didn't intend to do this, you can disable plugin updates in ASF global config.</value>
|
||||
</data>
|
||||
<data name="Input" xml:space="preserve">
|
||||
<value>Input: {0}</value>
|
||||
<comment>{0} will be replaced by text input from the user.</comment>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -106,6 +106,8 @@ internal static class Logging {
|
||||
Console.Write(cryptKeyText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.DeviceConfirmation:
|
||||
string deviceConfirmationText = Bot.FormatBotResponse(Strings.UserInputDeviceConfirmation, botName);
|
||||
@@ -116,6 +118,8 @@ internal static class Logging {
|
||||
Console.Write(deviceConfirmationText);
|
||||
result = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result));
|
||||
|
||||
if (string.IsNullOrEmpty(result) || result.Equals("Y", StringComparison.OrdinalIgnoreCase) || result.Equals("N", StringComparison.OrdinalIgnoreCase)) {
|
||||
break;
|
||||
}
|
||||
@@ -130,6 +134,8 @@ internal static class Logging {
|
||||
Console.Write(loginText);
|
||||
result = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.Password:
|
||||
string passwordText = Bot.FormatBotResponse(Strings.UserInputSteamPassword, botName);
|
||||
@@ -139,6 +145,8 @@ internal static class Logging {
|
||||
Console.Write(passwordText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamGuard:
|
||||
string steamGuardText = Bot.FormatBotResponse(Strings.UserInputSteamGuard, botName);
|
||||
@@ -148,6 +156,8 @@ internal static class Logging {
|
||||
Console.Write(steamGuardText);
|
||||
result = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamParentalCode:
|
||||
string steamParentalCodeText = Bot.FormatBotResponse(Strings.UserInputSteamParentalCode, botName);
|
||||
@@ -157,6 +167,8 @@ internal static class Logging {
|
||||
Console.Write(steamParentalCodeText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.TwoFactorAuthentication:
|
||||
string twoFactorAuthenticationText = Bot.FormatBotResponse(Strings.UserInputSteam2FA, botName);
|
||||
@@ -166,6 +178,8 @@ internal static class Logging {
|
||||
Console.Write(twoFactorAuthenticationText);
|
||||
result = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result));
|
||||
|
||||
break;
|
||||
default:
|
||||
ASF.ArchiLogger.LogGenericError(Strings.FormatWarningUnknownValuePleaseReport(nameof(userInputType), userInputType));
|
||||
@@ -423,6 +437,8 @@ internal static class Logging {
|
||||
Console.Write(enterCommandText);
|
||||
string? command = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(command));
|
||||
|
||||
if (string.IsNullOrEmpty(command)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user