Dispatched when the login to a SmartFoxServer zone has been attempted.


NOTE:
the server sends the username back to the client because not all usernames are valid: for example, those containing bad words may have been filtered during the login process.
Version:
SmartFoxServer Basic / Pro

The following example shows how to handle the login result.
CopyC#

SFSEvent.onLogin += OnLogin; smartFox.Login("simpleChat", "jack"); public void OnLogin(bool success, string name, string error) { if (success) Debug.WriteLine("Successfully logged in as " + name); else Debug.WriteLine("Zone login error; the following error occurred: " + error); }