CreateRoomRequest

Creates a new Room in the current Zone.


Depending on the type of object passed to the constructor' settings parameter (either RoomSettings or MMORoomSettings), a regular SFSRoom or an MMORoom can be created.

If the creation is successful, a SFSEvent.ROOM_ADD event is dispatched to all the Users which subscribed the Group to which the Room belongs, including the Room creator. Otherwise, a SFSEvent.ROOM_CREATION_ERROR event is returned to the creator's client.

Constructor

new CreateRoomRequest(settings, autoJoinopt, roomToLeaveopt)

Creates a new instance of the CreateRoomRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
settingsRoomSettingsAn object containing the Room configuration settings.
autoJoinboolean<optional>
falseIf true, the Room is joined as soon as it is created.
roomToLeaveSFSRoom<optional>
nullAn object representing a previously joined Room that should be left if the new Room is auto-joined.