ChangeRoomCapacityRequest Class |
Namespace: Sfs2X.Requests
public class ChangeRoomCapacityRequest : BaseRequest
The ChangeRoomCapacityRequest type exposes the following members.
Name | Description | |
---|---|---|
ChangeRoomCapacityRequest |
Creates a new ChangeRoomCapacityRequest instance.
|
Please note that some limitations are applied to the passed values (i.e. a client can't set the max users to more than 200, or the max spectators to more than 32).
Alos, if the Room was configured so that resizing is not allowed (see the RoomSettings.Permissions parameter), the request is ignored and no error is fired.
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.
void SomeMethod() { sfs.AddEventListener(SFSEvent.ROOM_CAPACITY_CHANGE, OnRoomCapacityChange); sfs.AddEventListener(SFSEvent.ROOM_CAPACITY_CHANGE_ERROR, OnRoomCapacityChangeError); Room theRoom = sfs.GetRoomByName("Gonzo's Room"); // Resize the Room so that it allows a maximum of 100 users and zero spectators sfs.Send( new ChangeRoomCapacityRequest(theRoom, 100, 0) ); } void OnRoomCapacityChange(BaseEvent evt) { Room room = (Room)evt.Params["room"]; Console.WriteLine("The capacity of Room " + room.Name + " was changed successfully"); // .Net / Unity System.Diagnostics.Debug.WriteLine("The capacity of Room " + room.Name + " was changed successfully"); // UWP } void OnRoomCapacityChangeError(BaseEvent evt) { Console.WriteLine("Room capacity change failed: " + (string)evt.Params["errorMessage"]); // .Net / Unity System.Diagnostics.Debug.WriteLine("Room capacity change failed: " + (string)evt.Params["errorMessage"]); // UWP }