|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Banishes a user from the server. More...
#include <BanUserRequest.h>
Public Member Functions | |
| BanUserRequest (int32_t userId, std::string message="", BanMode banMode=BanMode::ByName, int32_t delaySeconds=5, int32_t durationHours=DEFAULT_DURATION_HOURS) | |
Banishes a user from the server.
The current user must have administration or moderation privileges to ban another user (see User::getPrivilegeId()). The user is banned by name or by IP address, as told by the BanMode. The request can carry a message explaining the reason of the disconnection, which reaches the banned user as a MODERATOR_MESSAGE event.
Unlike a kicked user, a banned user cannot connect again until the ban expires or an administrator takes his name or address off the list of banned users, through the SmartFoxServer 3 Administration Tool.
|
inline |
| userId | the id of the user to ban |
| message | the message delivered to the user before banning him; when empty, the default message set in the SmartFoxServer 3 Administration Tool is used |
| banMode | whether the user is banned by name or by IP address |
| delaySeconds | the number of seconds between the ban message and the actual disconnection; must be within 0 and 10 |
| durationHours | how long the ban lasts, in hours; must be greater than 0 |