Sign In Register

How can we help you today?

Start a new topic

Unity C# Listen For User Disconnect

So i have the first user get properly disconnected when the second user logs in using the same account using:

Spark.getPlayer().disconnect(true); in the authenticateresponse cloud  code

but i cannot for the life of me find out how to receive this information in unity, so i can make a window popup informing the player theyve been disconnect and taking them back to the login screen.

1 Comment

nevermind i figured it out. for those curious, in GameSparksManager.cs in void awake i added:

GameSparks.Api.Messages.SessionTerminatedMessage.Listener += PlayerDisconnect;

to listen for function:

    void PlayerDisconnect(GameSparks.Api.Messages.SessionTerminatedMessage _message)

    {

        print("player was disconnected");

    }

Login to post a comment