mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Misc enhancements
This commit is contained in:
@@ -166,8 +166,8 @@ namespace ArchiSteamFarm {
|
|||||||
internal void OnDisconnected() => Ready = false;
|
internal void OnDisconnected() => Ready = false;
|
||||||
|
|
||||||
internal async Task<bool> Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalPin) {
|
internal async Task<bool> Init(ulong steamID, EUniverse universe, string webAPIUserNonce, string parentalPin) {
|
||||||
if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce)) {
|
if ((steamID == 0) || (universe == EUniverse.Invalid) || string.IsNullOrEmpty(webAPIUserNonce) || string.IsNullOrEmpty(parentalPin)) {
|
||||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(universe) + " || " + nameof(webAPIUserNonce), Bot.BotName);
|
Logging.LogNullError(nameof(steamID) + " || " + nameof(universe) + " || " + nameof(webAPIUserNonce) + " || " + nameof(parentalPin), Bot.BotName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,19 +217,29 @@ namespace ArchiSteamFarm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logging.LogGenericInfo("Success!", Bot.BotName);
|
|
||||||
|
|
||||||
WebBrowser.CookieContainer.Add(new Cookie("sessionid", sessionID, "/", "." + SteamCommunityHost));
|
|
||||||
|
|
||||||
string steamLogin = authResult["token"].Value;
|
string steamLogin = authResult["token"].Value;
|
||||||
WebBrowser.CookieContainer.Add(new Cookie("steamLogin", steamLogin, "/", "." + SteamCommunityHost));
|
if (string.IsNullOrEmpty(steamLogin)) {
|
||||||
|
Logging.LogNullError(nameof(steamLogin), Bot.BotName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
string steamLoginSecure = authResult["tokensecure"].Value;
|
string steamLoginSecure = authResult["tokensecure"].Value;
|
||||||
|
if (string.IsNullOrEmpty(steamLoginSecure)) {
|
||||||
|
Logging.LogNullError(nameof(steamLoginSecure), Bot.BotName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
WebBrowser.CookieContainer.Add(new Cookie("sessionid", sessionID, "/", "." + SteamCommunityHost));
|
||||||
|
WebBrowser.CookieContainer.Add(new Cookie("steamLogin", steamLogin, "/", "." + SteamCommunityHost));
|
||||||
WebBrowser.CookieContainer.Add(new Cookie("steamLoginSecure", steamLoginSecure, "/", "." + SteamCommunityHost));
|
WebBrowser.CookieContainer.Add(new Cookie("steamLoginSecure", steamLoginSecure, "/", "." + SteamCommunityHost));
|
||||||
|
|
||||||
|
Logging.LogGenericInfo("Success!", Bot.BotName);
|
||||||
|
|
||||||
// Unlock Steam Parental if needed
|
// Unlock Steam Parental if needed
|
||||||
if (!await UnlockParentalAccount(parentalPin).ConfigureAwait(false)) {
|
if (!parentalPin.Equals("0")) {
|
||||||
return false;
|
if (!await UnlockParentalAccount(parentalPin).ConfigureAwait(false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ready = true;
|
Ready = true;
|
||||||
@@ -955,10 +965,6 @@ namespace ArchiSteamFarm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentalPin.Equals("0")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Logging.LogGenericInfo("Unlocking parental account...", Bot.BotName);
|
Logging.LogGenericInfo("Unlocking parental account...", Bot.BotName);
|
||||||
|
|
||||||
string request = SteamCommunityURL + "/parental/ajaxunlock";
|
string request = SteamCommunityURL + "/parental/ajaxunlock";
|
||||||
|
|||||||
Reference in New Issue
Block a user