Packagecom.smartfoxserver.v2.requests
Classpublic class KickUserRequest
InheritanceKickUserRequest Inheritance com.smartfoxserver.v2.requests.BaseRequest

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 User.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.

View the examples

See also

moderatorMessage event
User.privilegeId
BanUserRequest


Public Methods
 MethodDefined By
  
KickUserRequest(userId:int, message:String = null, delaySeconds:int = 5)
Creates a new KickUserRequest instance.
KickUserRequest
Constructor Detail
KickUserRequest()Constructor
public function KickUserRequest(userId:int, message:String = null, delaySeconds:int = 5)

Creates a new KickUserRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

Parameters
userId:int — The id of the user to be kicked.
 
message:String (default = null) — A custom message to be delivered to the user before kicking him; if null, the default message configured in the SmartFoxServer 2X Administration Tool is used.
 
delaySeconds:int (default = 5) — The number of seconds after which the user is kicked after receiving the kick message.

See also

Examples
The following example kicks the user Jack from the system:
     
     private function someMethod():void
     {
         var userToKick:User = sfs.userManager.getUserByName("Jack");
         sfs.send(new KickUserRequest(userToKick.id));
     }