Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

UserProfile prefab and signing out #119

Closed
Piecrustius opened this issue Sep 5, 2017 · 6 comments
Closed

UserProfile prefab and signing out #119

Piecrustius opened this issue Sep 5, 2017 · 6 comments
Labels

Comments

@Piecrustius
Copy link

I am using the 1707 QFE 3 release. Is the UserProfile prefab intended to handle users signing out? I see a XboxLiveUserOnSignOutCompleted function in the script, but it does not seem to be used anywhere.

Should I modify the UserProfile prefab, or is there some other way I should be handling a user signing out in the middle of the game? I am able to see the sign in/out through the Sign[In/Out]Completed of the XboxLiveUser class.

Asked another way, I want to allow a user to sign out and have another sign in, such as in a setup screen for multiple local players. Should I use the UserProfile prefab to do so, or should I do it some other way?

Thanks.

@Piecrustius
Copy link
Author

Currently, if I sign in multiple users, that seems to operate as expected. However, once I sign out one of the users, the UI elements from the UserProfile prefab do not change and eventually after several seconds, I get this error message:

Exception thrown: 'Microsoft.Xbox.Services.XboxException' in Microsoft.Xbox.Services.UWP.CSharp.dll
Exception thrown: 'Microsoft.Xbox.Services.XboxException' in System.Private.CoreLib.ni.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.ni.dll
Exception thrown: 'System.Threading.SynchronizationLockException' in System.Threading.dll

I have not yet been able to find the source.

@jicailiu jicailiu added the bug label Sep 6, 2017
@MSFT-Heba
Copy link
Contributor

Hi Piecrustius,
Thanks for reporting this. We'll work on a fix for this bug and update you once the fix is out.
Thanks!

@SimonDarksideJ
Copy link

@Piecrustius did you find a way to sign out the user in single person mode?

@Piecrustius
Copy link
Author

DDReaper,
Nope. My objective is to have a local multiplayer game where users can sign in and out during a setup screen. The issue is probably related to a single user signing out.
Currently, I am working on a separate script based on the UserProfile.cs script to track up to 8 users. I think I have them signing in and I am turning to signing out, or at least recognizing when they are signing out and then resetting the user information to allow another sign in.
You can get feedback on a user sign out by adding a function to the XboxLiveUser.SignOutCompleted member. I did it this way, but I do not know if its the right way to do it:

static void UserSignedOut(object sender, SignOutCompletedEventArgs e)
{
Debug.Log("User signed Out: " + e.User.Gamertag);
}

Then add:
XboxLiveUser.SignOutCompleted += UserSignedOut;

to some initialization section, such as in the Start() function.

That is as far as I have gotten on handling a sign out. If I get further, I'll post the code. I should mention that I do not know what I am doing and am making it up as I go along.

Good luck.

@SimonDarksideJ
Copy link

I did eventually find a way, but it involved using the gamebar to navigate to the Xbox App and then signing out there.
Looked through the code (as you likely have) and found no reference to a "SignOut" option.

If I get a chance, I might try adding another "sign-in" call and see if that replaces it.

@jplafonta
Copy link
Contributor

This issue is fixed in the 1711 release. If you are still seeing the issue after updating to that please reopen this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants