Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Last active June 3, 2018 16:37
Show Gist options
  • Save BrentFarris/e2463f8c65784a5b5766 to your computer and use it in GitHub Desktop.
Save BrentFarris/e2463f8c65784a5b5766 to your computer and use it in GitHub Desktop.
Forge Networking Sample: Registering Disconnected for Client
// Note: 15937 is the port number of the socket you started the connection on
Networking.Sockets[15937].serverDisconnected += ByeBye;
void ByeBye(string reason)
{
Debug.Log("The server has disconnected you because of: " + reason);
}
// Or you can in-line if you wish
Networking.Sockets[15937].serverDisconnected += delegate(string reason)
{
Debug.Log("The server has disconnected you because of: " + reason);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment