Localizing...

This commit is contained in:
JustArchi
2017-01-06 16:29:34 +01:00
parent 60aa101a5c
commit dd8c1a79e4
11 changed files with 326 additions and 90 deletions

View File

@@ -269,7 +269,7 @@ namespace ArchiSteamFarm {
}
if (botName.Equals(SharedInfo.ASF)) {
Program.ArchiLogger.LogGenericWarning(Strings.GlobalConfigChanged);
Program.ArchiLogger.LogGenericInfo(Strings.GlobalConfigChanged);
await RestartOrExit().ConfigureAwait(false);
return;
}
@@ -335,7 +335,7 @@ namespace ArchiSteamFarm {
}
if (botName.Equals(SharedInfo.ASF)) {
Program.ArchiLogger.LogGenericError(Strings.GlobalConfigRemoved);
Program.ArchiLogger.LogGenericError(Strings.ErrorGlobalConfigRemoved);
Program.Exit(1);
return;
}
@@ -358,7 +358,7 @@ namespace ArchiSteamFarm {
}
if (oldBotName.Equals(SharedInfo.ASF)) {
Program.ArchiLogger.LogGenericError(Strings.GlobalConfigRemoved);
Program.ArchiLogger.LogGenericError(Strings.ErrorGlobalConfigRemoved);
Program.Exit(1);
return;
}
@@ -401,11 +401,8 @@ namespace ArchiSteamFarm {
DeviceID,
Login,
Password,
PhoneNumber,
SMS,
SteamGuard,
SteamParentalPIN,
RevocationCode,
TwoFactorAuthentication,
WCFHostname
}

View File

@@ -1133,7 +1133,7 @@ namespace ArchiSteamFarm {
bool result = await WebBrowser.UrlPostRetry(request, data, SteamCommunityURL).ConfigureAwait(false);
if (!result) {
Bot.ArchiLogger.LogGenericInfo(Strings.Failed);
Bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed);
return false;
}

View File

@@ -28,6 +28,7 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using ArchiSteamFarm.JSON;
using ArchiSteamFarm.Localization;
using Newtonsoft.Json;
namespace ArchiSteamFarm {
@@ -160,7 +161,7 @@ namespace ArchiSteamFarm {
return botConfig;
}
Program.ArchiLogger.LogGenericWarning("Playing more than " + ArchiHandler.MaxGamesPlayedConcurrently + " games concurrently is not possible, only first " + ArchiHandler.MaxGamesPlayedConcurrently + " entries from GamesPlayedWhileIdle will be used");
Program.ArchiLogger.LogGenericWarning(string.Join(Strings.WarningTooManyGamesToPlay, ArchiHandler.MaxGamesPlayedConcurrently, nameof(botConfig.GamesPlayedWhileIdle)));
HashSet<uint> validGames = new HashSet<uint>(botConfig.GamesPlayedWhileIdle.Take(ArchiHandler.MaxGamesPlayedConcurrently));
botConfig.GamesPlayedWhileIdle.IntersectWith(validGames);

View File

@@ -24,6 +24,7 @@
using System.Linq;
using System.Threading.Tasks;
using ArchiSteamFarm.Localization;
using SteamKit2;
namespace ArchiSteamFarm {
@@ -33,9 +34,9 @@ namespace ArchiSteamFarm {
return;
}
Program.ArchiLogger.LogGenericInfo("No bots are running, exiting");
Program.ArchiLogger.LogGenericInfo(Strings.NoBotsAreRunning);
await Task.Delay(5000).ConfigureAwait(false);
Program.Shutdown();
Program.Exit();
}
internal static void OnPersonaState(Bot bot, SteamFriends.PersonaStateCallback callback) { }

View File

@@ -27,6 +27,7 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Sockets;
using ArchiSteamFarm.Localization;
using Newtonsoft.Json;
namespace ArchiSteamFarm {
@@ -135,24 +136,24 @@ namespace ArchiSteamFarm {
case ProtocolType.Udp:
break;
default:
Program.ArchiLogger.LogGenericWarning("Configured SteamProtocol is invalid: " + globalConfig.SteamProtocol);
Program.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.SteamProtocol), globalConfig.SteamProtocol));
return null;
}
// User might not know what he's doing
// Ensure that he can't screw core ASF variables
if (globalConfig.MaxFarmingTime == 0) {
Program.ArchiLogger.LogGenericWarning("Configured MaxFarmingTime is invalid: " + globalConfig.MaxFarmingTime);
Program.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.MaxFarmingTime), globalConfig.MaxFarmingTime));
return null;
}
if (globalConfig.FarmingDelay == 0) {
Program.ArchiLogger.LogGenericWarning("Configured FarmingDelay is invalid: " + globalConfig.FarmingDelay);
Program.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.FarmingDelay), globalConfig.FarmingDelay));
return null;
}
if (globalConfig.HttpTimeout == 0) {
Program.ArchiLogger.LogGenericWarning("Configured HttpTimeout is invalid: " + globalConfig.HttpTimeout);
Program.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.HttpTimeout), globalConfig.HttpTimeout));
return null;
}
@@ -160,7 +161,7 @@ namespace ArchiSteamFarm {
return globalConfig;
}
Program.ArchiLogger.LogGenericWarning("Configured WCFPort is invalid: " + globalConfig.WCFPort);
Program.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.WCFPort), globalConfig.WCFPort));
return null;
}

