in Assets/Xbox Live/Scripts/SignInManager.cs [593:657]
private IEnumerator SignInAsync(int playerNumber, XboxLivePlayerInfo playerInfo)
{
SignInStatus signInStatus = SignInStatus.Success;
TaskYieldInstruction<SignInResult> signInSilentlyTask = playerInfo.XboxLiveUser.SignInSilentlyAsync().AsCoroutine();
yield return signInSilentlyTask;
try
{
signInStatus = signInSilentlyTask.Result.Status;
}
catch (Exception ex)
{
ExceptionManager.Instance.ThrowException(
ExceptionSource.SignInManager,
ExceptionType.SignInSilentlyFailed,
ex);
}
if (signInStatus != SignInStatus.Success)
{
TaskYieldInstruction<SignInResult> signInTask = playerInfo.XboxLiveUser.SignInAsync().AsCoroutine();
yield return signInTask;
try
{
signInStatus = signInTask.Result.Status;
}
catch (Exception ex)
{
ExceptionManager.Instance.ThrowException(
ExceptionSource.SignInManager,
ExceptionType.SignInFailed,
ex);
}
}
try
{
// Throw any exceptions if needed.
if (signInStatus == SignInStatus.Success)
{
CurrentNumberOfPlayers++;
XboxLive.Instance.StatsManager.AddLocalUser(playerInfo.XboxLiveUser);
XboxLive.Instance.SocialManager.AddLocalUser(playerInfo.XboxLiveUser, SocialManagerExtraDetailLevel.PreferredColorLevel);
this.NotifyAllCallbacks(playerNumber, playerInfo.XboxLiveUser, XboxLiveAuthStatus.Succeeded, null, true);
}
else
{
this.CurrentPlayers[playerNumber].XboxLiveUser = null;
this.CurrentPlayers[playerNumber].XboxLiveContext = null;
#if ENABLE_WINMD_SUPPORT
this.CurrentPlayers[playerNumber].WindowsUser = null;
#endif
NotifyAllCallbacks(playerNumber, null, XboxLiveAuthStatus.Failed, "Sign In Failed: Player " + playerNumber + " failed. Sign In Status: " + signInStatus);
}
}
catch (Exception ex)
{
ExceptionManager.Instance.ThrowException(
ExceptionSource.SignInManager,
ExceptionType.SignInFailed,
ex);
}
}