|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsfs2x.client.requests.BaseRequest
sfs2x.client.requests.BanUserRequest
public class BanUserRequest
Banishes a user from the server.
The current user must have administration or moderation privileges in order to be able to ban another user (see the User.privilegeId property). The user can be banned by name or by IP address (see the BanMode class). Also, the request allows sending a message to the banned user (to make clear the reason of the following disconnection) which is delivered by means of the moderatorMessage event.
Differently from the user being kicked (see the KickUserRequest request), a banned user won't be able to connect to the SmartFoxServer instance until the banishment expires (after 24 hours for client-side banning) or an administrator removes his name/IP address from the list of banned users by means of the SmartFoxServer 2X Administration Tool.
Example
SFSEvent.MODERATOR_MESSAGE,
User.getPrivilegeId(),
BanMode,
KickUserRequest| Field Summary | |
|---|---|
static java.lang.String |
KEY_BAN_DURATION_HOURS
*Private* |
static java.lang.String |
KEY_BAN_MODE
*Private* |
static java.lang.String |
KEY_DELAY
*Private* |
static java.lang.String |
KEY_MESSAGE
*Private* |
static java.lang.String |
KEY_USER_ID
*Private* |
| Fields inherited from class sfs2x.client.requests.BaseRequest |
|---|
AddBuddy, AdminMessage, AutoJoin, BanUser, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserVariables, SpectatorToPlayer, SubscribeRoomGroup, UnsubscribeRoomGroup |
| Constructor Summary | |
|---|---|
BanUserRequest(int userId)
|
|
BanUserRequest(int userId,
java.lang.String message)
|
|
BanUserRequest(int userId,
java.lang.String message,
int banMode)
|
|
BanUserRequest(int userId,
java.lang.String message,
int banMode,
int delaySeconds)
|
|
BanUserRequest(int userId,
java.lang.String message,
int banMode,
int delaySeconds,
int durationHours)
Creates a new BanUserRequest instance. |
|
| Method Summary | |
|---|---|
void |
execute(SmartFox sfs)
*Private* |
void |
validate(SmartFox sfs)
*Private* |
| Methods inherited from class sfs2x.client.requests.BaseRequest |
|---|
getId, getMessage, getTargetController, isEncrypted, setEncrypted, setId, setTargetController |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_USER_ID
public static final java.lang.String KEY_MESSAGE
public static final java.lang.String KEY_DELAY
public static final java.lang.String KEY_BAN_MODE
public static final java.lang.String KEY_BAN_DURATION_HOURS
| Constructor Detail |
|---|
public BanUserRequest(int userId,
java.lang.String message,
int banMode,
int delaySeconds,
int durationHours)
userId - The id of the user to be banned.message - A custom message to be delivered to the user before banning him;
if null, the default message configured in the SmartFoxServer 2X Administration Tool is used.banMode - One of the ban modes defined in the BanMode class.delaySeconds - The number of seconds after which the user is banned after receiving the ban message.durationHours - The duration of the banishment, expressed in hours.SmartFox.send(sfs2x.client.requests.IRequest),
BanMode
public BanUserRequest(int userId,
java.lang.String message,
int banMode,
int delaySeconds)
public BanUserRequest(int userId,
java.lang.String message,
int banMode)
public BanUserRequest(int userId,
java.lang.String message)
public BanUserRequest(int userId)
| Method Detail |
|---|
public void validate(SmartFox sfs)
throws sfs2x.client.exceptions.SFSValidationException
sfs2x.client.exceptions.SFSValidationExceptionpublic void execute(SmartFox sfs)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||