Class: CreateRoomSettings

CreateRoomSettings


The CreateRoomSettings class allows to configure how a new Room will work under many different aspects, from its size to the events it can fire, permissions and a lot more.

Basic settings

A minimal Room configuration should always contain the following parameters:

  • name: the name of the Room, must be unique
  • password: (optional) the password to enter to join the Room, for private Rooms
  • maxUsers: the maximum number of users allowed to join the Room
  • maxVariablesAllowed: the maximum number of Room Variables allowed in the Room
  • isGame: (optional, default false) a flag to indicate if the Room is going to be used for games (it is a "Game Room")
  • maxSpectators: (optional) in a Game Room, the maximum number of spectators allowed to join it

More settings

The following settings help defining other important features of a Room:

  • groupId: the name of the Group to which the Room will be assigned
  • idDynamic: a flag indicating that the Room is dynamic
  • isHidden: a flag indicating if the Room should concealed from the Room List sent to clients
  • autoRemoveMode: a SFSRoomRemoveMode value to configure when the Room, if dynamic, should be destroyed
  • roomVariables: an array of SFSRoomVariable objects that will be added to the Room upon creation
  • extension: a RoomExtensionSettings instance defining the server side Extension to be dynamically attached to the Room, to add custom logic for games and applications

Advanced settings

The following settings help defines the most advanced features of a Room:

  • roomSettings: an EnumSet of SFSRoomSettings values that specify permissions and events used by the Room
  • useWordsFilter: a flag to indicate if the bad words filter is enable on the Room
  • customPlayerIdGeneratorClass: a custom class that handles the generation of player id(s) for Game Rooms
  • allowOwnerOnlyInvitation: a flag indicating if the Room's owner only is allowed to send invitations to join the Room to other users
  • roomProperties: a map of custom, server side only properties attached to the Room

Notes

See also


new CreateRoomSettings()

Creates a new CreateRoomSettings instance.