Class BanUserRequest
- All Implemented Interfaces:
sfs3.client.requests.IClientRequest
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 3 Administration Tool.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class sfs3.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BanUsersFromRoom, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, ClusterInviteUsers, ClusterJoinOrCreate, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GameServerConnectionRequired, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, JoinRoomInvite, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, QuickJoinOrCreateRoom, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, sfso, SpectatorToPlayer, SubscribeRoomGroup, targetController, UdpInit, UnsubscribeRoomGroup -
Constructor Summary
ConstructorsConstructorDescriptionBanUserRequest(int userId) BanUserRequest(int userId, String message) BanUserRequest(int userId, String message, int banMode) BanUserRequest(int userId, String message, int banMode, int delaySeconds) BanUserRequest(int userId, String message, int banMode, int delaySeconds, int durationHours) Creates a new BanUserRequest instance. -
Method Summary
Methods inherited from class sfs3.client.requests.BaseRequest
getId, getRequest, getTargetController, getTransportType, setId, setTargetController, setTransportType
-
Field Details
-
KEY_USER_ID
- See Also:
- Internal
-
KEY_MESSAGE
- See Also:
- Internal
-
KEY_DELAY
- See Also:
- Internal
-
KEY_BAN_MODE
- See Also:
- Internal
-
KEY_BAN_DURATION_HOURS
- See Also:
- Internal
-
-
Constructor Details
-
BanUserRequest
Creates a new BanUserRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.- Parameters:
userId- The id of the user to be banned.message- A custom message to be delivered to the user before banning him; ifnull, the default message configured in the SmartFoxServer 3 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.- See Also:
-
BanUserRequest
- See Also:
-
BanUserRequest
- See Also:
-
BanUserRequest
- See Also:
-
BanUserRequest
public BanUserRequest(int userId) - See Also:
-
-
Method Details
-
validate
- Throws:
SFSValidationException- Internal
-
execute
- Internal
-