Click or drag to resize

KickUserRequest Class

Kicks a user out of the server.
Inheritance Hierarchy
SystemObject
  BaseRequest
    Sfs2X.RequestsKickUserRequest

Namespace:  Sfs2X.Requests
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class KickUserRequest : BaseRequest
Constructors
  NameDescription
Public methodKickUserRequest(Int32)
See KickUserRequest(int, string, int) constructor.
Public methodKickUserRequest(Int32, String)
See KickUserRequest(int, string, int) constructor.
Public methodKickUserRequest(Int32, String, Int32)
Creates a new KickUserRequest instance.
Top
Remarks
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 MODERATOR_MESSAGE event.

Differently from the user being banned (see the BanUserRequest request), a kicked user will be able to reconnect to the SmartFoxServer instance immediately.

Examples
The following example kicks the user Jack from the system:
User userToKick = sfs.UserManager.GetUserByName("Jack"); 
sfs.Send( new KickUserRequest(userToKick.Id) );
See Also