Class ClusterJoinOrCreateRequest

  • All Implemented Interfaces:
    sfs2x.client.requests.IRequest

    public class ClusterJoinOrCreateRequest
    extends BaseRequest
    Creates a new ClusterJoinOrCreateRequest instance.

    See constructors for all the details.

    • Field Detail

      • KEY_GROUP_LIST

        public static final java.lang.String KEY_GROUP_LIST
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_ROOM_SETTINGS

        public static final java.lang.String KEY_ROOM_SETTINGS
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_MATCH_EXPRESSION

        public static final java.lang.String KEY_MATCH_EXPRESSION
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_IS_PUBLIC

        public static final java.lang.String KEY_IS_PUBLIC
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_MIN_PLAYERS

        public static final java.lang.String KEY_MIN_PLAYERS
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_INVITED_PLAYERS

        public static final java.lang.String KEY_INVITED_PLAYERS
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_INVITATION_EXPIRY

        public static final java.lang.String KEY_INVITATION_EXPIRY
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_NOTIFY_GAME_STARTED

        public static final java.lang.String KEY_NOTIFY_GAME_STARTED
        * API internal usage only *
        See Also:
        Constant Field Values
      • KEY_INVITATION_PARAMS

        public static final java.lang.String KEY_INVITATION_PARAMS
        * API internal usage only *
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClusterJoinOrCreateRequest

        public ClusterJoinOrCreateRequest​(MatchExpression matchExpression,
                                          java.util.List<java.lang.String> groupNames,
                                          RoomSettings settings)
        Creates a new ClusterJoinOrCreateRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

        The Lobby will search for a game Room that meets the desire criteria via the provided MatchExpression. If none is found it will proceed by creating a new Game Room, if the passes settings parameter is not null.

        You can also skip the search entirely and force the Lobby to create the Room on the next available Game Node, by passing a null MatchExpression or by using the specialized constructor.

        Parameters:
        matchExpression - A match expression to filter Rooms
        groupNames - List of group names to further filter the search, if null all groups will be searched
        settings - If no Rooms are found a new Room with the passed settings will be created and the User will auto-join it.
        See Also:
        SmartFox.send(sfs2x.client.requests.IRequest), ClusterRoomSettings, User, SFSObject
      • ClusterJoinOrCreateRequest

        public ClusterJoinOrCreateRequest​(MatchExpression matchExpression,
                                          java.util.List<java.lang.String> groupNames)
        Creates a new ClusterJoinOrCreateRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

        The Lobby will search for a game Room that meets the desire criteria via the provided MatchExpression.

        Parameters:
        matchExpression - A match expression to filter Rooms
        groupNames - List of group names to further filter the search, if null all groups will be searched
        See Also:
        SmartFox.send(sfs2x.client.requests.IRequest), RoomSettings, User, SFSObject
      • ClusterJoinOrCreateRequest

        public ClusterJoinOrCreateRequest​(MatchExpression matchExpression)
        Creates a new ClusterJoinOrCreateRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

        The Lobby will search for a game Room that meets the desire criteria via the provided MatchExpression.

        Parameters:
        matchExpression - A match expression to filter Rooms
        See Also:
        SmartFox.send(sfs2x.client.requests.IRequest), User, SFSObject
      • ClusterJoinOrCreateRequest

        public ClusterJoinOrCreateRequest​(RoomSettings settings)
        Creates a new ClusterJoinOrCreateRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

        The Lobby will create a game Room based on the provided settings on the next available GameNode.

        Parameters:
        settings - The room configuration settings
        See Also:
        SmartFox.send(sfs2x.client.requests.IRequest), RoomSettings, User, SFSObject
    • Method Detail

      • validate

        public void validate​(ISmartFox sfs)
                      throws sfs2x.client.exceptions.SFSValidationException
        Throws:
        sfs2x.client.exceptions.SFSValidationException
      • execute

        public void execute​(ISmartFox sfs)
                     throws com.smartfoxserver.v2.exceptions.SFSException
        Throws:
        com.smartfoxserver.v2.exceptions.SFSException