Search Unity

XboxLiveUser.SignOutCompleted Unreliable

Discussion in 'Windows' started by MagicDesignStudios, Jan 16, 2019.

  1. MagicDesignStudios

    MagicDesignStudios

    Joined:
    Dec 22, 2016
    Posts:
    37
    Hello,

    We have some issues with the event XboxLiveUser.SignOutCompleted that is sometimes (quite often) not called when the player sign out from its xbox app or if he sign in on the same account on another device.
    Also, in that case, xboxUser.IsSignedIn remains true even if the player is disconnected from its account, and any operation with the xboxUser does not work or make the game crash. Also, When this happen ( the callback not being called) by connecting multiple time on different devices with the same account, after a while (~30 sec) the game crash on the one that have been the account "stolen".

    We are looking for a way to test if the xboxUser is effectively connected, and that is more reliable than the XboxLiveUser.SignOutCompleted.

    Thanks
     
    Last edited: Jan 16, 2019
  2. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    When I was adding xbox live functionality into my ID@Xbox game on windows 10 I found the exact same thing. In the dev sandbox the event could take minutes to fire. I contacted developer support and they explained that messages / events have less of a priority in dev but once you are in the retail sandbox they should fire almost immediately.

    One work around that kind of worked for me was checking to see if the xbox live context was null. This then seemed to give everything a kick and the events would then fire.

    So in my game I have a check for this every second. Its a brute force approach but it did seem to work
     
  3. MagicDesignStudios

    MagicDesignStudios

    Joined:
    Dec 22, 2016
    Posts:
    37
    Thank for your answer.
    What do you mean by "see if the xbox live context was null" ?
    XboxLiveContext is a variable set by us (not the API) in callbacks (it's set to null in OnUserSignOut). The problem is the callback is not called so the context is not null, even if someone use the account on another device. Did you mean there is some variable in the XboxLiveContext class we can check?
    We found out that we can call SignInSilentlyAsync every X seconds and if it does not return SignInStatus.Success we are in the case we want to handle. But it makes a lot of API call and it seems to make the game crash when we call it too often so.... not a very good fix.
     
  4. matt33315

    matt33315

    Joined:
    Mar 28, 2014
    Posts:
    94
    Yeah you are correct, the context is something that you are creating. But strangely I found just having the code
    if(XboxLiveContext == null)
    {
    //Dont even have to do anything here
    }

    seem to then make the event fire. I know it sounds crazy but it worked for me.

    Equally you could just try accessing any property on the context to see if it then forces the event to fire.


    Yeah I think calling the signing in method too often will cause the context to throw a throttle exception.
     
  5. MagicDesignStudios

    MagicDesignStudios

    Joined:
    Dec 22, 2016
    Posts:
    37
    So we tried that and it does nothing... Maybe it was something you added at the same time that fixed it.
     
  6. MagicDesignStudios

    MagicDesignStudios

    Joined:
    Dec 22, 2016
    Posts:
    37
    Switching the XSSDK from 1806 to 1807 at least fixed the crashes (but not the long time before receiving the callback)
     
  7. RestlessCorp

    RestlessCorp

    Joined:
    Apr 20, 2019
    Posts:
    22
    Hi, I have the same trouble with app crash, caused by XboxLiveUser.SignOutCompleted event

    How you have fixed it?

    Is it normal that https://github.com/Microsoft/xbox-live-api/releases 1807.unitypackage file has the same name and size like 1804 .unitypackage file? like by accident they have uploaded old api release?