|
||||||||||
| 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.ChangeRoomCapacityRequest
public class ChangeRoomCapacityRequest
Changes the maximum number of users and/or spectators who can join a Room.
If the operation is successful, the roomCapacityChange event is dispatched to all the users who subscribed the Group to which the target Room belongs, including the requester user himself. If the user is not the creator (owner) of the Room, or if the Room was configured so that capacity changing is not allowed (see the RoomSettings.permissions parameter), the roomCapacityChangeError event if fired. An administrator or moderator can override the first constrain (he is not requested to be the Room's owner).
In case the Room's capacity is reduced to a value less than the current number of users/spectators inside the Room, exceeding users are NOT disconnected.
Example
SFSEvent.ROOM_CAPACITY_CHANGE,
SFSEvent.ROOM_CAPACITY_CHANGE_ERROR,
RoomSettings.getPermissions()| Field Summary | |
|---|---|
static java.lang.String |
KEY_ROOM
*Private* |
static java.lang.String |
KEY_SPEC_SIZE
*Private* |
static java.lang.String |
KEY_USER_SIZE
*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 | |
|---|---|
ChangeRoomCapacityRequest(Room room,
int newMaxUsers,
int newMaxSpect)
Creates a new ChangeRoomCapacityRequest 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_ROOM
public static final java.lang.String KEY_USER_SIZE
public static final java.lang.String KEY_SPEC_SIZE
| Constructor Detail |
|---|
public ChangeRoomCapacityRequest(Room room,
int newMaxUsers,
int newMaxSpect)
room - The Room object corresponding to the Room whose capacity should be changed.newMaxUsers - The new maximum number of users/players who can join the Room; the -1 value can be passed not to change the Room.maxUsers property.newMaxSpect - The new maximum number of spectators who can join the Room (for Game Rooms only); the -1 value can be passed not to change the Room.maxSpectators property.SmartFox.send(sfs2x.client.requests.IRequest),
Room.getMaxUsers()| 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 | |||||||||