Amazon GameLift

2019/09/03 - Amazon GameLift - 17 updated api methods

Changes  You can now make use of PKI resources to provide more secure connections between your game clients and servers. To learn more, please refer to the public Amazon GameLift documentation.

CreateFleet (updated) Link ¶
Changes (request, response)
Request
{'CertificateConfiguration': {'CertificateType': 'DISABLED | GENERATED'}}
Response
{'FleetAttributes': {'CertificateConfiguration': {'CertificateType': 'DISABLED '
                                                                     '| '
                                                                     'GENERATED'}}}

Creates a new fleet to run your game servers. whether they are custom game builds or Realtime Servers with game-specific script. A fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances, each of which can host multiple game sessions. When creating a fleet, you choose the hardware specifications, set some configuration options, and specify the game server to deploy on the new fleet.

To create a new fleet, you must provide the following: (1) a fleet name, (2) an EC2 instance type and fleet type (spot or on-demand), (3) the build ID for your game build or script ID if using Realtime Servers, and (4) a run-time configuration, which determines how game servers will run on each instance in the fleet.

Note

When creating a Realtime Servers fleet, we recommend using a minimal version of the Realtime script (see this working code example ). This will make it much easier to troubleshoot any fleet creation issues. Once the fleet is active, you can update your Realtime script as needed.

If the CreateFleet call is successful, Amazon GameLift performs the following tasks. You can track the process of a fleet by checking the fleet status or by monitoring fleet creation events:

  • Creates a fleet record. Status: NEW .

  • Begins writing events to the fleet event log, which can be accessed in the Amazon GameLift console. Sets the fleet's target capacity to 1 (desired instances), which triggers Amazon GameLift to start one new EC2 instance.

  • Downloads the game build or Realtime script to the new instance and installs it. Statuses: DOWNLOADING , VALIDATING , BUILDING .

  • Starts launching server processes on the instance. If the fleet is configured to run multiple server processes per instance, Amazon GameLift staggers each launch by a few seconds. Status: ACTIVATING .

  • Sets the fleet's status to ACTIVE as soon as one server process is ready to host a game session.

Learn more

Working with Fleets

Debug Fleet Creation Issues

Related operations

  • CreateFleet

  • ListFleets

  • DeleteFleet

  • Describe fleets:

    • DescribeFleetAttributes

    • DescribeFleetCapacity

    • DescribeFleetPortSettings

    • DescribeFleetUtilization

    • DescribeRuntimeConfiguration

    • DescribeEC2InstanceLimits

    • DescribeFleetEvents

  • Update fleets:

    • UpdateFleetAttributes

    • UpdateFleetCapacity

    • UpdateFleetPortSettings

    • UpdateRuntimeConfiguration

  • Manage fleet actions:

    • StartFleetActions

    • StopFleetActions

See also: AWS API Documentation

Request Syntax

client.create_fleet(
    Name='string',
    Description='string',
    BuildId='string',
    ScriptId='string',
    ServerLaunchPath='string',
    ServerLaunchParameters='string',
    LogPaths=[
        'string',
    ],
    EC2InstanceType='t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge',
    EC2InboundPermissions=[
        {
            'FromPort': 123,
            'ToPort': 123,
            'IpRange': 'string',
            'Protocol': 'TCP'|'UDP'
        },
    ],
    NewGameSessionProtectionPolicy='NoProtection'|'FullProtection',
    RuntimeConfiguration={
        'ServerProcesses': [
            {
                'LaunchPath': 'string',
                'Parameters': 'string',
                'ConcurrentExecutions': 123
            },
        ],
        'MaxConcurrentGameSessionActivations': 123,
        'GameSessionActivationTimeoutSeconds': 123
    },
    ResourceCreationLimitPolicy={
        'NewGameSessionsPerCreator': 123,
        'PolicyPeriodInMinutes': 123
    },
    MetricGroups=[
        'string',
    ],
    PeerVpcAwsAccountId='string',
    PeerVpcId='string',
    FleetType='ON_DEMAND'|'SPOT',
    InstanceRoleArn='string',
    CertificateConfiguration={
        'CertificateType': 'DISABLED'|'GENERATED'
    }
)
type Name

string

param Name

[REQUIRED]

Descriptive label that is associated with a fleet. Fleet names do not need to be unique.

type Description

string

param Description

Human-readable description of a fleet.

type BuildId

string

param BuildId

Unique identifier for a build to be deployed on the new fleet. The custom game server build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.

type ScriptId

string

param ScriptId

Unique identifier for a Realtime script to be deployed on the new fleet. The Realtime script must have been successfully uploaded to Amazon GameLift. This fleet setting cannot be changed once the fleet is created.

