mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Closes #415
This commit is contained in:
@@ -1294,13 +1294,12 @@ namespace ArchiSteamFarm {
|
||||
|
||||
Bot.ArchiLogger.LogGenericInfo(Strings.UnlockingParentalAccount);
|
||||
|
||||
const string request = SteamCommunityURL + "/parental/ajaxunlock";
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(1) {
|
||||
{ "pin", parentalPin }
|
||||
};
|
||||
if (!await UnlockParentalCommunityAccount(parentalPin).ConfigureAwait(false)) {
|
||||
Bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = await WebBrowser.UrlPostRetry(request, data, SteamCommunityURL).ConfigureAwait(false);
|
||||
if (!result) {
|
||||
if (!await UnlockParentalStoreAccount(parentalPin).ConfigureAwait(false)) {
|
||||
Bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed);
|
||||
return false;
|
||||
}
|
||||
@@ -1309,6 +1308,34 @@ namespace ArchiSteamFarm {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<bool> UnlockParentalCommunityAccount(string parentalPin) {
|
||||
if (string.IsNullOrEmpty(parentalPin)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(parentalPin));
|
||||
return false;
|
||||
}
|
||||
|
||||
const string request = SteamCommunityURL + "/parental/ajaxunlock";
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(1) {
|
||||
{ "pin", parentalPin }
|
||||
};
|
||||
|
||||
return await WebBrowser.UrlPostRetry(request, data, SteamCommunityURL).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<bool> UnlockParentalStoreAccount(string parentalPin) {
|
||||
if (string.IsNullOrEmpty(parentalPin)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(parentalPin));
|
||||
return false;
|
||||
}
|
||||
|
||||
const string request = SteamStoreURL + "/parental/ajaxunlock";
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(1) {
|
||||
{ "pin", parentalPin }
|
||||
};
|
||||
|
||||
return await WebBrowser.UrlPostRetry(request, data, SteamStoreURL).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private enum ESteamApiKeyState : byte {
|
||||
Error,
|
||||
Registered,
|
||||
|
||||
Reference in New Issue
Block a user