mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
ArchiBoT/ASF code unification
This commit is contained in:
@@ -1425,7 +1425,7 @@ namespace ArchiSteamFarm {
|
||||
return await UrlGetToHtmlDocumentWithSession(host, request, --maxTries).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<T> UrlGetToJsonObjectWithSession<T>(string host, string request, byte maxTries = WebBrowser.MaxTries) {
|
||||
private async Task<T> UrlGetToJsonObjectWithSession<T>(string host, string request, byte maxTries = WebBrowser.MaxTries) where T : class {
|
||||
if (string.IsNullOrEmpty(host) || string.IsNullOrEmpty(request)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(host) + " || " + nameof(request));
|
||||
return default;
|
||||
@@ -1630,7 +1630,7 @@ namespace ArchiSteamFarm {
|
||||
return await UrlPostToHtmlDocumentWithSession(host, request, data, referer, session, --maxTries).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<T> UrlPostToJsonObjectWithSession<T>(string host, string request, Dictionary<string, string> data = null, string referer = null, ESession session = ESession.Lowercase, byte maxTries = WebBrowser.MaxTries) {
|
||||
private async Task<T> UrlPostToJsonObjectWithSession<T>(string host, string request, Dictionary<string, string> data = null, string referer = null, ESession session = ESession.Lowercase, byte maxTries = WebBrowser.MaxTries) where T : class {
|
||||
if (string.IsNullOrEmpty(host) || string.IsNullOrEmpty(request)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(host) + " || " + nameof(request));
|
||||
return default;
|
||||
@@ -1703,7 +1703,7 @@ namespace ArchiSteamFarm {
|
||||
return await UrlPostToJsonObjectWithSession<T>(host, request, data, referer, session, --maxTries).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<T> UrlPostToJsonObjectWithSession<T>(string host, string request, List<KeyValuePair<string, string>> data = null, string referer = null, ESession session = ESession.Lowercase, byte maxTries = WebBrowser.MaxTries) {
|
||||
private async Task<T> UrlPostToJsonObjectWithSession<T>(string host, string request, List<KeyValuePair<string, string>> data = null, string referer = null, ESession session = ESession.Lowercase, byte maxTries = WebBrowser.MaxTries) where T : class {
|
||||
if (string.IsNullOrEmpty(host) || string.IsNullOrEmpty(request)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(host) + " || " + nameof(request));
|
||||
return default;
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace ArchiSteamFarm {
|
||||
return response != null ? new HtmlDocumentResponse(response) : null;
|
||||
}
|
||||
|
||||
internal async Task<ObjectResponse<T>> UrlGetToJsonObject<T>(string request, string referer = null, byte maxTries = MaxTries) {
|
||||
internal async Task<ObjectResponse<T>> UrlGetToJsonObject<T>(string request, string referer = null, byte maxTries = MaxTries) where T : class {
|
||||
if (string.IsNullOrEmpty(request) || (maxTries == 0)) {
|
||||
ArchiLogger.LogNullError(nameof(request) + " || " + nameof(maxTries));
|
||||
return null;
|
||||
@@ -276,7 +276,7 @@ namespace ArchiSteamFarm {
|
||||
return response != null ? new HtmlDocumentResponse(response) : null;
|
||||
}
|
||||
|
||||
internal async Task<ObjectResponse<T>> UrlPostToJsonObject<T>(string request, IReadOnlyCollection<KeyValuePair<string, string>> data = null, string referer = null, byte maxTries = MaxTries) {
|
||||
internal async Task<ObjectResponse<T>> UrlPostToJsonObject<T>(string request, IReadOnlyCollection<KeyValuePair<string, string>> data = null, string referer = null, byte maxTries = MaxTries) where T : class {
|
||||
if (string.IsNullOrEmpty(request) || (maxTries == 0)) {
|
||||
ArchiLogger.LogNullError(nameof(request) + " || " + nameof(maxTries));
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user