Interface GameSession.Builder

    • Method Detail

      • gameSessionId

        GameSession.Builder gameSessionId​(String gameSessionId)

        A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .

        Parameters:
        gameSessionId - A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • name

        GameSession.Builder name​(String name)

        A descriptive label that is associated with a game session. Session names do not need to be unique.

        Parameters:
        name - A descriptive label that is associated with a game session. Session names do not need to be unique.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • fleetId

        GameSession.Builder fleetId​(String fleetId)

        A unique identifier for the fleet that the game session is running on.

        Parameters:
        fleetId - A unique identifier for the fleet that the game session is running on.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • fleetArn

        GameSession.Builder fleetArn​(String fleetArn)

        The Amazon Resource Name (ARN) associated with the GameLift fleet that this game session is running on.

        Parameters:
        fleetArn - The Amazon Resource Name (ARN) associated with the GameLift fleet that this game session is running on.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • creationTime

        GameSession.Builder creationTime​(Instant creationTime)

        A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        Parameters:
        creationTime - A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • terminationTime

        GameSession.Builder terminationTime​(Instant terminationTime)

        A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        Parameters:
        terminationTime - A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • currentPlayerSessionCount

        GameSession.Builder currentPlayerSessionCount​(Integer currentPlayerSessionCount)

        Number of players currently in the game session.

        Parameters:
        currentPlayerSessionCount - Number of players currently in the game session.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • maximumPlayerSessionCount

        GameSession.Builder maximumPlayerSessionCount​(Integer maximumPlayerSessionCount)

        The maximum number of players that can be connected simultaneously to the game session.

        Parameters:
        maximumPlayerSessionCount - The maximum number of players that can be connected simultaneously to the game session.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • status

        GameSession.Builder status​(String status)

        Current status of the game session. A game session must have an ACTIVE status to have player sessions.

        Parameters:
        status - Current status of the game session. A game session must have an ACTIVE status to have player sessions.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        GameSessionStatus, GameSessionStatus
      • status

        GameSession.Builder status​(GameSessionStatus status)

        Current status of the game session. A game session must have an ACTIVE status to have player sessions.

        Parameters:
        status - Current status of the game session. A game session must have an ACTIVE status to have player sessions.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        GameSessionStatus, GameSessionStatus
      • statusReason

        GameSession.Builder statusReason​(String statusReason)

        Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

        Parameters:
        statusReason - Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        GameSessionStatusReason, GameSessionStatusReason
      • statusReason

        GameSession.Builder statusReason​(GameSessionStatusReason statusReason)

        Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

        Parameters:
        statusReason - Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        GameSessionStatusReason, GameSessionStatusReason
      • gameProperties

        GameSession.Builder gameProperties​(Collection<GameProperty> gameProperties)

        A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}.

        Parameters:
        gameProperties - A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • gameProperties

        GameSession.Builder gameProperties​(GameProperty... gameProperties)

        A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}.

        Parameters:
        gameProperties - A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • gameProperties

        GameSession.Builder gameProperties​(Consumer<GameProperty.Builder>... gameProperties)

        A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}.

        This is a convenience method that creates an instance of the GameProperty.Builder avoiding the need to create one manually via GameProperty.builder().

        When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to #gameProperties(List).

        Parameters:
        gameProperties - a consumer that will call methods on GameProperty.Builder
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        #gameProperties(java.util.Collection)
      • ipAddress

        GameSession.Builder ipAddress​(String ipAddress)

        The IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        Parameters:
        ipAddress - The IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • dnsName

        GameSession.Builder dnsName​(String dnsName)

        The DNS identifier assigned to the instance that is running the game session. Values have the following format:

        • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

        • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

        When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        Parameters:
        dnsName - The DNS identifier assigned to the instance that is running the game session. Values have the following format:

        • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

        • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

        When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • port

        GameSession.Builder port​(Integer port)

        The port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        Parameters:
        port - The port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • playerSessionCreationPolicy

        GameSession.Builder playerSessionCreationPolicy​(String playerSessionCreationPolicy)

        Indicates whether or not the game session is accepting new players.

        Parameters:
        playerSessionCreationPolicy - Indicates whether or not the game session is accepting new players.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        PlayerSessionCreationPolicy, PlayerSessionCreationPolicy
      • creatorId

        GameSession.Builder creatorId​(String creatorId)

        A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

        Parameters:
        creatorId - A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • gameSessionData

        GameSession.Builder gameSessionData​(String gameSessionData)

        A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see Start a Game Session).

        Parameters:
        gameSessionData - A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see Start a Game Session).
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • matchmakerData

        GameSession.Builder matchmakerData​(String matchmakerData)

        Information about the matchmaking process that resulted in the game session, if matchmaking was used. Data is in JSON syntax, formatted as a string. Information includes the matchmaker ID as well as player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).

        Parameters:
        matchmakerData - Information about the matchmaking process that resulted in the game session, if matchmaking was used. Data is in JSON syntax, formatted as a string. Information includes the matchmaker ID as well as player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is updated whenever new players are added during a successful backfill (see StartMatchBackfill).
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • location

        GameSession.Builder location​(String location)

        The fleet location where the game session is running. This value might specify the fleet's home Region or a remote location. Location is expressed as an Amazon Web Services Region code such as us-west-2.

        Parameters:
        location - The fleet location where the game session is running. This value might specify the fleet's home Region or a remote location. Location is expressed as an Amazon Web Services Region code such as us-west-2.
        Returns:
        Returns a reference to this object so that method calls can be chained together.