login()
Availability:
SmartFoxServer Lite / Basic / Pro
Usage:
smartFox.login(zone <String>, name <String>, password <String>)
Description:
The standard SmartFoxServer login method accepts guest
users. Duplicate nicknames in the same zone are not allowed.
If a user logs
in with an empty nickname the server automatically creates a name for the client
using this format: "guest_n" where n is a progressive number.
If you
need to implement your own login procedure, for example to check nicknames
against a database, you can add it to your code BEFORE the SmartFox login code.
This way, once the client is validated, you can just use the stadard login
procedure.
Also the provided name and password are checked against the moderator list
(configured in the config.xml file on the server side) and if a user matches
it is set
as a moderator
zone = the name of the zone (a string)
nick = the user's nickname
Parameters:
zone | the zone name in which you want to connect | |
name | the user name | |
password | the user password (optional) |
Returns:
Fires the onLogin event
Example:
smartFox.login("testZone", "Jim")
See also:
isModerator()