type ServerLaunchPath

string

param ServerLaunchPath

This parameter is no longer used. Instead, specify a server launch path using the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a run-time configuration will continue to work.)

type ServerLaunchParameters

string

param ServerLaunchParameters

This parameter is no longer used. Instead, specify server launch parameters in the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a run-time configuration will continue to work.)

type LogPaths

list

param LogPaths

This parameter is no longer used. Instead, to specify where Amazon GameLift should store log files once a server process shuts down, use the Amazon GameLift server API ProcessReady() and specify one or more directory paths in logParameters . See more information in the Server API Reference.

  • (string) --

type EC2InstanceType

string

param EC2InstanceType

[REQUIRED]

Name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.

type EC2InboundPermissions

list

param EC2InboundPermissions

Range of IP addresses and port settings that permit inbound traffic to access game sessions that running on the fleet. For fleets using a custom game build, this parameter is required before game sessions running on the fleet can accept connections. For Realtime Servers fleets, Amazon GameLift automatically sets TCP and UDP ranges for use by the Realtime servers. You can specify multiple permission settings or add more by updating the fleet.

  • (dict) --

    A range of IP addresses and port settings that allow inbound traffic to connect to server processes on an Amazon GameLift. New game sessions that are started on the fleet are assigned an IP address/port number combination, which must fall into the fleet's allowed ranges. For fleets created with a custom game server, the ranges reflect the server's game session assignments. For Realtime Servers fleets, Amazon GameLift automatically opens two port ranges, one for TCP messaging and one for UDP for use by the Realtime servers.

    • FromPort (integer) -- [REQUIRED]

      Starting value for a range of allowed port numbers.

    • ToPort (integer) -- [REQUIRED]

      Ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be higher than FromPort .

    • IpRange (string) -- [REQUIRED]

      Range of allowed IP addresses. This value must be expressed in CIDR notation. Example: " 000.000.000.000/[subnet mask] " or optionally the shortened version " 0.0.0.0/[subnet mask] ".

    • Protocol (string) -- [REQUIRED]

      Network communication protocol used by the fleet.

type NewGameSessionProtectionPolicy

string

param NewGameSessionProtectionPolicy

Game session protection policy to apply to all instances in this fleet. If this parameter is not set, instances in this fleet default to no protection. You can change a fleet's protection policy using UpdateFleetAttributes, but this change will only affect sessions created after the policy change. You can also set protection for individual instances using UpdateGameSession.

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

type RuntimeConfiguration

dict

param RuntimeConfiguration

Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime Servers script. The run-time configuration lists the types of server processes to run on an instance and includes the following configuration settings: the server executable or launch script file, launch parameters, and the number of processes to run concurrently on each instance. A CreateFleet request must include a run-time configuration with at least one server process configuration.

  • ServerProcesses (list) --

    Collection of server process configurations that describe which server processes to run on each instance in a fleet.

    • (dict) --

      A set of instructions for launching server processes on each instance in a fleet. Server processes run either a custom game build executable or a Realtime Servers script. Each instruction set identifies the location of the custom game build executable or Realtime launch script, optional launch parameters, and the number of server processes with this configuration to maintain concurrently on the instance. Server process configurations make up a fleet's RuntimeConfiguration .

      • LaunchPath (string) -- [REQUIRED]

        Location of the server executable in a custom game build or the name of the Realtime script file that contains the Init() function. Game builds and Realtime scripts are installed on instances at the root:

        • Windows (for custom game builds only): C:\game . Example: " C:\game\MyGame\server.exe "

        • Linux: /local/game . Examples: " /local/game/MyGame/server.exe " or " /local/game/MyRealtimeScript.js "

      • Parameters (string) --

        Optional list of parameters to pass to the server executable or Realtime script on launch.

      • ConcurrentExecutions (integer) -- [REQUIRED]

        Number of server processes using this configuration to run concurrently on an instance.

  • MaxConcurrentGameSessionActivations (integer) --

    Maximum number of game sessions with status ACTIVATING to allow on an instance simultaneously. This setting limits the amount of instance resources that can be used for new game activations at any one time.

  • GameSessionActivationTimeoutSeconds (integer) --

    Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING . If the game session is not active before the timeout, activation is terminated and the game session status is changed to TERMINATED .

type ResourceCreationLimitPolicy

dict

param ResourceCreationLimitPolicy

Policy that limits the number of game sessions an individual player can create over a span of time for this fleet.

  • NewGameSessionsPerCreator (integer) --

    Maximum number of game sessions that an individual can create during the policy period.

  • PolicyPeriodInMinutes (integer) --

    Time span used in evaluating the resource creation limit policy.

