KickUserRequest
Kicks a user out of the server.
new KickUserRequest(userId[, message][, delaySeconds])
Creates a new KickUserRequest instance. The instance must be passed to the SmartFox.send() method for the request to be executed.
This request kicks a user out of the server. The current user must have administration or moderation privileges in order to be able to kick another user (see the SFSUser.privilegeId property). The request allows sending a message to the kicked user (to make clear the reason of the following disconnection) which is delivered by means of the moderatorMessage event.
Differently from the user being banned (see the BanUserRequest request), a kicked user will be able to reconnect to the SmartFoxServer instance immediately.
Example
This example kicks the user Jack from the system.
function someMethod()
{
var userToKick = sfs.userManager.getUserByName("Jack");
sfs.send(new SFS2X.KickUserRequest(userToKick.id));
}
Parameters
Name | Type | Optional | Description |
---|---|---|---|
userId |
|
|
The id of the user to be kicked. |
message |
|
Yes |
A custom message to be delivered to the user before kicking him; if Defaults to |
delaySeconds |
|
Yes |
The number of seconds after which the user is kicked after receiving the kick message. Defaults to |