Search code examples
c#unity-webglkongregate

Kongregate API (Unity WebGL C#): What happens with the user data if the player is not using an account?


I am interested solely in what happens with the userinfo if a player is not signed into their Kongregate, I need to check for this as I will be saving game progress on a server and of course I don't want to be writing random save records into my database that will never actually be used.

My code is as follows

public void OnKongregateAPILoaded(string userInfoString)
{
    var info = userInfoString.Split('|');
    var userId = System.Convert.ToInt32(info[0]);
    var username = info[1];
    var gameAuthToken = info[2];
    Debug.Log("Kongregate User Info: " + username + ", userId: " + userId);
}

More specifically what I'm asking for is, will something such as username return null? Or something in general that I can check for?


Solution

  • Username changes to: "Guest" Id changes to: 0