View File

@@ -88,6 +88,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Configured {0} property is invalid: {1}.
/// </summary>
internal static string ErrorConfigPropertyInvalid {
get {
return ResourceManager.GetString("ErrorConfigPropertyInvalid", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ASF V{0} has run into fatal exception before core logging module was even able to initialize!.
/// </summary>
@@ -126,6 +135,33 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Global config could not be loaded, please make sure that {0} exists and is valid! Follow setting up guide on the wiki if you&apos;re confused..
/// </summary>
internal static string ErrorGlobalConfigNotLoaded {
get {
return ResourceManager.GetString("ErrorGlobalConfigNotLoaded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Global config file has been removed!.
/// </summary>
internal static string ErrorGlobalConfigRemoved {
get {
return ResourceManager.GetString("ErrorGlobalConfigRemoved", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Global database could not be loaded, if issue persists, please remove {0} in order to recreate database!.
/// </summary>
internal static string ErrorGlobalDatabaseNotLoaded {
get {
return ResourceManager.GetString("ErrorGlobalDatabaseNotLoaded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} is invalid!.
/// </summary>
@@ -135,6 +171,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Refusing to execute this function due to invalid DeviceID in ASF 2FA!.
/// </summary>
internal static string ErrorMobileAuthenticatorInvalidDeviceID {
get {
return ResourceManager.GetString("ErrorMobileAuthenticatorInvalidDeviceID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No bots are defined, did you forget to configure your ASF?.
/// </summary>
@@ -207,6 +252,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Received a request for user input, but process is running in headless mode!.
/// </summary>
internal static string ErrorUserInputRunningInHeadlessMode {
get {
return ResourceManager.GetString("ErrorUserInputRunningInHeadlessMode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Refusing to handle the request because SteamOwnerID is not set!.
/// </summary>
@@ -216,6 +270,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to WCF service could not be started because of AddressAccessDeniedException! If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions!.
/// </summary>
internal static string ErrorWCFAddressAccessDeniedException {
get {
return ResourceManager.GetString("ErrorWCFAddressAccessDeniedException", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Exiting....
/// </summary>
@@ -225,15 +288,6 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Failed!.
/// </summary>
internal static string Failed {
get {
return ResourceManager.GetString("Failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Global config file has been changed!.
/// </summary>
@@ -243,15 +297,6 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Global config file has been removed!.
/// </summary>
internal static string GlobalConfigRemoved {
get {
return ResourceManager.GetString("GlobalConfigRemoved", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ignoring trade: {0}.
/// </summary>
@@ -270,6 +315,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to No bots are running, exiting....
/// </summary>
internal static string NoBotsAreRunning {
get {
return ResourceManager.GetString("NoBotsAreRunning", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Refreshing our session!.
/// </summary>
@@ -315,15 +369,6 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Your {0} runtime version is too old!.
/// </summary>
internal static string RuntimeVersionTooOld {
get {
return ResourceManager.GetString("RuntimeVersionTooOld", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Starting....
/// </summary>
@@ -478,11 +523,128 @@ namespace ArchiSteamFarm.Localization {
}
/// <summary>
/// Looks up a localized string similar to WCF service could not be started because of AddressAccessDeniedException! If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions!.
/// Looks up a localized string similar to &lt;{0}&gt; Please enter your Device ID (including &quot;android:&quot;): .
/// </summary>
internal static string WCFAddressAccessDeniedException {
internal static string UserInputDeviceID {
get {
return ResourceManager.GetString("WCFAddressAccessDeniedException", resourceCulture);
return ResourceManager.GetString("UserInputDeviceID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter your 2FA code from your Steam authenticator app: .
/// </summary>
internal static string UserInputSteam2FA {
get {
return ResourceManager.GetString("UserInputSteam2FA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter SteamGuard auth code that was sent on your e-mail: .
/// </summary>
internal static string UserInputSteamGuard {
get {
return ResourceManager.GetString("UserInputSteamGuard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter your Steam login: .
/// </summary>
internal static string UserInputSteamLogin {
get {
return ResourceManager.GetString("UserInputSteamLogin", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter Steam parental PIN: .
/// </summary>
internal static string UserInputSteamParentalPIN {
get {
return ResourceManager.GetString("UserInputSteamParentalPIN", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter your Steam password: .
/// </summary>
internal static string UserInputSteamPassword {
get {
return ResourceManager.GetString("UserInputSteamPassword", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter undocumented value of {1}: .
/// </summary>
internal static string UserInputUnknown {
get {
return ResourceManager.GetString("UserInputUnknown", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;{0}&gt; Please enter your WCF host: .
/// </summary>
internal static string UserInputWCFHost {
get {
return ResourceManager.GetString("UserInputWCFHost", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Failed!.
/// </summary>
internal static string WarningFailed {
get {
return ResourceManager.GetString("WarningFailed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Received unknown confirmation type, please report this: {0}.
/// </summary>
internal static string WarningMobileAuthenticatorUnknownConfirmationType {
get {
return ResourceManager.GetString("WarningMobileAuthenticatorUnknownConfirmationType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ASF detected unsupported runtime version, program might NOT run correctly in current environment. You&apos;re running it at your own risk without support!.
/// </summary>
internal static string WarningRuntimeUnsupported {
get {
return ResourceManager.GetString("WarningRuntimeUnsupported", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your {0} runtime version is too old!.
/// </summary>
internal static string WarningRuntimeVersionTooOld {
get {
return ResourceManager.GetString("WarningRuntimeVersionTooOld", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Playing more than {0} games concurrently is not possible, only first {0} entries from {1} will be used!.
/// </summary>
internal static string WarningTooManyGamesToPlay {
get {
return ResourceManager.GetString("WarningTooManyGamesToPlay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ignoring WCF command because --client wasn&apos;t specified: {0}.
/// </summary>
internal static string WarningWCFIgnoringCommand {
get {
return ResourceManager.GetString("WarningWCFIgnoringCommand", resourceCulture);
}
}
@@ -504,6 +666,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to WCF response received: {0}.
/// </summary>
internal static string WCFResponseReceived {
get {
return ResourceManager.GetString("WCFResponseReceived", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sending command: {0} to WCF server on {1}....
/// </summary>

View File

@@ -130,6 +130,10 @@
{0}</value>
<comment>{0} will be replaced by content string. Please note that this string should include newline for formatting.</comment>
</data>
<data name="ErrorConfigPropertyInvalid" xml:space="preserve">
<value>Configured {0} property is invalid: {1}</value>
<comment>{0} will be replaced by name of the configuration property, {1} will be replaced by invalid value</comment>
</data>
<data name="ErrorEarlyFatalExceptionInfo" xml:space="preserve">
<value>ASF V{0} has run into fatal exception before core logging module was even able to initialize!</value>
<comment>{0} will be replaced by version number</comment>
@@ -147,10 +151,21 @@ StackTrace:
<value>Request failing: {0}</value>
<comment>{0} will be replaced by URL of the request</comment>
</data>
<data name="ErrorGlobalConfigNotLoaded" xml:space="preserve">
<value>Global config could not be loaded, please make sure that {0} exists and is valid! Follow setting up guide on the wiki if you're confused.</value>
<comment>{0} will be replaced by file's path</comment>
</data>
<data name="ErrorGlobalDatabaseNotLoaded" xml:space="preserve">
<value>Global database could not be loaded, if issue persists, please remove {0} in order to recreate database!</value>
<comment>{0} will be replaced by file's path</comment>
</data>
<data name="ErrorIsInvalid" xml:space="preserve">
<value>{0} is invalid!</value>
<comment>{0} will be replaced by object's name</comment>
</data>
<data name="ErrorMobileAuthenticatorInvalidDeviceID" xml:space="preserve">
<value>Refusing to execute this function due to invalid DeviceID in ASF 2FA!</value>
</data>
<data name="ErrorNoBotsDefined" xml:space="preserve">
<value>No bots are defined, did you forget to configure your ASF?</value>
</data>
@@ -164,7 +179,7 @@ StackTrace:
</data>
<data name="ErrorRemovingOldBinary" xml:space="preserve">
<value>Could not remove old ASF binary, please remove {0} manually in order for update function to work!</value>
<comment>{0} will be replaced by binary's name</comment>
<comment>{0} will be replaced by file's path</comment>
</data>
<data name="ErrorRequestFailedTooManyTimes" xml:space="preserve">
<value>Request failed despite of {0} tries!</value>
@@ -179,19 +194,22 @@ StackTrace:
<data name="ErrorUpdateNoAssets" xml:space="preserve">
<value>Could not proceed with an update because that version doesn't include any assets!</value>
</data>
<data name="ErrorUserInputRunningInHeadlessMode" xml:space="preserve">
<value>Received a request for user input, but process is running in headless mode!</value>
</data>
<data name="ErrorWCFAccessDenied" xml:space="preserve">
<value>Refusing to handle the request because SteamOwnerID is not set!</value>
</data>
<data name="Exiting" xml:space="preserve">
<value>Exiting...</value>
</data>
<data name="Failed" xml:space="preserve">
<data name="WarningFailed" xml:space="preserve">
<value>Failed!</value>
</data>
<data name="GlobalConfigChanged" xml:space="preserve">
<value>Global config file has been changed!</value>
</data>
<data name="GlobalConfigRemoved" xml:space="preserve">
<data name="ErrorGlobalConfigRemoved" xml:space="preserve">
<value>Global config file has been removed!</value>
</data>
<data name="IgnoringTrade" xml:space="preserve">
@@ -202,6 +220,9 @@ StackTrace:
<value>Logging in to {0}...</value>
<comment>{0} will be replaced by service's name</comment>
</data>
<data name="NoBotsAreRunning" xml:space="preserve">
<value>No bots are running, exiting...</value>
</data>
<data name="RefreshingOurSession" xml:space="preserve">
<value>Refreshing our session!</value>
</data>
@@ -212,6 +233,9 @@ StackTrace:
<data name="Restarting" xml:space="preserve">
<value>Restarting...</value>
</data>
<data name="WarningRuntimeUnsupported" xml:space="preserve">
<value>ASF detected unsupported runtime version, program might NOT run correctly in current environment. You're running it at your own risk without support!</value>
</data>
<data name="RuntimeVersionComparison" xml:space="preserve">
<value>Required version: {0} | Found version: {1}</value>
<comment>{0} will be replaced by required version, {1} will be replaced by current version</comment>
@@ -220,7 +244,7 @@ StackTrace:
<value>Your {0} runtime version is OK.</value>
<comment>{0} will be replaced by runtime name (e.g. "Mono")</comment>
</data>
<data name="RuntimeVersionTooOld" xml:space="preserve">
<data name="WarningRuntimeVersionTooOld" xml:space="preserve">
<value>Your {0} runtime version is too old!</value>
<comment>{0} will be replaced by runtime name (e.g. "Mono")</comment>
</data>
@@ -281,7 +305,51 @@ StackTrace:
<value>Local version: {0} | Remote version: {1}</value>
<comment>{0} will be replaced by current version, {1} will be replaced by remote version</comment>
</data>
<data name="WCFAddressAccessDeniedException" xml:space="preserve">
<data name="UserInputDeviceID" xml:space="preserve">
<value>&lt;{0}&gt; Please enter your Device ID (including "android:"): </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteam2FA" xml:space="preserve">
<value>&lt;{0}&gt; Please enter your 2FA code from your Steam authenticator app: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamGuard" xml:space="preserve">
<value>&lt;{0}&gt; Please enter SteamGuard auth code that was sent on your e-mail: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamLogin" xml:space="preserve">
<value>&lt;{0}&gt; Please enter your Steam login: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamParentalPIN" xml:space="preserve">
<value>&lt;{0}&gt; Please enter Steam parental PIN: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputSteamPassword" xml:space="preserve">
<value>&lt;{0}&gt; Please enter your Steam password: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputUnknown" xml:space="preserve">
<value>&lt;{0}&gt; Please enter undocumented value of {1}: </value>
<comment>{0} will be replaced by bot's name, {1} will be replaced by property name. Please note that this translation should end with space</comment>
</data>
<data name="UserInputWCFHost" xml:space="preserve">
<value>&lt;{0}&gt; Please enter your WCF host: </value>
<comment>{0} will be replaced by bot's name. Please note that this translation should end with space</comment>
</data>
<data name="WarningMobileAuthenticatorUnknownConfirmationType" xml:space="preserve">
<value>Received unknown confirmation type, please report this: {0}</value>
<comment>{0} will be replaced by unknown confirmation type</comment>
</data>
<data name="WarningTooManyGamesToPlay" xml:space="preserve">
<value>Playing more than {0} games concurrently is not possible, only first {0} entries from {1} will be used!</value>
<comment>{0} will be replaced by max number of games, {1} will be replaced by name of the configuration property</comment>
</data>
<data name="WarningWCFIgnoringCommand" xml:space="preserve">
<value>Ignoring WCF command because --client wasn't specified: {0}</value>
<comment>{0} will be replaced by WCF command</comment>
</data>
<data name="ErrorWCFAddressAccessDeniedException" xml:space="preserve">
<value>WCF service could not be started because of AddressAccessDeniedException! If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions!</value>
</data>
<data name="WCFAnswered" xml:space="preserve">
@@ -291,6 +359,10 @@ StackTrace:
<data name="WCFReady" xml:space="preserve">
<value>WCF server ready!</value>
</data>
<data name="WCFResponseReceived" xml:space="preserve">
<value>WCF response received: {0}</value>
<comment>{0} will be replaced by WCF response</comment>
</data>
<data name="WCFSendingCommand" xml:space="preserve">
<value>Sending command: {0} to WCF server on {1}...</value>
<comment>{0} will be replaced by WCF command, {1} will be replaced by WCF hostname</comment>

View File

@@ -30,6 +30,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using ArchiSteamFarm.JSON;
using ArchiSteamFarm.Localization;
using HtmlAgilityPack;
using Newtonsoft.Json;
@@ -84,7 +85,7 @@ namespace ArchiSteamFarm {
}
if (!HasCorrectDeviceID) {
Bot.ArchiLogger.LogGenericWarning("Can't execute properly due to invalid DeviceID!");
Bot.ArchiLogger.LogGenericError(Strings.ErrorMobileAuthenticatorInvalidDeviceID);
return null;
}
@@ -110,7 +111,7 @@ namespace ArchiSteamFarm {
internal async Task<HashSet<Confirmation>> GetConfirmations() {
if (!HasCorrectDeviceID) {
Bot.ArchiLogger.LogGenericWarning("Can't execute properly due to invalid DeviceID!");
Bot.ArchiLogger.LogGenericError(Strings.ErrorMobileAuthenticatorInvalidDeviceID);
return null;
}
@@ -174,7 +175,7 @@ namespace ArchiSteamFarm {
} else if (description.StartsWith("Trade with ", StringComparison.Ordinal)) {
type = Steam.ConfirmationDetails.EType.Trade;
} else {
Bot.ArchiLogger.LogGenericWarning("Received unknown confirmation type, please report this: " + description);
Bot.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningMobileAuthenticatorUnknownConfirmationType, description));
type = Steam.ConfirmationDetails.EType.Other;
}
@@ -191,7 +192,7 @@ namespace ArchiSteamFarm {
}
if (!HasCorrectDeviceID) {
Bot.ArchiLogger.LogGenericWarning("Can't execute properly due to invalid DeviceID!");
Bot.ArchiLogger.LogGenericError(Strings.ErrorMobileAuthenticatorInvalidDeviceID);
return false;
}

View File

@@ -60,13 +60,13 @@ namespace ArchiSteamFarm {
Environment.Exit(exitCode);
}
internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF, string extraInformation = null) {
internal static string GetUserInput(ASF.EUserInputType userInputType, string botName = SharedInfo.ASF) {
if (userInputType == ASF.EUserInputType.Unknown) {
return null;
}
if (GlobalConfig.Headless || !Runtime.IsUserInteractive) {
ArchiLogger.LogGenericWarning("Received a request for user input, but process is running in headless mode!");
ArchiLogger.LogGenericWarning(Strings.ErrorUserInputRunningInHeadlessMode);
return null;
}
@@ -75,38 +75,28 @@ namespace ArchiSteamFarm {
Logging.OnUserInputStart();
switch (userInputType) {
case ASF.EUserInputType.DeviceID:
Console.Write("<" + botName + "> Please enter your Device ID (including \"android:\"): ");
Console.Write(string.Join(Strings.UserInputDeviceID, botName));
break;
case ASF.EUserInputType.Login:
Console.Write("<" + botName + "> Please enter your login: ");
Console.Write(string.Join(Strings.UserInputSteamLogin, botName));
break;
case ASF.EUserInputType.Password:
Console.Write("<" + botName + "> Please enter your password: ");
break;
case ASF.EUserInputType.PhoneNumber:
Console.Write("<" + botName + "> Please enter your full phone number (e.g. +1234567890): ");
break;
case ASF.EUserInputType.SMS:
Console.Write("<" + botName + "> Please enter SMS code sent on your mobile: ");
Console.Write(string.Join(Strings.UserInputSteamPassword, botName));
break;
case ASF.EUserInputType.SteamGuard:
Console.Write("<" + botName + "> Please enter the auth code sent to your email: ");
Console.Write(string.Join(Strings.UserInputSteamGuard, botName));
break;
case ASF.EUserInputType.SteamParentalPIN:
Console.Write("<" + botName + "> Please enter steam parental PIN: ");
break;
case ASF.EUserInputType.RevocationCode:
Console.WriteLine("<" + botName + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation);
Console.Write("<" + botName + "> Hit enter once ready...");
Console.Write(string.Join(Strings.UserInputSteamParentalPIN, botName));
break;
case ASF.EUserInputType.TwoFactorAuthentication:
Console.Write("<" + botName + "> Please enter your 2 factor auth code from your authenticator app: ");
Console.Write(string.Join(Strings.UserInputSteam2FA, botName));
break;
case ASF.EUserInputType.WCFHostname:
Console.Write("<" + botName + "> Please enter your WCF host: ");
Console.Write(string.Join(Strings.UserInputWCFHost, botName));
break;
default:
Console.Write("<" + botName + "> Please enter not documented yet value of \"" + userInputType + "\": ");
Console.Write(string.Join(Strings.UserInputUnknown, botName, userInputType));
break;
}
@@ -137,14 +127,6 @@ namespace ArchiSteamFarm {
Environment.Exit(0);
}
internal static void Shutdown() {
if (!InitShutdownSequence()) {
return;
}
ShutdownResetEvent.Set();
}
private static async Task Init(string[] args) {
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;
@@ -179,7 +161,7 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericInfo("ASF V" + SharedInfo.Version);
if (!Runtime.IsRuntimeSupported) {
ArchiLogger.LogGenericError("ASF detected unsupported runtime version, program might NOT run correctly in current environment. You're running it at your own risk!");
ArchiLogger.LogGenericError(Strings.WarningRuntimeUnsupported);
Thread.Sleep(10000);
}
@@ -218,7 +200,7 @@ namespace ArchiSteamFarm {
GlobalConfig = GlobalConfig.Load(globalConfigFile);
if (GlobalConfig == null) {
ArchiLogger.LogGenericError("Global config could not be loaded, please make sure that " + globalConfigFile + " exists and is valid! Did you forget to read wiki?");
ArchiLogger.LogGenericError(string.Format(Strings.ErrorGlobalConfigNotLoaded, globalConfigFile));
Thread.Sleep(5000);
Exit(1);
}
@@ -227,7 +209,7 @@ namespace ArchiSteamFarm {
GlobalDatabase = GlobalDatabase.Load(globalDatabaseFile);
if (GlobalDatabase == null) {
ArchiLogger.LogGenericError("Global database could not be loaded, if issue persists, please remove " + globalDatabaseFile + " in order to recreate database!");
ArchiLogger.LogGenericError(string.Format(Strings.ErrorGlobalDatabaseNotLoaded, globalDatabaseFile));
Thread.Sleep(5000);
Exit(1);
}
@@ -301,11 +283,13 @@ namespace ArchiSteamFarm {
}
if (!Mode.HasFlag(EMode.Client)) {
ArchiLogger.LogGenericWarning("Ignoring command because --client wasn't specified: " + arg);
ArchiLogger.LogGenericWarning(string.Format(Strings.WarningWCFIgnoringCommand, arg));
break;
}
ArchiLogger.LogGenericInfo("Response received: " + WCF.SendCommand(arg));
string response = WCF.SendCommand(arg);
ArchiLogger.LogGenericInfo(string.Join(Strings.WCFResponseReceived, response));
break;
}
}
@@ -339,6 +323,14 @@ namespace ArchiSteamFarm {
}
}
private static void Shutdown() {
if (!InitShutdownSequence()) {
return;
}
ShutdownResetEvent.Set();
}
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
if (args?.ExceptionObject == null) {
ArchiLogger.LogNullError(nameof(args) + " || " + nameof(args.ExceptionObject));

View File

@@ -53,7 +53,7 @@ namespace ArchiSteamFarm {
return true;
}
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionTooOld, "Mono"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningRuntimeVersionTooOld, "Mono"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionComparison, minMonoVersion, monoVersion));
_IsRuntimeSupported = false;
return false;
@@ -74,7 +74,7 @@ namespace ArchiSteamFarm {
return true;
}
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionTooOld, ".NET"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.WarningRuntimeVersionTooOld, ".NET"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionComparison, minNetVersion, netVersion));
_IsRuntimeSupported = false;
return false;

View File

@@ -135,7 +135,7 @@ namespace ArchiSteamFarm {
Program.ArchiLogger.LogGenericInfo(Strings.WCFReady);
} catch (AddressAccessDeniedException) {
Program.ArchiLogger.LogGenericError(Strings.WCFAddressAccessDeniedException);
Program.ArchiLogger.LogGenericError(Strings.ErrorWCFAddressAccessDeniedException);
} catch (Exception e) {
Program.ArchiLogger.LogGenericException(e);
}