mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Volvo and it's 7-days locks
This commit is contained in:
parent
7c9e5d818e
commit
abe3beaee7
3 changed files with 16 additions and 6 deletions
|
@ -281,7 +281,21 @@ namespace ArchiSteamFarm {
|
|||
{"tradeofferid", tradeID.ToString()}
|
||||
};
|
||||
|
||||
return await Utilities.UrlPostRequest(request, postData, SteamCookieDictionary, referer).ConfigureAwait(false);
|
||||
HttpResponseMessage result = await Utilities.UrlPostRequestWithResponse(request, postData, SteamCookieDictionary, referer).ConfigureAwait(false);
|
||||
bool success = result.IsSuccessStatusCode;
|
||||
|
||||
if (!success) {
|
||||
Logging.LogGenericWarning(Bot.BotName, "Request failed, reason: " + result.ReasonPhrase);
|
||||
switch (result.StatusCode) {
|
||||
case HttpStatusCode.InternalServerError:
|
||||
Logging.LogGenericWarning(Bot.BotName, "That might be caused by 7-days trade lock from new device");
|
||||
Logging.LogGenericWarning(Bot.BotName, "Try again in 7 days, declining that offer for now");
|
||||
DeclineTradeOffer(tradeID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
internal bool DeclineTradeOffer(ulong tradeID) {
|
||||
|
|
|
@ -86,10 +86,6 @@ namespace ArchiSteamFarm {
|
|||
success = Bot.ArchiWebHandler.DeclineTradeOffer(tradeID);
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
Logging.LogGenericWarning(Bot.BotName, "Response <accept: " + tradeAccepted + "> to trade " + tradeID + " failed!");
|
||||
}
|
||||
|
||||
if (tradeAccepted && success) {
|
||||
// Do whatever we want with success
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace ArchiSteamFarm {
|
|||
requestMessage.Headers.Referrer = new Uri(referer);
|
||||
}
|
||||
HttpResponseMessage responseMessage = await client.SendAsync(requestMessage).ConfigureAwait(false);
|
||||
if (responseMessage != null && responseMessage.IsSuccessStatusCode) {
|
||||
if (responseMessage != null) {
|
||||
result = responseMessage;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue