Amazon GameLift

2018/02/08 - Amazon GameLift - 1 new 8 updated api methods

Changes  Amazon GameLift FlexMatch added the StartMatchBackfill API. This API allows developers to add new players to an existing game session using the same matchmaking rules and player data that were used to initially create the session.

StartMatchBackfill (new) Link ¶

Finds new players to fill open slots in an existing game session. This operation can be used to add players to matched games that start with fewer than the maximum number of players or to replace players when they drop out. By backfilling with the same matchmaker used to create the original match, you ensure that new players meet the match criteria and maintain a consistent experience throughout the game session. You can backfill a match anytime after a game session has been created.

To request a match backfill, specify a unique ticket ID, the existing game session's ARN, a matchmaking configuration, and a set of data that describes all current players in the game session. If successful, a match backfill ticket is created and returned with status set to QUEUED. The ticket is placed in the matchmaker's ticket pool and processed. Track the status of the ticket to respond as needed. For more detail how to set up backfilling, see Set up Match Backfilling .

The process of finding backfill matches is essentially identical to the initial matchmaking process. The matchmaker searches the pool and groups tickets together to form potential matches, allowing only one backfill ticket per potential match. Once the a match is formed, the matchmaker creates player sessions for the new players. All tickets in the match are updated with the game session's connection information, and the GameSession object is updated to include matchmaker data on the new players. For more detail on how match backfill requests are processed, see How Amazon GameLift FlexMatch Works .

Matchmaking-related operations include:

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

See also: AWS API Documentation

Request Syntax

client.start_match_backfill(
    TicketId='string',
    ConfigurationName='string',
    GameSessionArn='string',
    Players=[
        {
            'PlayerId': 'string',
            'PlayerAttributes': {
                'string': {
                    'S': 'string',
                    'N': 123.0,
                    'SL': [
                        'string',
                    ],
                    'SDM': {
                        'string': 123.0
                    }
                }
            },
            'Team': 'string',
            'LatencyInMs': {
                'string': 123
            }
        },
    ]
)
type TicketId

string

param TicketId

Unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status and retrieve match results.

type ConfigurationName

string

param ConfigurationName

[REQUIRED]

Name of the matchmaker to use for this request. The name of the matchmaker that was used with the original game session is listed in the GameSession object, MatchmakerData property. This property contains a matchmaking configuration ARN value, which includes the matchmaker name. (In the ARN value "arn:aws:gamelift:us-west-2:111122223333:matchmakingconfiguration/MM-4v4", the matchmaking configuration name is "MM-4v4".) Use only the name for this parameter.

type GameSessionArn

string

param GameSessionArn

[REQUIRED]

Amazon Resource Name (ARN ) that is assigned to a game session and uniquely identifies it.

type Players

list

param Players

[REQUIRED]

Match information on all players that are currently assigned to the game session. This information is used by the matchmaker to find new players and add them to the existing game.

  • PlayerID, PlayerAttributes, Team -- This information is maintained in the GameSession object, MatchmakerData property, for all players who are currently assigned to the game session. The matchmaker data is in JSON syntax, formatted as a string. For more details, see Match Data .

  • LatencyInMs -- If the matchmaker uses player latency, include a latency value, in milliseconds, for the region that the game session is currently in. Do not include latency values for any other region.

  • (dict) --

    Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

    • PlayerId (string) --

      Unique identifier for a player

    • PlayerAttributes (dict) --

      Collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}} .

      • (string) --

        • (dict) --

          Values for use in Player attribute key:value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array or data map. Each AttributeValue object can use only one of the available properties.

          • S (string) --

            For single string values. Maximum string length is 100 characters.

          • N (float) --

            For number values, expressed as double.

          • SL (list) --

            For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

            • (string) --

          • SDM (dict) --

            For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

            • (string) --

              • (float) --

    • Team (string) --

      Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

    • LatencyInMs (dict) --

      Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions. If this property is present, FlexMatch considers placing the match only in regions for which latency is reported.

      If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no regions are available to the player and the ticket is not matchable.

      • (string) --

        • (integer) --

rtype

dict

returns

Response Syntax

{
    'MatchmakingTicket': {
        'TicketId': 'string',
        'ConfigurationName': 'string',
        'Status': 'CANCELLED'|'COMPLETED'|'FAILED'|'PLACING'|'QUEUED'|'REQUIRES_ACCEPTANCE'|'SEARCHING'|'TIMED_OUT',
        'StatusReason': 'string',
        'StatusMessage': 'string',
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'Players': [
            {
                'PlayerId': 'string',
                'PlayerAttributes': {
                    'string': {
                        'S': 'string',
                        'N': 123.0,
                        'SL': [
                            'string',
                        ],
                        'SDM': {
                            'string': 123.0
                        }
                    }
                },
                'Team': 'string',
                'LatencyInMs': {
                    'string': 123
                }
            },
        ],
        'GameSessionConnectionInfo': {
            'GameSessionArn': 'string',
            'IpAddress': 'string',
            'Port': 123,
            'MatchedPlayerSessions': [
                {
                    'PlayerId': 'string',
                    'PlayerSessionId': 'string'
                },
            ]
        },
        'EstimatedWaitTime': 123
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • MatchmakingTicket (dict) --

      Ticket representing the backfill matchmaking request. This object includes the information in the request, ticket status, and match results as generated during the matchmaking process.

      • TicketId (string) --

        Unique identifier for a matchmaking ticket.

      • ConfigurationName (string) --

        Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.

      • Status (string) --

        Current status of the matchmaking request.

        • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

        • SEARCHING -- The matchmaking request is currently being processed.

        • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match (see AcceptMatch ). This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

        • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

        • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

        • FAILED -- The matchmaking request was not completed. Tickets with players who fail to accept a proposed match are placed in FAILED status.

        • CANCELLED -- The matchmaking request was canceled with a call to StopMatchmaking .

        • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

        Note

        Matchmaking requests that fail to successfully complete (statuses FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with new ticket IDs.

      • StatusReason (string) --

        Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.

      • StatusMessage (string) --

        Additional information about the current status.

      • StartTime (datetime) --

        Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when the matchmaking request stopped being processed due to successful completion, timeout, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • Players (list) --

        A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED , the Player objects include the team the players were assigned to in the resulting match.

        • (dict) --

          Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

          • PlayerId (string) --

            Unique identifier for a player

          • PlayerAttributes (dict) --

            Collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}} .

            • (string) --

              • (dict) --

                Values for use in Player attribute key:value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array or data map. Each AttributeValue object can use only one of the available properties.

                • S (string) --

                  For single string values. Maximum string length is 100 characters.

                • N (float) --

                  For number values, expressed as double.

                • SL (list) --

                  For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

                  • (string) --

                • SDM (dict) --

                  For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

                  • (string) --

                    • (float) --

          • Team (string) --

            Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

          • LatencyInMs (dict) --

            Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions. If this property is present, FlexMatch considers placing the match only in regions for which latency is reported.

            If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no regions are available to the player and the ticket is not matchable.

            • (string) --

              • (integer) --

      • GameSessionConnectionInfo (dict) --

        Identifier and connection information of the game session created for the match. This information is added to the ticket only after the matchmaking request has been successfully completed.

        • GameSessionArn (string) --

          Amazon Resource Name (ARN ) that is assigned to a game session and uniquely identifies it.

        • IpAddress (string) --

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

        • Port (integer) --

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

        • MatchedPlayerSessions (list) --

          Collection of player session IDs, one for each player ID that was included in the original matchmaking request.

          • (dict) --

            Represents a new player session that is created as a result of a successful FlexMatch match. A successful match automatically creates new player sessions for every player ID in the original matchmaking request.

            When players connect to the match's game session, they must include both player ID and player session ID in order to claim their assigned player slot.

            • PlayerId (string) --

              Unique identifier for a player

            • PlayerSessionId (string) --

              Unique identifier for a player session

      • EstimatedWaitTime (integer) --

        Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.

CreateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'MatchmakerData': 'string'}}

Creates a multiplayer game session for players. This action creates a game session record and assigns an available server process in the specified fleet to host the game session. A fleet must have an ACTIVE status before a game session can be created in it.

To create a game session, specify either fleet ID or alias ID and indicate a maximum number of players to allow in the game session. You can also provide a name and game-specific properties for this game session. If successful, a GameSession object is returned containing the game session properties and other settings you specified.

Idempotency tokens. You can add a token that uniquely identifies game session requests. This is useful for ensuring that game session requests are idempotent. Multiple requests with the same idempotency token are processed only once; subsequent requests return the original result. All response values are the same with the exception of game session status, which may change.

Resource creation limits. If you are creating a game session on a fleet with a resource creation limit policy in force, then you must specify a creator ID. Without this ID, Amazon GameLift has no way to evaluate the policy for this new game session request.

Player acceptance policy. By default, newly created game sessions are open to new players. You can restrict new player access by using UpdateGameSession to change the game session's player session creation policy.

Game session logs. Logs are retained for all active game sessions for 14 days. To access the logs, call GetGameSessionLogUrl to download the log files.

Available in Amazon GameLift Local.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_game_session(
    FleetId='string',
    AliasId='string',
    MaximumPlayerSessionCount=123,
    Name='string',
    GameProperties=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    CreatorId='string',
    GameSessionId='string',
    IdempotencyToken='string',
    GameSessionData='string'
)
type FleetId

string

param FleetId

Unique identifier for a fleet to create a game session in. Each request must reference either a fleet ID or alias ID, but not both.

type AliasId

string

param AliasId

Unique identifier for an alias associated with the fleet to create a game session in. Each request must reference either a fleet ID or alias ID, but not both.

type MaximumPlayerSessionCount

integer

param MaximumPlayerSessionCount

[REQUIRED]

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

type Name

string

param Name

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

type GameProperties

list

param GameProperties

Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).

  • (dict) --

    Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

    • Key (string) -- [REQUIRED]

      Game property identifier.

    • Value (string) -- [REQUIRED]

      Game property value.

type CreatorId

string

param CreatorId

Unique identifier for a player or entity creating the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.

type GameSessionId

string

param GameSessionId

This parameter is no longer preferred. Please use ``IdempotencyToken`` instead. Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .)

type IdempotencyToken

string

param IdempotencyToken

Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .) Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.

type GameSessionData

string

param GameSessionData

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

rtype

dict

returns

Response Syntax

{
    'GameSession': {
        'GameSessionId': 'string',
        'Name': 'string',
        'FleetId': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'CurrentPlayerSessionCount': 123,
        'MaximumPlayerSessionCount': 123,
        'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'Port': 123,
        'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
        'CreatorId': 'string',
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSession (dict) --

      Object that describes the newly created game session record.

      • GameSessionId (string) --

        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> .

      • Name (string) --

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

      • FleetId (string) --

        Unique identifier for a fleet that the game session is running on.

      • CreationTime (datetime) --

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

      • TerminationTime (datetime) --

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

      • CurrentPlayerSessionCount (integer) --

        Number of players currently in the game session.

      • MaximumPlayerSessionCount (integer) --

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

      • Status (string) --

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

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

          • Key (string) --

            Game property identifier.

          • Value (string) --

            Game property value.

      • IpAddress (string) --

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

      • Port (integer) --

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

      • PlayerSessionCreationPolicy (string) --

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

      • CreatorId (string) --

        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.

      • GameSessionData (string) --

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

      • MatchmakerData (string) --

        Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).

DescribeGameSessionDetails (updated) Link ¶
Changes (response)
{'GameSessionDetails': {'GameSession': {'MatchmakerData': 'string'}}}

Retrieves properties, including the protection policy in force, for one or more game sessions. This action can be used in several ways: (1) provide a GameSessionId or GameSessionArn to request details for a specific game session; (2) provide either a FleetId or an AliasId to request properties for all game sessions running on a fleet.

To get game session record(s), specify just one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSessionDetail object is returned for each session matching the request.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_game_session_details(
    FleetId='string',
    GameSessionId='string',
    AliasId='string',
    StatusFilter='string',
    Limit=123,
    NextToken='string'
)
type FleetId

string

param FleetId

Unique identifier for a fleet to retrieve all game sessions active on the fleet.

type GameSessionId

string

param GameSessionId

Unique identifier for the game session to retrieve.

type AliasId

string

param AliasId

Unique identifier for an alias associated with the fleet to retrieve all game sessions for.

type StatusFilter

string

param StatusFilter

Game session status to filter results on. Possible game session statuses include ACTIVE , TERMINATED , ACTIVATING and TERMINATING (the last two are transitory).

type Limit

integer

param Limit

Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken

string

param NextToken

Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.

rtype

dict

returns

Response Syntax

{
    'GameSessionDetails': [
        {
            'GameSession': {
                'GameSessionId': 'string',
                'Name': 'string',
                'FleetId': 'string',
                'CreationTime': datetime(2015, 1, 1),
                'TerminationTime': datetime(2015, 1, 1),
                'CurrentPlayerSessionCount': 123,
                'MaximumPlayerSessionCount': 123,
                'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
                'GameProperties': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'IpAddress': 'string',
                'Port': 123,
                'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
                'CreatorId': 'string',
                'GameSessionData': 'string',
                'MatchmakerData': 'string'
            },
            'ProtectionPolicy': 'NoProtection'|'FullProtection'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionDetails (list) --

      Collection of objects containing game session properties and the protection policy currently in force for each session matching the request.

      • (dict) --

        A game session's properties plus the protection policy currently in force.

        • GameSession (dict) --

          Object that describes a game session.

          • GameSessionId (string) --

            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> .

          • Name (string) --

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

          • FleetId (string) --

            Unique identifier for a fleet that the game session is running on.

          • CreationTime (datetime) --

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

          • TerminationTime (datetime) --

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

          • CurrentPlayerSessionCount (integer) --

            Number of players currently in the game session.

          • MaximumPlayerSessionCount (integer) --

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

          • Status (string) --

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

          • GameProperties (list) --

            Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .

            • (dict) --

              Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

              • Key (string) --

                Game property identifier.

              • Value (string) --

                Game property value.

          • IpAddress (string) --

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

          • Port (integer) --

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

          • PlayerSessionCreationPolicy (string) --

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

          • CreatorId (string) --

            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.

          • GameSessionData (string) --

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

          • MatchmakerData (string) --

            Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).

        • ProtectionPolicy (string) --

          Current status of protection for the game session.

          • NoProtection -- The game session can be terminated during a scale-down event.

          • FullProtection -- If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.

    • NextToken (string) --

      Token that indicates where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.

DescribeGameSessionPlacement (updated) Link ¶
Changes (response)
{'GameSessionPlacement': {'MatchmakerData': 'string'}}

Retrieves properties and current status of a game session placement request. To get game session placement details, specify the placement ID. If successful, a GameSessionPlacement object is returned.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_game_session_placement(
    PlacementId='string'
)
type PlacementId

string

param PlacementId

[REQUIRED]

Unique identifier for a game session placement to retrieve.

rtype

dict

returns

Response Syntax

{
    'GameSessionPlacement': {
        'PlacementId': 'string',
        'GameSessionQueueName': 'string',
        'Status': 'PENDING'|'FULFILLED'|'CANCELLED'|'TIMED_OUT',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'MaximumPlayerSessionCount': 123,
        'GameSessionName': 'string',
        'GameSessionId': 'string',
        'GameSessionArn': 'string',
        'GameSessionRegion': 'string',
        'PlayerLatencies': [
            {
                'PlayerId': 'string',
                'RegionIdentifier': 'string',
                'LatencyInMilliseconds': ...
            },
        ],
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'IpAddress': 'string',
        'Port': 123,
        'PlacedPlayerSessions': [
            {
                'PlayerId': 'string',
                'PlayerSessionId': 'string'
            },
        ],
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionPlacement (dict) --

      Object that describes the requested game session placement.

      • PlacementId (string) --

        Unique identifier for a game session placement.

      • GameSessionQueueName (string) --

        Descriptive label that is associated with game session queue. Queue names must be unique within each region.

      • Status (string) --

        Current status of the game session placement request.

        • PENDING -- The placement request is currently in the queue waiting to be processed.

        • FULFILLED -- A new game session and player sessions (if requested) have been successfully created. Values for GameSessionArn and GameSessionRegion are available.

        • CANCELLED -- The placement request was canceled with a call to StopGameSessionPlacement .

        • TIMED_OUT -- A new game session was not successfully created before the time limit expired. You can resubmit the placement request as needed.

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

          • Key (string) --

            Game property identifier.

          • Value (string) --

            Game property value.

      • MaximumPlayerSessionCount (integer) --

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

      • GameSessionName (string) --

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

      • GameSessionId (string) --

        Unique identifier for the game session. This value is set once the new game session is placed (placement status is FULFILLED ).

      • GameSessionArn (string) --

        Identifier for the game session created by this placement request. This value is set once the new game session is placed (placement status is FULFILLED ). This identifier is unique across all regions. You can use this value as a GameSessionId value as needed.

      • GameSessionRegion (string) --

        Name of the region where the game session created by this placement request is running. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlayerLatencies (list) --

        Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions.

        • (dict) --

          Regional latency information for a player, used when requesting a new game session with StartGameSessionPlacement . This value indicates the amount of time lag that exists when the player is connected to a fleet in the specified region. The relative difference between a player's latency values for multiple regions are used to determine which fleets are best suited to place a new game session for the player.

          • PlayerId (string) --

            Unique identifier for a player associated with the latency data.

          • RegionIdentifier (string) --

            Name of the region that is associated with the latency value.

          • LatencyInMilliseconds (float) --

            Amount of time that represents the time lag experienced by the player when connected to the specified region.

      • StartTime (datetime) --

        Time stamp indicating when this request was placed in the queue. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when this request was completed, canceled, or timed out.

      • IpAddress (string) --

        IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlacedPlayerSessions (list) --

        Collection of information on player sessions created in response to the game session placement request. These player sessions are created only once a new game session is successfully placed (placement status is FULFILLED ). This information includes the player ID (as provided in the placement request) and the corresponding player session ID. Retrieve full player sessions by calling DescribePlayerSessions with the player session ID.

        • (dict) --

          Information about a player session that was created as part of a StartGameSessionPlacement request. This object contains only the player ID and player session ID. To retrieve full details on a player session, call DescribePlayerSessions with the player session ID.

          Player-session-related operations include:

          • CreatePlayerSession

          • CreatePlayerSessions

          • DescribePlayerSessions

          • Game session placements

            • StartGameSessionPlacement

            • DescribeGameSessionPlacement

            • StopGameSessionPlacement

          • PlayerId (string) --

            Unique identifier for a player that is associated with this player session.

          • PlayerSessionId (string) --

            Unique identifier for a player session.

      • GameSessionData (string) --

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

      • MatchmakerData (string) --

        Information on the matchmaking process for this game. Data is in JSON syntax, formated as a string. It identifies the matchmaking configuration used to create the match, and contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see http://docs.aws.amazon.com/gamelift/latest/developerguide/match-server.html#match-server-data .

DescribeGameSessions (updated) Link ¶
Changes (response)
{'GameSessions': {'MatchmakerData': 'string'}}

Retrieves a set of one or more game sessions. Request a specific game session or request all game sessions on a fleet. Alternatively, use SearchGameSessions to request a set of active game sessions that are filtered by certain criteria. To retrieve protection policy settings for game sessions, use DescribeGameSessionDetails .

To get game sessions, specify one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSession object is returned for each game session matching the request.

Available in Amazon GameLift Local.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_game_sessions(
    FleetId='string',
    GameSessionId='string',
    AliasId='string',
    StatusFilter='string',
    Limit=123,
    NextToken='string'
)
type FleetId

string

param FleetId

Unique identifier for a fleet to retrieve all game sessions for.

type GameSessionId

string

param GameSessionId

Unique identifier for the game session to retrieve. You can use either a GameSessionId or GameSessionArn value.

type AliasId

string

param AliasId

Unique identifier for an alias associated with the fleet to retrieve all game sessions for.

type StatusFilter

string

param StatusFilter

Game session status to filter results on. Possible game session statuses include ACTIVE , TERMINATED , ACTIVATING , and TERMINATING (the last two are transitory).

type Limit

integer

param Limit

Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken

string

param NextToken

Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.

rtype

dict

returns

Response Syntax

{
    'GameSessions': [
        {
            'GameSessionId': 'string',
            'Name': 'string',
            'FleetId': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'CurrentPlayerSessionCount': 123,
            'MaximumPlayerSessionCount': 123,
            'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'Port': 123,
            'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
            'CreatorId': 'string',
            'GameSessionData': 'string',
            'MatchmakerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessions (list) --

      Collection of objects containing game session properties for each session matching the request.

      • (dict) --

        Properties describing a game session.

        A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED .

        Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.

        Game-session-related operations include:

        • CreateGameSession

        • DescribeGameSessions

        • DescribeGameSessionDetails

        • SearchGameSessions

        • UpdateGameSession

        • GetGameSessionLogUrl

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • GameSessionId (string) --

          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> .

        • Name (string) --

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

        • FleetId (string) --

          Unique identifier for a fleet that the game session is running on.

        • CreationTime (datetime) --

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

        • TerminationTime (datetime) --

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

        • CurrentPlayerSessionCount (integer) --

          Number of players currently in the game session.

        • MaximumPlayerSessionCount (integer) --

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

        • Status (string) --

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

        • GameProperties (list) --

          Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .

          • (dict) --

            Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

            • Key (string) --

              Game property identifier.

            • Value (string) --

              Game property value.

        • IpAddress (string) --

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

        • Port (integer) --

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

        • PlayerSessionCreationPolicy (string) --

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

        • CreatorId (string) --

          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.

        • GameSessionData (string) --

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

        • MatchmakerData (string) --

          Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).

    • NextToken (string) --

      Token that indicates where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.

SearchGameSessions (updated) Link ¶
Changes (response)
{'GameSessions': {'MatchmakerData': 'string'}}

Retrieves all active game sessions that match a set of search criteria and sorts them in a specified order. You can search or sort by the following game session attributes:

  • gameSessionId -- Unique identifier for the game session. You can use either a GameSessionId or GameSessionArn value.

  • gameSessionName -- Name assigned to a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession . Game session names do not need to be unique to a game session.

  • gameSessionProperties -- Custom data defined in a game session's GameProperty parameter. GameProperty values are stored as key:value pairs; the filter expression must indicate the key and a string to search the data values for. For example, to search for game sessions with custom data containing the key:value pair "gameMode:brawl", specify the following: gameSessionProperties.gameMode = "brawl". All custom data values are searched as strings.

  • maximumSessions -- Maximum number of player sessions allowed for a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession .

  • creationTimeMillis -- Value indicating when a game session was created. It is expressed in Unix time as milliseconds.

  • playerSessionCount -- Number of players currently connected to a game session. This value changes rapidly as players join the session or drop out.

  • hasAvailablePlayerSessions -- Boolean value indicating whether a game session has reached its maximum number of players. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.

Note

Returned values for playerSessionCount and hasAvailablePlayerSessions change quickly as players join sessions and others drop out. Results should be considered a snapshot in time. Be sure to refresh search results often, and handle sessions that fill up before a player can join.

To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. If successful, a collection of GameSession objects matching the request is returned. Use the pagination parameters to retrieve results as a set of sequential pages.

You can search for game sessions one fleet at a time only. To find game sessions across multiple fleets, you must search each fleet separately and combine the results. This search feature finds only game sessions that are in ACTIVE status. To locate games in statuses other than active, use DescribeGameSessionDetails .

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.search_game_sessions(
    FleetId='string',
    AliasId='string',
    FilterExpression='string',
    SortExpression='string',
    Limit=123,
    NextToken='string'
)
type FleetId

string

param FleetId

Unique identifier for a fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.

type AliasId

string

param AliasId

Unique identifier for an alias associated with the fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.

type FilterExpression

string

param FilterExpression

String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in ACTIVE status.

A filter expression can contain one or multiple conditions. Each condition consists of the following:

  • Operand -- Name of a game session attribute. Valid values are gameSessionName , gameSessionId , gameSessionProperties , maximumSessions , creationTimeMillis , playerSessionCount , hasAvailablePlayerSessions .

  • Comparator -- Valid comparators are: = , <> , < , > , <= , >= .

  • Value -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators = and <> . For example, the following filter expression searches on gameSessionName : "FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'" .

To chain multiple conditions in a single expression, use the logical keywords AND , OR , and NOT and parentheses as needed. For example: x AND y AND NOT z , NOT (x OR y) .

Session search evaluates conditions from left to right using the following precedence rules:

  • = , <> , < , > , <= , >=

  • Parentheses

  • NOT

  • AND

  • OR

For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: "maximumSessions>=10 AND hasAvailablePlayerSessions=true" .

type SortExpression

string

param SortExpression

Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:

  • Operand -- Name of a game session attribute. Valid values are gameSessionName , gameSessionId , gameSessionProperties , maximumSessions , creationTimeMillis , playerSessionCount , hasAvailablePlayerSessions .

  • Order -- Valid sort orders are ASC (ascending) and DESC (descending).

For example, this sort expression returns the oldest active sessions first: "SortExpression": "creationTimeMillis ASC" . Results with a null value for the sort operand are returned at the end of the list.

type Limit

integer

param Limit

Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.

type NextToken

string

param NextToken

Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.

rtype

dict

returns

Response Syntax

{
    'GameSessions': [
        {
            'GameSessionId': 'string',
            'Name': 'string',
            'FleetId': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'CurrentPlayerSessionCount': 123,
            'MaximumPlayerSessionCount': 123,
            'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'Port': 123,
            'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
            'CreatorId': 'string',
            'GameSessionData': 'string',
            'MatchmakerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessions (list) --

      Collection of objects containing game session properties for each session matching the request.

      • (dict) --

        Properties describing a game session.

        A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED .

        Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.

        Game-session-related operations include:

        • CreateGameSession

        • DescribeGameSessions

        • DescribeGameSessionDetails

        • SearchGameSessions

        • UpdateGameSession

        • GetGameSessionLogUrl

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • GameSessionId (string) --

          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> .

        • Name (string) --

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

        • FleetId (string) --

          Unique identifier for a fleet that the game session is running on.

        • CreationTime (datetime) --

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

        • TerminationTime (datetime) --

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

        • CurrentPlayerSessionCount (integer) --

          Number of players currently in the game session.

        • MaximumPlayerSessionCount (integer) --

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

        • Status (string) --

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

        • GameProperties (list) --

          Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .

          • (dict) --

            Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

            • Key (string) --

              Game property identifier.

            • Value (string) --

              Game property value.

        • IpAddress (string) --

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

        • Port (integer) --

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

        • PlayerSessionCreationPolicy (string) --

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

        • CreatorId (string) --

          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.

        • GameSessionData (string) --

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

        • MatchmakerData (string) --

          Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).

    • NextToken (string) --

      Token that indicates where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.

StartGameSessionPlacement (updated) Link ¶
Changes (response)
{'GameSessionPlacement': {'MatchmakerData': 'string'}}

Places a request for a new game session in a queue (see CreateGameSessionQueue ). When processing a placement request, Amazon GameLift searches for available resources on the queue's destinations, scanning each until it finds resources or the placement request times out.

A game session placement request can also request player sessions. When a new game session is successfully created, Amazon GameLift creates a player session for each player included in the request.

When placing a game session, by default Amazon GameLift tries each fleet in the order they are listed in the queue configuration. Ideally, a queue's destinations are listed in preference order.

Alternatively, when requesting a game session with players, you can also provide latency data for each player in relevant regions. Latency data indicates the performance lag a player experiences when connected to a fleet in the region. Amazon GameLift uses latency data to reorder the list of destinations to place the game session in a region with minimal lag. If latency data is provided for multiple players, Amazon GameLift calculates each region's average lag for all players and reorders to get the best game play across all players.

To place a new game session request, specify the following:

  • The queue name and a set of game session properties and settings

  • A unique ID (such as a UUID) for the placement. You use this ID to track the status of the placement request

  • (Optional) A set of IDs and player data for each player you want to join to the new game session

  • Latency data for all players (if you want to optimize game play for the players)

If successful, a new game session placement is created.

To track the status of a placement request, call DescribeGameSessionPlacement and check the request's status. If the status is FULFILLED , a new game session has been created and a game session ARN and region are referenced. If the placement request times out, you can resubmit the request or retry it with a different queue.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.start_game_session_placement(
    PlacementId='string',
    GameSessionQueueName='string',
    GameProperties=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    MaximumPlayerSessionCount=123,
    GameSessionName='string',
    PlayerLatencies=[
        {
            'PlayerId': 'string',
            'RegionIdentifier': 'string',
            'LatencyInMilliseconds': ...
        },
    ],
    DesiredPlayerSessions=[
        {
            'PlayerId': 'string',
            'PlayerData': 'string'
        },
    ],
    GameSessionData='string'
)
type PlacementId

string

param PlacementId

[REQUIRED]

Unique identifier to assign to the new game session placement. This value is developer-defined. The value must be unique across all regions and cannot be reused unless you are resubmitting a canceled or timed-out placement request.

type GameSessionQueueName

string

param GameSessionQueueName

[REQUIRED]

Name of the queue to use to place the new game session.

type GameProperties

list

param GameProperties

Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).

  • (dict) --

    Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

    • Key (string) -- [REQUIRED]

      Game property identifier.

    • Value (string) -- [REQUIRED]

      Game property value.

type MaximumPlayerSessionCount

integer

param MaximumPlayerSessionCount

[REQUIRED]

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

type GameSessionName

string

param GameSessionName

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

type PlayerLatencies

list

param PlayerLatencies

Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions. This information is used to try to place the new game session where it can offer the best possible gameplay experience for the players.

  • (dict) --

    Regional latency information for a player, used when requesting a new game session with StartGameSessionPlacement . This value indicates the amount of time lag that exists when the player is connected to a fleet in the specified region. The relative difference between a player's latency values for multiple regions are used to determine which fleets are best suited to place a new game session for the player.

    • PlayerId (string) --

      Unique identifier for a player associated with the latency data.

    • RegionIdentifier (string) --

      Name of the region that is associated with the latency value.

    • LatencyInMilliseconds (float) --

      Amount of time that represents the time lag experienced by the player when connected to the specified region.

type DesiredPlayerSessions

list

param DesiredPlayerSessions

Set of information on each player to create a player session for.

  • (dict) --

    Player information for use when creating player sessions using a game session placement request with StartGameSessionPlacement .

    • PlayerId (string) --

      Unique identifier for a player to associate with the player session.

    • PlayerData (string) --

      Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.

type GameSessionData

string

param GameSessionData

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

rtype

dict

returns

Response Syntax

{
    'GameSessionPlacement': {
        'PlacementId': 'string',
        'GameSessionQueueName': 'string',
        'Status': 'PENDING'|'FULFILLED'|'CANCELLED'|'TIMED_OUT',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'MaximumPlayerSessionCount': 123,
        'GameSessionName': 'string',
        'GameSessionId': 'string',
        'GameSessionArn': 'string',
        'GameSessionRegion': 'string',
        'PlayerLatencies': [
            {
                'PlayerId': 'string',
                'RegionIdentifier': 'string',
                'LatencyInMilliseconds': ...
            },
        ],
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'IpAddress': 'string',
        'Port': 123,
        'PlacedPlayerSessions': [
            {
                'PlayerId': 'string',
                'PlayerSessionId': 'string'
            },
        ],
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionPlacement (dict) --

      Object that describes the newly created game session placement. This object includes all the information provided in the request, as well as start/end time stamps and placement status.

      • PlacementId (string) --

        Unique identifier for a game session placement.

      • GameSessionQueueName (string) --

        Descriptive label that is associated with game session queue. Queue names must be unique within each region.

      • Status (string) --

        Current status of the game session placement request.

        • PENDING -- The placement request is currently in the queue waiting to be processed.

        • FULFILLED -- A new game session and player sessions (if requested) have been successfully created. Values for GameSessionArn and GameSessionRegion are available.

        • CANCELLED -- The placement request was canceled with a call to StopGameSessionPlacement .

        • TIMED_OUT -- A new game session was not successfully created before the time limit expired. You can resubmit the placement request as needed.

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

          • Key (string) --

            Game property identifier.

          • Value (string) --

            Game property value.

      • MaximumPlayerSessionCount (integer) --

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

      • GameSessionName (string) --

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

      • GameSessionId (string) --

        Unique identifier for the game session. This value is set once the new game session is placed (placement status is FULFILLED ).

      • GameSessionArn (string) --

        Identifier for the game session created by this placement request. This value is set once the new game session is placed (placement status is FULFILLED ). This identifier is unique across all regions. You can use this value as a GameSessionId value as needed.

      • GameSessionRegion (string) --

        Name of the region where the game session created by this placement request is running. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlayerLatencies (list) --

        Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions.

        • (dict) --

          Regional latency information for a player, used when requesting a new game session with StartGameSessionPlacement . This value indicates the amount of time lag that exists when the player is connected to a fleet in the specified region. The relative difference between a player's latency values for multiple regions are used to determine which fleets are best suited to place a new game session for the player.

          • PlayerId (string) --

            Unique identifier for a player associated with the latency data.

          • RegionIdentifier (string) --

            Name of the region that is associated with the latency value.

          • LatencyInMilliseconds (float) --

            Amount of time that represents the time lag experienced by the player when connected to the specified region.

      • StartTime (datetime) --

        Time stamp indicating when this request was placed in the queue. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when this request was completed, canceled, or timed out.

      • IpAddress (string) --

        IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlacedPlayerSessions (list) --

        Collection of information on player sessions created in response to the game session placement request. These player sessions are created only once a new game session is successfully placed (placement status is FULFILLED ). This information includes the player ID (as provided in the placement request) and the corresponding player session ID. Retrieve full player sessions by calling DescribePlayerSessions with the player session ID.

        • (dict) --

          Information about a player session that was created as part of a StartGameSessionPlacement request. This object contains only the player ID and player session ID. To retrieve full details on a player session, call DescribePlayerSessions with the player session ID.

          Player-session-related operations include:

          • CreatePlayerSession

          • CreatePlayerSessions

          • DescribePlayerSessions

          • Game session placements

            • StartGameSessionPlacement

            • DescribeGameSessionPlacement

            • StopGameSessionPlacement

          • PlayerId (string) --

            Unique identifier for a player that is associated with this player session.

          • PlayerSessionId (string) --

            Unique identifier for a player session.

      • GameSessionData (string) --

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

      • MatchmakerData (string) --

        Information on the matchmaking process for this game. Data is in JSON syntax, formated as a string. It identifies the matchmaking configuration used to create the match, and contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see http://docs.aws.amazon.com/gamelift/latest/developerguide/match-server.html#match-server-data .

StopGameSessionPlacement (updated) Link ¶
Changes (response)
{'GameSessionPlacement': {'MatchmakerData': 'string'}}

Cancels a game session placement that is in PENDING status. To stop a placement, provide the placement ID values. If successful, the placement is moved to CANCELLED status.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.stop_game_session_placement(
    PlacementId='string'
)
type PlacementId

string

param PlacementId

[REQUIRED]

Unique identifier for a game session placement to cancel.

rtype

dict

returns

Response Syntax

{
    'GameSessionPlacement': {
        'PlacementId': 'string',
        'GameSessionQueueName': 'string',
        'Status': 'PENDING'|'FULFILLED'|'CANCELLED'|'TIMED_OUT',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'MaximumPlayerSessionCount': 123,
        'GameSessionName': 'string',
        'GameSessionId': 'string',
        'GameSessionArn': 'string',
        'GameSessionRegion': 'string',
        'PlayerLatencies': [
            {
                'PlayerId': 'string',
                'RegionIdentifier': 'string',
                'LatencyInMilliseconds': ...
            },
        ],
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'IpAddress': 'string',
        'Port': 123,
        'PlacedPlayerSessions': [
            {
                'PlayerId': 'string',
                'PlayerSessionId': 'string'
            },
        ],
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionPlacement (dict) --

      Object that describes the canceled game session placement, with CANCELLED status and an end time stamp.

      • PlacementId (string) --

        Unique identifier for a game session placement.

      • GameSessionQueueName (string) --

        Descriptive label that is associated with game session queue. Queue names must be unique within each region.

      • Status (string) --

        Current status of the game session placement request.

        • PENDING -- The placement request is currently in the queue waiting to be processed.

        • FULFILLED -- A new game session and player sessions (if requested) have been successfully created. Values for GameSessionArn and GameSessionRegion are available.

        • CANCELLED -- The placement request was canceled with a call to StopGameSessionPlacement .

        • TIMED_OUT -- A new game session was not successfully created before the time limit expired. You can resubmit the placement request as needed.

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

          • Key (string) --

            Game property identifier.

          • Value (string) --

            Game property value.

      • MaximumPlayerSessionCount (integer) --

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

      • GameSessionName (string) --

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

      • GameSessionId (string) --

        Unique identifier for the game session. This value is set once the new game session is placed (placement status is FULFILLED ).

      • GameSessionArn (string) --

        Identifier for the game session created by this placement request. This value is set once the new game session is placed (placement status is FULFILLED ). This identifier is unique across all regions. You can use this value as a GameSessionId value as needed.

      • GameSessionRegion (string) --

        Name of the region where the game session created by this placement request is running. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlayerLatencies (list) --

        Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions.

        • (dict) --

          Regional latency information for a player, used when requesting a new game session with StartGameSessionPlacement . This value indicates the amount of time lag that exists when the player is connected to a fleet in the specified region. The relative difference between a player's latency values for multiple regions are used to determine which fleets are best suited to place a new game session for the player.

          • PlayerId (string) --

            Unique identifier for a player associated with the latency data.

          • RegionIdentifier (string) --

            Name of the region that is associated with the latency value.

          • LatencyInMilliseconds (float) --

            Amount of time that represents the time lag experienced by the player when connected to the specified region.

      • StartTime (datetime) --

        Time stamp indicating when this request was placed in the queue. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when this request was completed, canceled, or timed out.

      • IpAddress (string) --

        IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number. This value is set once the new game session is placed (placement status is FULFILLED ).

      • PlacedPlayerSessions (list) --

        Collection of information on player sessions created in response to the game session placement request. These player sessions are created only once a new game session is successfully placed (placement status is FULFILLED ). This information includes the player ID (as provided in the placement request) and the corresponding player session ID. Retrieve full player sessions by calling DescribePlayerSessions with the player session ID.

        • (dict) --

          Information about a player session that was created as part of a StartGameSessionPlacement request. This object contains only the player ID and player session ID. To retrieve full details on a player session, call DescribePlayerSessions with the player session ID.

          Player-session-related operations include:

          • CreatePlayerSession

          • CreatePlayerSessions

          • DescribePlayerSessions

          • Game session placements

            • StartGameSessionPlacement

            • DescribeGameSessionPlacement

            • StopGameSessionPlacement

          • PlayerId (string) --

            Unique identifier for a player that is associated with this player session.

          • PlayerSessionId (string) --

            Unique identifier for a player session.

      • GameSessionData (string) --

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

      • MatchmakerData (string) --

        Information on the matchmaking process for this game. Data is in JSON syntax, formated as a string. It identifies the matchmaking configuration used to create the match, and contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see http://docs.aws.amazon.com/gamelift/latest/developerguide/match-server.html#match-server-data .

UpdateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'MatchmakerData': 'string'}}

Updates game session properties. This includes the session name, maximum player count, protection policy, which controls whether or not an active game session can be terminated during a scale-down event, and the player session creation policy, which controls whether or not new players can join the session. To update a game session, specify the game session ID and the values you want to change. If successful, an updated GameSession object is returned.

Game-session-related operations include:

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.update_game_session(
    GameSessionId='string',
    MaximumPlayerSessionCount=123,
    Name='string',
    PlayerSessionCreationPolicy='ACCEPT_ALL'|'DENY_ALL',
    ProtectionPolicy='NoProtection'|'FullProtection'
)
type GameSessionId

string

param GameSessionId

[REQUIRED]

Unique identifier for the game session to update.

type MaximumPlayerSessionCount

integer

param MaximumPlayerSessionCount

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

type Name

string

param Name

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

type PlayerSessionCreationPolicy

string

param PlayerSessionCreationPolicy

Policy determining whether or not the game session accepts new players.

type ProtectionPolicy

string

param ProtectionPolicy

Game session protection policy to apply to this game session only.

  • NoProtection -- The game session can be terminated during a scale-down event.

  • FullProtection -- If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.

rtype

dict

returns

Response Syntax

{
    'GameSession': {
        'GameSessionId': 'string',
        'Name': 'string',
        'FleetId': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'CurrentPlayerSessionCount': 123,
        'MaximumPlayerSessionCount': 123,
        'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'Port': 123,
        'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
        'CreatorId': 'string',
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSession (dict) --

      Object that contains the updated game session metadata.

      • GameSessionId (string) --

        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> .

      • Name (string) --

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

      • FleetId (string) --

        Unique identifier for a fleet that the game session is running on.

      • CreationTime (datetime) --

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

      • TerminationTime (datetime) --

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

      • CurrentPlayerSessionCount (integer) --

        Number of players currently in the game session.

      • MaximumPlayerSessionCount (integer) --

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

      • Status (string) --

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

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .

          • Key (string) --

            Game property identifier.

          • Value (string) --

            Game property value.

      • IpAddress (string) --

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

      • Port (integer) --

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

      • PlayerSessionCreationPolicy (string) --

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

      • CreatorId (string) --

        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.

      • GameSessionData (string) --

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

      • MatchmakerData (string) --

        Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).