Localizing...

This commit is contained in:
JustArchi
2017-01-06 15:32:12 +01:00
parent 72b78c9b61
commit 28e2cfbc7c
7 changed files with 363 additions and 70 deletions

View File

@@ -60,6 +60,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Accepting trade: {0}.
/// </summary>
internal static string AcceptingTrade {
get {
return ResourceManager.GetString("AcceptingTrade", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ASF will automatically check for new versions every {0} hours..
/// </summary>
@@ -69,6 +78,16 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Content:
///{0}.
/// </summary>
internal static string Content {
get {
return ResourceManager.GetString("Content", 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>
@@ -98,6 +117,24 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Request failing: {0}.
/// </summary>
internal static string ErrorFailingRequest {
get {
return ResourceManager.GetString("ErrorFailingRequest", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} is invalid!.
/// </summary>
internal static string ErrorIsInvalid {
get {
return ResourceManager.GetString("ErrorIsInvalid", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No bots are defined, did you forget to configure your ASF?.
/// </summary>
@@ -170,6 +207,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Refusing to handle the request because SteamOwnerID is not set!.
/// </summary>
internal static string ErrorWCFAccessDenied {
get {
return ResourceManager.GetString("ErrorWCFAccessDenied", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Exiting....
/// </summary>
@@ -206,6 +252,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Ignoring trade: {0}.
/// </summary>
internal static string IgnoringTrade {
get {
return ResourceManager.GetString("IgnoringTrade", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Logging in to {0}....
/// </summary>
@@ -224,6 +279,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Rejecting trade: {0}.
/// </summary>
internal static string RejectingTrade {
get {
return ResourceManager.GetString("RejectingTrade", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Restarting....
/// </summary>
@@ -233,6 +297,33 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Required version: {0} | Found version: {1}.
/// </summary>
internal static string RuntimeVersionComparison {
get {
return ResourceManager.GetString("RuntimeVersionComparison", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Your {0} runtime version is OK..
/// </summary>
internal static string RuntimeVersionOK {
get {
return ResourceManager.GetString("RuntimeVersionOK", resourceCulture);
}
}
/// <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>
@@ -242,6 +333,15 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to Status code: {0}.
/// </summary>
internal static string StatusCode {
get {
return ResourceManager.GetString("StatusCode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Success!.
/// </summary>
@@ -251,6 +351,78 @@ namespace ArchiSteamFarm.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to 1 day.
/// </summary>
internal static string TimeSpanDay {
get {
return ResourceManager.GetString("TimeSpanDay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} days.
/// </summary>
internal static string TimeSpanDays {
get {
return ResourceManager.GetString("TimeSpanDays", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 1 hour.
/// </summary>
internal static string TimeSpanHour {
get {
return ResourceManager.GetString("TimeSpanHour", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} hours.
/// </summary>
internal static string TimeSpanHours {
get {
return ResourceManager.GetString("TimeSpanHours", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 1 minute.
/// </summary>
internal static string TimeSpanMinute {
get {
return ResourceManager.GetString("TimeSpanMinute", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} minutes.
/// </summary>
internal static string TimeSpanMinutes {
get {
return ResourceManager.GetString("TimeSpanMinutes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 1 second.
/// </summary>
internal static string TimeSpanSecond {
get {
return ResourceManager.GetString("TimeSpanSecond", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} seconds.
/// </summary>
internal static string TimeSpanSeconds {
get {
return ResourceManager.GetString("TimeSpanSeconds", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unlocking parental account....
/// </summary>
@@ -304,5 +476,50 @@ namespace ArchiSteamFarm.Localization {
return ResourceManager.GetString("UpdateVersionInfo", resourceCulture);
}
}
/// <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 WCFAddressAccessDeniedException {
get {
return ResourceManager.GetString("WCFAddressAccessDeniedException", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Answered to WCF command: {0} with: {1}.
/// </summary>
internal static string WCFAnswered {
get {
return ResourceManager.GetString("WCFAnswered", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to WCF server ready!.
/// </summary>
internal static string WCFReady {
get {
return ResourceManager.GetString("WCFReady", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sending command: {0} to WCF server on {1}....
/// </summary>
internal static string WCFSendingCommand {
get {
return ResourceManager.GetString("WCFSendingCommand", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Starting WCF server on {0}....
/// </summary>
internal static string WCFStarting {
get {
return ResourceManager.GetString("WCFStarting", resourceCulture);
}
}
}
}

View File

@@ -117,10 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AcceptingTrade" xml:space="preserve">
<value>Accepting trade: {0}</value>
<comment>{0} will be replaced by trade number</comment>
</data>
<data name="AutoUpdateCheckInfo" xml:space="preserve">
<value>ASF will automatically check for new versions every {0} hours.</value>
<comment>{0} will be replaced by number of hours</comment>
</data>
<data name="Content" xml:space="preserve">
<value>Content:
{0}</value>
<comment>{0} will be replaced by content string. Please note that this string should include newline for formatting.</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>
@@ -134,6 +143,14 @@ StackTrace:
<data name="ErrorExitingWithNonZeroErrorCode" xml:space="preserve">
<value>Exiting with non-zero error code!</value>
</data>
<data name="ErrorFailingRequest" xml:space="preserve">
<value>Request failing: {0}</value>
<comment>{0} will be replaced by URL of the request</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="ErrorNoBotsDefined" xml:space="preserve">
<value>No bots are defined, did you forget to configure your ASF?</value>
</data>
@@ -162,6 +179,9 @@ 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="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>
@@ -174,6 +194,10 @@ StackTrace:
<data name="GlobalConfigRemoved" xml:space="preserve">
<value>Global config file has been removed!</value>
</data>
<data name="IgnoringTrade" xml:space="preserve">
<value>Ignoring trade: {0}</value>
<comment>{0} will be replaced by trade number</comment>
</data>
<data name="LoggingIn" xml:space="preserve">
<value>Logging in to {0}...</value>
<comment>{0} will be replaced by service's name</comment>
@@ -181,15 +205,63 @@ StackTrace:
<data name="RefreshingOurSession" xml:space="preserve">
<value>Refreshing our session!</value>
</data>
<data name="RejectingTrade" xml:space="preserve">
<value>Rejecting trade: {0}</value>
<comment>{0} will be replaced by trade number</comment>
</data>
<data name="Restarting" xml:space="preserve">
<value>Restarting...</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>
</data>
<data name="RuntimeVersionOK" xml:space="preserve">
<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">
<value>Your {0} runtime version is too old!</value>
<comment>{0} will be replaced by runtime name (e.g. "Mono")</comment>
</data>
<data name="Starting" xml:space="preserve">
<value>Starting...</value>
</data>
<data name="StatusCode" xml:space="preserve">
<value>Status code: {0}</value>
<comment>{0} will be replaced by status code number/name</comment>
</data>
<data name="Success" xml:space="preserve">
<value>Success!</value>
</data>
<data name="TimeSpanDay" xml:space="preserve">
<value>1 day</value>
</data>
<data name="TimeSpanDays" xml:space="preserve">
<value>{0} days</value>
<comment>{0} will be replaced by number of days</comment>
</data>
<data name="TimeSpanHour" xml:space="preserve">
<value>1 hour</value>
</data>
<data name="TimeSpanHours" xml:space="preserve">
<value>{0} hours</value>
<comment>{0} will be replaced by number of hours</comment>
</data>
<data name="TimeSpanMinute" xml:space="preserve">
<value>1 minute</value>
</data>
<data name="TimeSpanMinutes" xml:space="preserve">
<value>{0} minutes</value>
<comment>{0} will be replaced by number of minutes</comment>
</data>
<data name="TimeSpanSecond" xml:space="preserve">
<value>1 second</value>
</data>
<data name="TimeSpanSeconds" xml:space="preserve">
<value>{0} seconds</value>
<comment>{0} will be replaced by number of seconds</comment>
</data>
<data name="UnlockingParentalAccount" xml:space="preserve">
<value>Unlocking parental account...</value>
</data>
@@ -209,4 +281,22 @@ 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">
<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">
<value>Answered to WCF command: {0} with: {1}</value>
<comment>{0} will be replaced by WCF command, {1} will be replaced by WCF answer</comment>
</data>
<data name="WCFReady" xml:space="preserve">
<value>WCF server ready!</value>
</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>
</data>
<data name="WCFStarting" xml:space="preserve">
<value>Starting WCF server on {0}...</value>
<comment>{0} will be replaced by WCF hostname</comment>
</data>
</root>

View File

@@ -24,6 +24,7 @@
using System;
using System.Reflection;
using ArchiSteamFarm.Localization;
using Microsoft.Win32;
namespace ArchiSteamFarm {
@@ -46,12 +47,14 @@ namespace ArchiSteamFarm {
Version minMonoVersion = new Version(4, 6);
if (monoVersion >= minMonoVersion) {
Program.ArchiLogger.LogGenericInfo("Your Mono version is OK. Required: " + minMonoVersion + " | Found: " + monoVersion);
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.RuntimeVersionOK, "Mono"));
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.RuntimeVersionComparison, minMonoVersion, monoVersion));
_IsRuntimeSupported = true;
return true;
}
Program.ArchiLogger.LogGenericWarning("Your Mono version is too old. Required: " + minMonoVersion + " | Found: " + monoVersion);
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionTooOld, "Mono"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionComparison, minMonoVersion, monoVersion));
_IsRuntimeSupported = false;
return false;
}
@@ -65,12 +68,14 @@ namespace ArchiSteamFarm {
Version minNetVersion = new Version(4, 6, 1);
if (netVersion >= minNetVersion) {
Program.ArchiLogger.LogGenericInfo("Your .NET version is OK. Required: " + minNetVersion + " | Found: " + netVersion);
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.RuntimeVersionOK, ".NET"));
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.RuntimeVersionComparison, minNetVersion, netVersion));
_IsRuntimeSupported = true;
return true;
}
Program.ArchiLogger.LogGenericWarning("Your .NET version is too old. Required: " + minNetVersion + " | Found: " + netVersion);
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionTooOld, ".NET"));
Program.ArchiLogger.LogGenericWarning(string.Format(Strings.RuntimeVersionComparison, minNetVersion, netVersion));
_IsRuntimeSupported = false;
return false;
}
@@ -160,7 +165,9 @@ namespace ArchiSteamFarm {
}
}
if (release >= 394747) {
// https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
if (release >= 394802) {
return new Version(4, 6, 2);
}

View File

@@ -28,6 +28,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ArchiSteamFarm.JSON;
using ArchiSteamFarm.Localization;
namespace ArchiSteamFarm {
internal sealed class Trading : IDisposable {
@@ -128,7 +129,7 @@ namespace ArchiSteamFarm {
}
if (tradeOffer.State != Steam.TradeOffer.ETradeOfferState.Active) {
Bot.ArchiLogger.LogGenericError("Ignoring trade in non-active state!");
Bot.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsInvalid, tradeOffer.State));
return null;
}
@@ -141,14 +142,14 @@ namespace ArchiSteamFarm {
switch (result.Result) {
case ParseTradeResult.EResult.AcceptedWithItemLose:
case ParseTradeResult.EResult.AcceptedWithoutItemLose:
Bot.ArchiLogger.LogGenericInfo("Accepting trade: " + tradeOffer.TradeOfferID);
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.AcceptingTrade, tradeOffer.TradeOfferID));
await Bot.ArchiWebHandler.AcceptTradeOffer(tradeOffer.TradeOfferID).ConfigureAwait(false);
break;
case ParseTradeResult.EResult.RejectedPermanently:
case ParseTradeResult.EResult.RejectedTemporarily:
if (result.Result == ParseTradeResult.EResult.RejectedPermanently) {
if (Bot.BotConfig.IsBotAccount) {
Bot.ArchiLogger.LogGenericInfo("Rejecting trade: " + tradeOffer.TradeOfferID);
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.RejectingTrade, tradeOffer.TradeOfferID));
Bot.ArchiWebHandler.DeclineTradeOffer(tradeOffer.TradeOfferID);
break;
}
@@ -156,7 +157,7 @@ namespace ArchiSteamFarm {
IgnoredTrades.Add(tradeOffer.TradeOfferID);
}
Bot.ArchiLogger.LogGenericInfo("Ignoring trade: " + tradeOffer.TradeOfferID);
Bot.ArchiLogger.LogGenericInfo(string.Format(Strings.IgnoringTrade, tradeOffer.TradeOfferID));
break;
}

View File

@@ -28,6 +28,7 @@ using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;
using System.Text;
using ArchiSteamFarm.Localization;
namespace ArchiSteamFarm {
internal static class Utilities {
@@ -83,51 +84,27 @@ namespace ArchiSteamFarm {
StringBuilder result = new StringBuilder();
if (timeSpan.Days > 0) {
result.Append(" " + timeSpan.Days + " day");
if (timeSpan.Days > 1) {
result.Append('s');
}
result.Append(',');
result.Append((timeSpan.Days > 1 ? string.Format(Strings.TimeSpanDays, timeSpan.Days) : Strings.TimeSpanDay) + ", ");
}
if (timeSpan.Hours > 0) {
result.Append(" " + timeSpan.Hours + " hour");
if (timeSpan.Hours > 1) {
result.Append('s');
}
result.Append(',');
result.Append((timeSpan.Hours > 1 ? string.Format(Strings.TimeSpanHours, timeSpan.Hours) : Strings.TimeSpanHour) + ", ");
}
if (timeSpan.Minutes > 0) {
result.Append(" " + timeSpan.Minutes + " minute");
if (timeSpan.Minutes > 1) {
result.Append('s');
}
result.Append(',');
result.Append((timeSpan.Minutes > 1 ? string.Format(Strings.TimeSpanMinutes, timeSpan.Minutes) : Strings.TimeSpanMinute) + ", ");
}
if (timeSpan.Seconds > 0) {
result.Append(" " + timeSpan.Hours + " second");
if (timeSpan.Seconds > 1) {
result.Append('s');
}
result.Append(',');
result.Append((timeSpan.Seconds > 1 ? string.Format(Strings.TimeSpanSeconds, timeSpan.Seconds) : Strings.TimeSpanSecond) + ", ");
}
if (result.Length <= 1) {
if (result.Length == 0) {
return "";
}
// Get rid of initial space
result.Remove(0, 1);
// Get rid of last comma
result.Length--;
// Get rid of last comma + space
result.Length -= 2;
return result.ToString();
}

View File

@@ -26,6 +26,7 @@ using System;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using ArchiSteamFarm.Localization;
namespace ArchiSteamFarm {
[ServiceContract]
@@ -59,12 +60,12 @@ namespace ArchiSteamFarm {
}
if (Program.GlobalConfig.SteamOwnerID == 0) {
return "Refusing to handle request because SteamOwnerID is not set!";
return Strings.ErrorWCFAccessDenied;
}
Bot bot = Bot.Bots.Values.FirstOrDefault();
if (bot == null) {
return "ERROR: No bots are enabled!";
return Strings.ErrorNoBotsDefined;
}
string command = "!" + input;
@@ -73,7 +74,7 @@ namespace ArchiSteamFarm {
// We must keep it synchronous until either Mono gets fixed, or culprit for freeze located (and corrected)
string output = bot.Response(Program.GlobalConfig.SteamOwnerID, command).Result;
Program.ArchiLogger.LogGenericInfo("Answered to WCF command: " + input + " with: " + output);
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.WCFAnswered, input, output));
return output;
}
@@ -94,7 +95,7 @@ namespace ArchiSteamFarm {
return null;
}
Program.ArchiLogger.LogGenericInfo("Sending command: " + input + " to WCF server on " + URL + "...");
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.WCFSendingCommand, input, URL));
if (Client == null) {
Client = new Client(
@@ -116,7 +117,7 @@ namespace ArchiSteamFarm {
return;
}
Program.ArchiLogger.LogGenericInfo("Starting WCF server on " + URL + "...");
Program.ArchiLogger.LogGenericInfo(string.Format(Strings.WCFStarting, URL));
try {
ServiceHost = new ServiceHost(typeof(WCF), new Uri(URL));
@@ -132,10 +133,9 @@ namespace ArchiSteamFarm {
);
ServiceHost.Open();
Program.ArchiLogger.LogGenericInfo("WCF server ready!");
Program.ArchiLogger.LogGenericInfo(Strings.WCFReady);
} catch (AddressAccessDeniedException) {
Program.ArchiLogger.LogGenericError("WCF service could not be started because of AddressAccessDeniedException!");
Program.ArchiLogger.LogGenericWarning("If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions!");
Program.ArchiLogger.LogGenericError(Strings.WCFAddressAccessDeniedException);
} catch (Exception e) {
Program.ArchiLogger.LogGenericException(e);
}

View File

@@ -28,6 +28,7 @@ using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml;
using ArchiSteamFarm.Localization;
using HtmlAgilityPack;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -61,7 +62,7 @@ namespace ArchiSteamFarm {
};
// Most web services expect that UserAgent is set, so we declare it globally
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/" + SharedInfo.Version);
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(nameof(ArchiSteamFarm) + "/" + SharedInfo.Version);
}
internal static void Init() {
@@ -101,8 +102,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -121,8 +122,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -141,8 +142,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -180,8 +181,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -200,8 +201,8 @@ namespace ArchiSteamFarm {
return true;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return false;
}
@@ -220,8 +221,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -251,8 +252,8 @@ namespace ArchiSteamFarm {
return true;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return false;
}
@@ -340,8 +341,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -477,8 +478,8 @@ namespace ArchiSteamFarm {
return result;
}
ArchiLogger.LogGenericWarning("Request failed even after " + MaxRetries + " tries");
ArchiLogger.LogGenericDebug("Failing request: " + request);
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, MaxRetries));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
return null;
}
@@ -533,9 +534,9 @@ namespace ArchiSteamFarm {
}
if (Debugging.IsDebugBuild || Program.GlobalConfig.Debug) {
ArchiLogger.LogGenericDebug("Request: " + request + " failed!");
ArchiLogger.LogGenericDebug("Status code: " + responseMessage.StatusCode);
ArchiLogger.LogGenericDebug("Content: " + Environment.NewLine + await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false));
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
ArchiLogger.LogGenericDebug(string.Format(Strings.StatusCode, responseMessage.StatusCode));
ArchiLogger.LogGenericDebug(string.Format(Strings.Content, await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false)));
}
responseMessage.Dispose();