>>默认登陆或定制登陆
在Zone的设置中有一想很重要的设置,叫做Use custom login,如果将这个参数设置为false的情况下,系统控制器System Controller将处理登陆过程。
而如果将这个参数设置为true,扩展控制器Extension Controller将处理登陆过程。
>>登陆到一个Zone
登陆的过程需要通过客户端发起一个LoginRequest请求给服务器。这个请求需要以下参数。
username:(可选)用户名
password:(可选)密码
Zone name:登陆的区域名,必须存在
extra parameters:(可选)一个包含自定义数据的对象。
实现登陆只需要
» Logging in a Zone
The login phase is always initiated from the client side by sending a LoginRequest to the Server. This requires several parameters:
- user name: (optional) a user name
- password: (optional) a password
- Zone name: the name of a Zone; it must exist on the server-side
- extra parameters: (optional) an object containing extra custom data; typically this is used in conjunction with an Extension-based login in order to send custom data to the server-side
Logging in a Zone requires just a few lines of code: in essence you just need to register the SmartFox class instance to receive the SFSEvent.LOGIN and SFSEvent.LOGIN_ERROR events and proceed with the request.