type MetricGroups

list

param MetricGroups

Name of an Amazon CloudWatch metric group to add this fleet to. A metric group aggregates the metrics for all fleets in the group. Specify an existing metric group name, or provide a new name to create a new metric group. A fleet can only be included in one metric group at a time.

  • (string) --

type PeerVpcAwsAccountId

string

param PeerVpcAwsAccountId

Unique identifier for the AWS account with the VPC that you want to peer your Amazon GameLift fleet with. You can find your Account ID in the AWS Management Console under account settings.

type PeerVpcId

string

param PeerVpcId

Unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same region where your fleet is deployed. Look up a VPC ID using the VPC Dashboard in the AWS Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets.

type FleetType

string

param FleetType

Indicates whether to use on-demand instances or spot instances for this fleet. If empty, the default is ON_DEMAND. Both categories of instances use identical hardware and configurations based on the instance type selected for this fleet. Learn more about On-Demand versus Spot Instances.

type InstanceRoleArn

string

param InstanceRoleArn

Unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.

type CertificateConfiguration

dict

param CertificateConfiguration
  • CertificateType (string) -- [REQUIRED]

rtype

dict

returns

Response Syntax

{
    'FleetAttributes': {
        'FleetId': 'string',
        'FleetArn': 'string',
        'FleetType': 'ON_DEMAND'|'SPOT',
        'InstanceType': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge',
        'Description': 'string',
        'Name': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED',
        'BuildId': 'string',
        'ScriptId': 'string',
        'ServerLaunchPath': 'string',
        'ServerLaunchParameters': 'string',
        'LogPaths': [
            'string',
        ],
        'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection',
        'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX',
        'ResourceCreationLimitPolicy': {
            'NewGameSessionsPerCreator': 123,
            'PolicyPeriodInMinutes': 123
        },
        'MetricGroups': [
            'string',
        ],
        'StoppedActions': [
            'AUTO_SCALING',
        ],
        'InstanceRoleArn': 'string',
        'CertificateConfiguration': {
            'CertificateType': 'DISABLED'|'GENERATED'
        }
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • FleetAttributes (dict) --

      Properties for the newly created fleet.

      • FleetId (string) --

        Unique identifier for a fleet.

      • FleetArn (string) --

        Identifier for a fleet that is unique across all regions.

      • FleetType (string) --

        Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.

      • InstanceType (string) --

        EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.

      • Description (string) --

        Human-readable description of the fleet.

      • Name (string) --

        Descriptive label that is associated with a fleet. Fleet names do not need to be unique.

      • 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").

      • Status (string) --

        Current status of the fleet.

        Possible fleet statuses include the following:

        • NEW -- A new fleet has been defined and desired instances is set to 1.

        • DOWNLOADING/VALIDATING/BUILDING/ACTIVATING -- Amazon GameLift is setting up the new fleet, creating new instances with the game build or Realtime script and starting server processes.

        • ACTIVE -- Hosts can now accept game sessions.

        • ERROR -- An error occurred when downloading, validating, building, or activating the fleet.

        • DELETING -- Hosts are responding to a delete fleet request.

        • TERMINATED -- The fleet no longer exists.

      • BuildId (string) --

        Unique identifier for a build.

      • ScriptId (string) --

        Unique identifier for a Realtime script.

      • ServerLaunchPath (string) --

        Path to a game server executable in the fleet's build, specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's RuntimeConfiguration.

      • ServerLaunchParameters (string) --

        Game server launch parameters specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's RuntimeConfiguration.

      • LogPaths (list) --

        Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide. If no default log path for a fleet is specified, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon GameLift console to access stored logs.

        • (string) --

      • NewGameSessionProtectionPolicy (string) --

        Type of game session protection to set for all new instances started in the fleet.

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

      • OperatingSystem (string) --

        Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.

      • ResourceCreationLimitPolicy (dict) --

        Fleet policy to limit the number of game sessions an individual player can create over a span of time.

        • NewGameSessionsPerCreator (integer) --

          Maximum number of game sessions that an individual can create during the policy period.

        • PolicyPeriodInMinutes (integer) --

          Time span used in evaluating the resource creation limit policy.

      • MetricGroups (list) --

        Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.

        • (string) --

      • StoppedActions (list) --

        List of fleet actions that have been suspended using StopFleetActions. This includes auto-scaling.

        • (string) --

      • InstanceRoleArn (string) --

        Unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.

      • CertificateConfiguration (dict) --

        • CertificateType (string) --

CreateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'DnsName': '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.

  • 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',
        'StatusReason': 'INTERRUPTED',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'DnsName': '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.

      • StatusReason (string) --

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

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

      • DnsName (string) --

      • 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, formatted 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 ).

CreatePlayerSession (updated) Link ¶
Changes (response)
{'PlayerSession': {'DnsName': 'string'}}

Reserves an open player slot in an active game session. Before a player can be added, a game session must have an ACTIVE status, have a creation policy of ALLOW_ALL , and have an open player slot. To add a group of players to a game session, use CreatePlayerSessions. When the player connects to the game server and references a player session ID, the game server contacts the Amazon GameLift service to validate the player reservation and accept the player.

To create a player session, specify a game session ID, player ID, and optionally a string of player data. If successful, a slot is reserved in the game session for the player and a new PlayerSession object is returned. Player sessions cannot be updated.

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_player_session(
    GameSessionId='string',
    PlayerId='string',
    PlayerData='string'
)
type GameSessionId

string

param GameSessionId

[REQUIRED]

Unique identifier for the game session to add a player to.

type PlayerId

string

param PlayerId

[REQUIRED]

Unique identifier for a player. Player IDs are developer-defined.

type PlayerData

string

param PlayerData

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.

rtype

dict

returns

Response Syntax

{
    'PlayerSession': {
        'PlayerSessionId': 'string',
        'PlayerId': 'string',
        'GameSessionId': 'string',
        'FleetId': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
        'IpAddress': 'string',
        'DnsName': 'string',
        'Port': 123,
        'PlayerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSession (dict) --

      Object that describes the newly created player session record.

      • PlayerSessionId (string) --

        Unique identifier for a player session.

      • PlayerId (string) --

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

      • GameSessionId (string) --

        Unique identifier for the game session that the player session is connected to.

      • FleetId (string) --

        Unique identifier for a fleet that the player's 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").

      • Status (string) --

        Current status of the player session.

        Possible player session statuses include the following:

        • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

        • ACTIVE -- The player has been validated by the server process and is currently connected.

        • COMPLETED -- The player connection has been dropped.

        • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

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

      • DnsName (string) --

      • Port (integer) --

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

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

CreatePlayerSessions (updated) Link ¶
Changes (response)
{'PlayerSessions': {'DnsName': 'string'}}

Reserves open slots in a game session for a group of players. Before players can be added, a game session must have an ACTIVE status, have a creation policy of ALLOW_ALL , and have an open player slot. To add a single player to a game session, use CreatePlayerSession. When a player connects to the game server and references a player session ID, the game server contacts the Amazon GameLift service to validate the player reservation and accept the player.

To create player sessions, specify a game session ID, a list of player IDs, and optionally a set of player data strings. If successful, a slot is reserved in the game session for each player and a set of new PlayerSession objects is returned. Player sessions cannot be updated.

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_player_sessions(
    GameSessionId='string',
    PlayerIds=[
        'string',
    ],
    PlayerDataMap={
        'string': 'string'
    }
)
type GameSessionId

string

param GameSessionId

[REQUIRED]

Unique identifier for the game session to add players to.

type PlayerIds

list

param PlayerIds

[REQUIRED]

List of unique identifiers for the players to be added.

  • (string) --

type PlayerDataMap

dict

param PlayerDataMap

Map of string pairs, each specifying a player ID and a set of developer-defined information related to the player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game. Player data strings for player IDs not included in the PlayerIds parameter are ignored.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'PlayerSessions': [
        {
            'PlayerSessionId': 'string',
            'PlayerId': 'string',
            'GameSessionId': 'string',
            'FleetId': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerData': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSessions (list) --

      Collection of player session objects created for the added players.

      • (dict) --

        Properties describing a player session. Player session objects are created either by creating a player session for a specific game session, or as part of a game session placement. A player session represents either a player reservation for a game session (status RESERVED ) or actual player activity in a game session (status ACTIVE ). A player session object (including player data) is automatically passed to a game session when the player connects to the game session and is validated.

        When a player disconnects, the player session status changes to COMPLETED . Once the session ends, the player session object is retained for 30 days and then removed.

        • CreatePlayerSession

        • CreatePlayerSessions

        • DescribePlayerSessions

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • PlayerSessionId (string) --

          Unique identifier for a player session.

        • PlayerId (string) --

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

        • GameSessionId (string) --

          Unique identifier for the game session that the player session is connected to.

        • FleetId (string) --

          Unique identifier for a fleet that the player's 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").

        • Status (string) --

          Current status of the player session.

          Possible player session statuses include the following:

          • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

          • ACTIVE -- The player has been validated by the server process and is currently connected.

          • COMPLETED -- The player connection has been dropped.

          • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

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

        • DnsName (string) --

        • Port (integer) --

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

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

DescribeFleetAttributes (updated) Link ¶
Changes (response)
{'FleetAttributes': {'CertificateConfiguration': {'CertificateType': 'DISABLED '
                                                                     '| '
                                                                     'GENERATED'}}}

Retrieves fleet properties, including metadata, status, and configuration, for one or more fleets. You can request attributes for all fleets, or specify a list of one or more fleet IDs. When requesting multiple fleets, use the pagination parameters to retrieve results as a set of sequential pages. If successful, a FleetAttributes object is returned for each requested fleet ID. When specifying a list of fleet IDs, attribute objects are returned only for fleets that currently exist.

Note

Some API actions may limit the number of fleet IDs allowed in one request. If a request exceeds this limit, the request fails and the error message includes the maximum allowed.

Learn more

Working with Fleets.

Related operations

  • CreateFleet

  • ListFleets

  • DeleteFleet

  • Describe fleets:

    • DescribeFleetAttributes

    • DescribeFleetCapacity

    • DescribeFleetPortSettings

    • DescribeFleetUtilization

    • DescribeRuntimeConfiguration

    • DescribeEC2InstanceLimits

    • DescribeFleetEvents

  • Update fleets:

    • UpdateFleetAttributes

    • UpdateFleetCapacity

    • UpdateFleetPortSettings

    • UpdateRuntimeConfiguration

  • Manage fleet actions:

    • StartFleetActions

    • StopFleetActions

See also: AWS API Documentation

Request Syntax

client.describe_fleet_attributes(
    FleetIds=[
        'string',
    ],
    Limit=123,
    NextToken='string'
)
type FleetIds

list

param FleetIds

Unique identifier for a fleet(s) to retrieve attributes for. To request attributes for all fleets, leave this parameter empty.

  • (string) --

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. This parameter is ignored when the request specifies one or a list of fleet IDs.

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. This parameter is ignored when the request specifies one or a list of fleet IDs.

rtype

dict

returns

Response Syntax

{
    'FleetAttributes': [
        {
            'FleetId': 'string',
            'FleetArn': 'string',
            'FleetType': 'ON_DEMAND'|'SPOT',
            'InstanceType': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge',
            'Description': 'string',
            'Name': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED',
            'BuildId': 'string',
            'ScriptId': 'string',
            'ServerLaunchPath': 'string',
            'ServerLaunchParameters': 'string',
            'LogPaths': [
                'string',
            ],
            'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection',
            'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX',
            'ResourceCreationLimitPolicy': {
                'NewGameSessionsPerCreator': 123,
                'PolicyPeriodInMinutes': 123
            },
            'MetricGroups': [
                'string',
            ],
            'StoppedActions': [
                'AUTO_SCALING',
            ],
            'InstanceRoleArn': 'string',
            'CertificateConfiguration': {
                'CertificateType': 'DISABLED'|'GENERATED'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • FleetAttributes (list) --

      Collection of objects containing attribute metadata for each requested fleet ID.

      • (dict) --

        General properties describing a fleet.

        • CreateFleet

        • ListFleets

        • DeleteFleet

        • Describe fleets:

          • DescribeFleetAttributes

          • DescribeFleetCapacity

          • DescribeFleetPortSettings

          • DescribeFleetUtilization

          • DescribeRuntimeConfiguration

          • DescribeEC2InstanceLimits

          • DescribeFleetEvents

        • Update fleets:

          • UpdateFleetAttributes

          • UpdateFleetCapacity

          • UpdateFleetPortSettings

          • UpdateRuntimeConfiguration

        • Manage fleet actions:

          • StartFleetActions

          • StopFleetActions

        • FleetId (string) --

          Unique identifier for a fleet.

        • FleetArn (string) --

          Identifier for a fleet that is unique across all regions.

        • FleetType (string) --

          Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.

        • InstanceType (string) --

          EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.

        • Description (string) --

          Human-readable description of the fleet.

        • Name (string) --

          Descriptive label that is associated with a fleet. Fleet names do not need to be unique.

        • 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").

        • Status (string) --

          Current status of the fleet.

          Possible fleet statuses include the following:

          • NEW -- A new fleet has been defined and desired instances is set to 1.

          • DOWNLOADING/VALIDATING/BUILDING/ACTIVATING -- Amazon GameLift is setting up the new fleet, creating new instances with the game build or Realtime script and starting server processes.

          • ACTIVE -- Hosts can now accept game sessions.

          • ERROR -- An error occurred when downloading, validating, building, or activating the fleet.

          • DELETING -- Hosts are responding to a delete fleet request.

          • TERMINATED -- The fleet no longer exists.

        • BuildId (string) --

          Unique identifier for a build.

        • ScriptId (string) --

          Unique identifier for a Realtime script.

        • ServerLaunchPath (string) --

          Path to a game server executable in the fleet's build, specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's RuntimeConfiguration.

        • ServerLaunchParameters (string) --

          Game server launch parameters specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's RuntimeConfiguration.

        • LogPaths (list) --

          Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide. If no default log path for a fleet is specified, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon GameLift console to access stored logs.

          • (string) --

        • NewGameSessionProtectionPolicy (string) --

          Type of game session protection to set for all new instances started in the fleet.

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

        • OperatingSystem (string) --

          Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.

        • ResourceCreationLimitPolicy (dict) --

          Fleet policy to limit the number of game sessions an individual player can create over a span of time.

          • NewGameSessionsPerCreator (integer) --

            Maximum number of game sessions that an individual can create during the policy period.

          • PolicyPeriodInMinutes (integer) --

            Time span used in evaluating the resource creation limit policy.

        • MetricGroups (list) --

          Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.

          • (string) --

        • StoppedActions (list) --

          List of fleet actions that have been suspended using StopFleetActions. This includes auto-scaling.

          • (string) --

        • InstanceRoleArn (string) --

          Unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.

        • CertificateConfiguration (dict) --

          • CertificateType (string) --

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

DescribeGameSessionDetails (updated) Link ¶
Changes (response)
{'GameSessionDetails': {'GameSession': {'DnsName': '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.

  • 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',
                'StatusReason': 'INTERRUPTED',
                'GameProperties': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'IpAddress': 'string',
                'DnsName': '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.

          • StatusReason (string) --

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

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

          • DnsName (string) --

          • 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, formatted 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': {'DnsName': 'string', 'Status': {'FAILED'}}}

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.

  • 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'|'FAILED',
        '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',
        'DnsName': '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 ).

      • DnsName (string) --

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

          • 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, formatted 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 Match Data.

DescribeGameSessions (updated) Link ¶
Changes (response)
{'GameSessions': {'DnsName': '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.

  • 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',
            'StatusReason': 'INTERRUPTED',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'DnsName': '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.

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

        • StatusReason (string) --

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

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

        • DnsName (string) --

        • 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, formatted 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.

DescribeInstances (updated) Link ¶
Changes (response)
{'Instances': {'DnsName': 'string'}}

Retrieves information about a fleet's instances, including instance IDs. Use this action to get details on all instances in the fleet or get details on one specific instance.

To get a specific instance, specify fleet ID and instance ID. To get all instances in a fleet, specify a fleet ID only. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, an Instance object is returned for each result.

See also: AWS API Documentation

Request Syntax

client.describe_instances(
    FleetId='string',
    InstanceId='string',
    Limit=123,
    NextToken='string'
)
type FleetId

string

param FleetId

[REQUIRED]

Unique identifier for a fleet to retrieve instance information for.

type InstanceId

string

param InstanceId

Unique identifier for an instance to retrieve. Specify an instance ID or leave blank to retrieve all instances in the fleet.

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

{
    'Instances': [
        {
            'FleetId': 'string',
            'InstanceId': 'string',
            'IpAddress': 'string',
            'DnsName': 'string',
            'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX',
            'Type': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge',
            'Status': 'PENDING'|'ACTIVE'|'TERMINATING',
            'CreationTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Instances (list) --

      Collection of objects containing properties for each instance returned.

      • (dict) --

        Properties that describe an instance of a virtual computing resource that hosts one or more game servers. A fleet may contain zero or more instances.

        • FleetId (string) --

          Unique identifier for a fleet that the instance is in.

        • InstanceId (string) --

          Unique identifier for an instance.

        • IpAddress (string) --

          IP address assigned to the instance.

        • DnsName (string) --

        • OperatingSystem (string) --

          Operating system that is running on this instance.

        • Type (string) --

          EC2 instance type that defines the computing resources of this instance.

        • Status (string) --

          Current status of the instance. Possible statuses include the following:

          • PENDING -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration.

          • ACTIVE -- The instance has been successfully created and at least one server process has successfully launched and reported back to Amazon GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions.

          • TERMINATING -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.

        • 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").

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

DescribeMatchmaking (updated) Link ¶
Changes (response)
{'TicketList': {'GameSessionConnectionInfo': {'DnsName': 'string'}}}

Retrieves one or more matchmaking tickets. Use this operation to retrieve ticket information, including status and--once a successful match is made--acquire connection information for the resulting new game session.

You can use this operation to track the progress of matchmaking requests (through polling) as an alternative to using event notifications. See more details on tracking matchmaking requests through polling or notifications in StartMatchmaking.

To request matchmaking tickets, provide a list of up to 10 ticket IDs. If the request is successful, a ticket object is returned for each requested ID that currently exists.

Learn more

Add FlexMatch to a Game Client

Set Up FlexMatch Event Notification

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

See also: AWS API Documentation

Request Syntax

client.describe_matchmaking(
    TicketIds=[
        'string',
    ]
)
type TicketIds

list

param TicketIds

[REQUIRED]

Unique identifier for a matchmaking ticket. You can include up to 10 ID values.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'TicketList': [
        {
            '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',
                'DnsName': 'string',
                'Port': 123,
                'MatchedPlayerSessions': [
                    {
                        'PlayerId': 'string',
                        'PlayerSessionId': 'string'
                    },
                ]
            },
            'EstimatedWaitTime': 123
        },
    ]
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • TicketList (list) --

      Collection of existing matchmaking ticket objects matching the request.

      • (dict) --

        Ticket generated to track the progress of a matchmaking request. Each ticket is uniquely identified by a ticket ID, supplied by the requester, when creating a matchmaking request with StartMatchmaking. Tickets can be retrieved by calling DescribeMatchmaking with the ticket ID.

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

          • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

          • 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 this matchmaking request stopped being processed due to success, failure, 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.

          • DnsName (string) --

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

DescribePlayerSessions (updated) Link ¶
Changes (response)
{'PlayerSessions': {'DnsName': 'string'}}

Retrieves properties for one or more player sessions. This action can be used in several ways: (1) provide a PlayerSessionId to request properties for a specific player session; (2) provide a GameSessionId to request properties for all player sessions in the specified game session; (3) provide a PlayerId to request properties for all player sessions of a specified player.

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

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_player_sessions(
    GameSessionId='string',
    PlayerId='string',
    PlayerSessionId='string',
    PlayerSessionStatusFilter='string',
    Limit=123,
    NextToken='string'
)
type GameSessionId

string

param GameSessionId

Unique identifier for the game session to retrieve player sessions for.

type PlayerId

string

param PlayerId

Unique identifier for a player to retrieve player sessions for.

type PlayerSessionId

string

param PlayerSessionId

Unique identifier for a player session to retrieve.

type PlayerSessionStatusFilter

string

param PlayerSessionStatusFilter

Player session status to filter results on.

Possible player session statuses include the following:

  • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

  • ACTIVE -- The player has been validated by the server process and is currently connected.

  • COMPLETED -- The player connection has been dropped.

  • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

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. If a player session ID is specified, this parameter is ignored.

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. If a player session ID is specified, this parameter is ignored.

rtype

dict

returns

Response Syntax

{
    'PlayerSessions': [
        {
            'PlayerSessionId': 'string',
            'PlayerId': 'string',
            'GameSessionId': 'string',
            'FleetId': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSessions (list) --

      Collection of objects containing properties for each player session that matches the request.

      • (dict) --

        Properties describing a player session. Player session objects are created either by creating a player session for a specific game session, or as part of a game session placement. A player session represents either a player reservation for a game session (status RESERVED ) or actual player activity in a game session (status ACTIVE ). A player session object (including player data) is automatically passed to a game session when the player connects to the game session and is validated.

        When a player disconnects, the player session status changes to COMPLETED . Once the session ends, the player session object is retained for 30 days and then removed.

        • CreatePlayerSession

        • CreatePlayerSessions

        • DescribePlayerSessions

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • PlayerSessionId (string) --

          Unique identifier for a player session.

        • PlayerId (string) --

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

        • GameSessionId (string) --

          Unique identifier for the game session that the player session is connected to.

        • FleetId (string) --

          Unique identifier for a fleet that the player's 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").

        • Status (string) --

          Current status of the player session.

          Possible player session statuses include the following:

          • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

          • ACTIVE -- The player has been validated by the server process and is currently connected.

          • COMPLETED -- The player connection has been dropped.

          • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

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

        • DnsName (string) --

        • Port (integer) --

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

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

    • 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': {'DnsName': '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.

  • 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',
            'StatusReason': 'INTERRUPTED',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'DnsName': '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.

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

        • StatusReason (string) --

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

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

        • DnsName (string) --

        • 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, formatted 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': {'DnsName': 'string', 'Status': {'FAILED'}}}

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 player data and a unique player ID for each player that you are joining to the new game session (player data is optional, but if you include it, you must also provide a unique ID for each player)

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

  • 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'|'FAILED',
        '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',
        'DnsName': '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 ).

      • DnsName (string) --

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

          • 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, formatted 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 Match Data.

StartMatchBackfill (updated) Link ¶
Changes (response)
{'MatchmakingTicket': {'GameSessionConnectionInfo': {'DnsName': 'string'}}}

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.

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.

Learn more

Backfill Existing Games with FlexMatch

How GameLift FlexMatch Works

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

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',
            'DnsName': '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.

        • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

        • 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 this matchmaking request stopped being processed due to success, failure, 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.

        • DnsName (string) --

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

StartMatchmaking (updated) Link ¶
Changes (response)
{'MatchmakingTicket': {'GameSessionConnectionInfo': {'DnsName': 'string'}}}

Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules, and starts a new game for the matched players. Each matchmaking request specifies the type of match to build (team configuration, rules for an acceptable match, etc.). The request also specifies the players to find a match for and where to host the new game session for optimal performance. A matchmaking request might start with a single player or a group of players who want to play together. FlexMatch finds additional players as needed to fill the match. Match type, rules, and the queue used to place a new game session are defined in a MatchmakingConfiguration .

To start matchmaking, provide a unique ticket ID, specify a matchmaking configuration, and include the players to be matched. You must also include a set of player attributes relevant for the matchmaking configuration. If successful, a matchmaking ticket is returned with status set to QUEUED . Track the status of the ticket to respond as needed and acquire game session connection information for successfully completed matches.

Tracking ticket status -- A couple of options are available for tracking the status of matchmaking requests:

  • Polling -- Call DescribeMatchmaking . This operation returns the full ticket object, including current status and (for completed tickets) game session connection info. We recommend polling no more than once every 10 seconds.

  • Notifications -- Get event notifications for changes in ticket status using Amazon Simple Notification Service (SNS). Notifications are easy to set up (see CreateMatchmakingConfiguration ) and typically deliver match status changes faster and more efficiently than polling. We recommend that you use polling to back up to notifications (since delivery is not guaranteed) and call DescribeMatchmaking only when notifications are not received within 30 seconds.

Processing a matchmaking request -- FlexMatch handles a matchmaking request as follows:

  • Your client code submits a StartMatchmaking request for one or more players and tracks the status of the request ticket.

  • FlexMatch uses this ticket and others in process to build an acceptable match. When a potential match is identified, all tickets in the proposed match are advanced to the next status.

  • If the match requires player acceptance (set in the matchmaking configuration), the tickets move into status REQUIRES_ACCEPTANCE . This status triggers your client code to solicit acceptance from all players in every ticket involved in the match, and then call AcceptMatch for each player. If any player rejects or fails to accept the match before a specified timeout, the proposed match is dropped (see AcceptMatch for more details).

  • Once a match is proposed and accepted, the matchmaking tickets move into status PLACING . FlexMatch locates resources for a new game session using the game session queue (set in the matchmaking configuration) and creates the game session based on the match data.

  • When the match is successfully placed, the matchmaking tickets move into COMPLETED status. Connection information (including game session endpoint and player session) is added to the matchmaking tickets. Matched players can use the connection information to join the game.

Learn more

Add FlexMatch to a Game Client

Set Up FlexMatch Event Notification

FlexMatch Integration Roadmap

How GameLift FlexMatch Works

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

See also: AWS API Documentation

Request Syntax

client.start_matchmaking(
    TicketId='string',
    ConfigurationName='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 matchmaking ticket status and retrieve match results.

type ConfigurationName

string

param ConfigurationName

[REQUIRED]

Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same region as this request.

type Players

list

param Players

[REQUIRED]

Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, Player objects contain the name of the team the player is assigned to.

  • (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',
            'DnsName': '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 matchmaking request. This object include the information included 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.

        • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

        • 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 this matchmaking request stopped being processed due to success, failure, 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.

        • DnsName (string) --

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

StopGameSessionPlacement (updated) Link ¶
Changes (response)
{'GameSessionPlacement': {'DnsName': 'string', 'Status': {'FAILED'}}}

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.

  • 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'|'FAILED',
        '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',
        'DnsName': '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 ).

      • DnsName (string) --

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

          • 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, formatted 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 Match Data.

UpdateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'DnsName': '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.

  • 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',
        'StatusReason': 'INTERRUPTED',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'DnsName': '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.

      • StatusReason (string) --

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

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

      • DnsName (string) --

      • 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, formatted 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 ).