SmartFoxServer 2X C++ API
Sfs2X::Requests::KickUserRequest Class Reference

Kicks a User out of the server (for moderators and admins only) More...

#include <KickUserRequest.h>

Inherits Sfs2X::Requests::BaseRequest.

Public Member Functions

 KickUserRequest (long int userId)
 KickUserRequest(long int, string, long int) More...
 
 KickUserRequest (long int userId, string message)
 KickUserRequest(long int, string, long int) More...
 
 KickUserRequest (long int userId, string message, long int delaySeconds)
 Constructor More...
 

Detailed Description

Kicks a User out of the server (for moderators and admins only)

Allows to send a custom message and to set a delay in seconds.

Constructor & Destructor Documentation

◆ KickUserRequest() [1/3]

Sfs2X::Requests::KickUserRequest::KickUserRequest ( long int  userId)

◆ KickUserRequest() [2/3]

Sfs2X::Requests::KickUserRequest::KickUserRequest ( long int  userId,
string  message 
)

◆ KickUserRequest() [3/3]

Sfs2X::Requests::KickUserRequest::KickUserRequest ( long int  userId,
string  message,
long int  delaySeconds 
)

Constructor

Parameters
userIdthe id of the User to be kicked out of the server
messagea custom kick message, if null the message configured on the server side will be used
delaySecondsa delay in seconds between the message (immediate) and the kick (delayed). Default is 5 seconds
boost::shared_ptr<User> userToKick new (ptrSmartFox->UserManager()->GetUserByName("Swedish Cook"));
// Send request
boost::shared_ptr<IRequest> request (new KickUserRequest(userToKick));
ptrSmartFox->Send(request);
See also
BanUserRequest