|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Logs the current user in one of the server Zones. More...
#include <LoginRequest.h>
Public Member Functions | |
| LoginRequest (std::string userName, std::optional< std::string > pass=std::nullopt, std::optional< std::string > zoneName=std::nullopt, entities::SFSObject *params=nullptr) | |
| Creates a new LoginRequest. | |
Logs the current user in one of the server Zones.
Each Zone is an independent multiuser application governed by SmartFoxServer. To join a Zone you usually need a user name and a password. To check the credentials of the user, write a custom login process in the server-side Extension of the Zone.
Read the SmartFoxServer 3 documentation about the login process for more information.
On success the current user receives a event::SFSEvent::LOGIN event, otherwise a event::SFSEvent::LOGIN_ERROR event.
| sfs3::requests::LoginRequest::LoginRequest | ( | std::string | userName, |
| std::optional< std::string > | pass = std::nullopt, | ||
| std::optional< std::string > | zoneName = std::nullopt, | ||
| entities::SFSObject * | params = nullptr ) |
Creates a new LoginRequest.
Pass it to SmartFox::send for the request to be performed.
| userName | The name to give to the user. Pass an empty string to let the server generate the name, which works only if the Zone allows guest users. |
| pass | The password of the user. SmartFoxServer has no built-in authentication system, so the password is checked by the custom login system of the Zone Extension. |
| zoneName | The name of the Zone to log in to. It is case sensitive. When it is empty the client uses ConfigData::zone. |
| params | Custom parameters to pass to the Zone Extension. It needs a custom login system in place. The caller keeps the ownership. |