Skip to content

Commit

Permalink
Attempting to log in on Battle.net freezes Playnite #1314
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefNemec committed Jul 30, 2019
1 parent 0d4d68c commit aa76a05
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BattleNetAccountClient
private const string apiStatusUrl = @"https://account.blizzard.com/api/";
private const string gamesUrl = @"https://account.blizzard.com/api/games-and-subs";
private const string classicGamesUrl = @"https://account.blizzard.com/api/classic-games";
private ILogger logger = LogManager.GetLogger();
private static ILogger logger = LogManager.GetLogger();
private IWebView webView;

public BattleNetAccountClient(IWebView webView)
Expand All @@ -42,16 +42,14 @@ public BattleNetAccountClient(IWebView webView)

public void Login()
{
var apiUrls = GetDefaultApiStatus();
var apiUrls = GetDefaultApiStatus();
webView.NavigationChanged += (s, e) =>
{
var address = webView.GetCurrentAddress();
if (address.StartsWith(@"https://account.blizzard.com") && !address.Equals(apiUrls.logoutUri, StringComparison.OrdinalIgnoreCase))
logger.Debug($"Battlenet login navigation {address}");
if (address.Equals(@"https://account.blizzard.com/overview", StringComparison.OrdinalIgnoreCase))
{
if (GetIsUserLoggedIn())
{
webView.Close();
}
webView.Close();
}
};

Expand Down Expand Up @@ -84,6 +82,7 @@ public static BattleNetApiStatus GetDefaultApiStatus()
}
}

logger.Debug(responseText);
var deserialized = Serialization.FromJson<BattleNetApiStatus>(responseText);
return deserialized;
}
Expand Down

0 comments on commit aa76a05

Please sign in to comment.