I have Windows Store MonoGame (based on XAML MonoGame template in Visual Studio 2012) app.
When I connect to LiveConnect, system does all things in background, but when I call LiveConnectClient.GetAsync to get user info it sometimes (and usually) blocks the caller thread, even though it is called using await.
Is there any way to make GetAsync call really async? Maybe I should create a new thread to call it?
Here's the caller code. It is called inside MonoGame draw thread (can't access main UI thread in MonoGame).
private static LiveConnectSession session = null;
private static LiveAuthClient liveAuthClient = null;
private static LiveConnectClient liveConnectClient = null;
public static async Task AuthAsync()
{
liveAuthClient = new LiveAuthClient();
LiveLoginResult liveLoginResult = await liveAuthClient.InitializeAsync();
liveLoginResult = await liveAuthClient.LoginAsync(new List<string> { "wl.signin" });
if (liveLoginResult.Status == LiveConnectSessionStatus.Connected)
{
session = liveLoginResult.Session;
liveConnectClient = new LiveConnectClient(session);
LiveOperationResult liveOperationResult = await liveConnectClient.GetAsync("me");
dynamic meResult = liveOperationResult.Result;
MyEngine.userID = meResult.id;
}
}