BanUsersFromRoomRequest

Banishes a group of Users (max 10) from a Room for a certain amount of time.


The current User must be the owner of the Room, or have administration or moderation privileges, in order to ban other Users (see the SFSUser#privilegeId property).

This request allows sending a message to the banned Users (i.e. to explain the reason of the upcoming removal from the Room), which is delivered by means of the SFSEvent.MODERATOR_MESSAGE event. If a message is sent, the action is executed after a short delay. The receiving client should also handle the SFSEvent.USER_EXIT_ROOM event, which signals that the User was removed from the Room, and update the UI accordingly.

A User banned with this request won't be able to join the Room until the banishment expires. A time interval can be provided to set the duration of the banishment.

Constructor

new BanUsersFromRoomRequest(users, room, messageopt, timeIntervalopt, timeUnitopt)

Creates a new instance of the BanUsersFromRoomRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
usersArray.<SFSUser>The list of Users to be banned (max 10).
roomSFSRoomThe object representing the Room where the ban should occur.
messagestring<optional>
nullA custom message to be delivered to the Users before the action is executed.
timeIntervalnumber<optional>
1The duration of the banishment.
timeUnitnumber<optional>
TimeUnit.HOURSThe time unit of the banishment duration.