Move redeeming steam gifts from community to client

Glory to reverse-engineering and Madu for testing!
This commit is contained in:
JustArchi
2016-09-25 01:23:31 +02:00
parent 09e9b24c39
commit b8a0ab9d95
3 changed files with 60 additions and 37 deletions

View File

@@ -247,30 +247,6 @@ namespace ArchiSteamFarm {
return true;
}
internal async Task<bool> AcceptGift(ulong gid) {
if (gid == 0) {
Logging.LogNullError(nameof(gid), Bot.BotName);
return false;
}
if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) {
return false;
}
string sessionID = WebBrowser.CookieContainer.GetCookieValue(SteamCommunityURL, "sessionid");
if (string.IsNullOrEmpty(sessionID)) {
Logging.LogNullError(nameof(sessionID), Bot.BotName);
return false;
}
string request = SteamCommunityURL + "/gifts/" + gid + "/acceptunpack";
Dictionary<string, string> data = new Dictionary<string, string>(1) {
{ "sessionid", sessionID }
};
return await WebBrowser.UrlPostRetry(request, data).ConfigureAwait(false);
}
internal async Task<bool> JoinGroup(ulong groupID) {
if (groupID == 0) {
Logging.LogNullError(nameof(groupID), Bot.BotName);