QuickJoinGameRequest

Quickly joins the User in a public Game Room.


By providing a matching expression and a list of Rooms or Groups, SmartFoxServer can search for a matching public Game Room and immediately join the User into that Room as a Player.

If a Game Room is found and joined, the SFSEvent.ROOM_JOIN event is dispatched to the requester's client.

Constructor

new QuickJoinGameRequest(whereToSearch, matchExpressionopt, roomToLeaveopt)

Creates a new instance of the QuickJoinGameRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
whereToSearchArray.<SFSRoom> | Array.<string>A list of SFSRoom objects or Group names among which a Game Room to join should be searched; the maximum number of elements in this list is 32.
matchExpressionMatchExpression<optional>
nullA matching expression containing additional criteria to refine the Game Room search; if null, the first available Room is joined.
roomToLeaveSFSRoom<optional>
nullAn object representing a previously joined Room that the User should leave when joining the Game Room.