Amazon GameLift

2017/08/25 - Amazon GameLift - 2 updated api methods

Changes  Update spelling of MatchmakingTicket status values for internal consistency.

DescribeMatchmaking (updated) Link ¶
Changes (response)
{'TicketList': {'Status': {'COMPLETED', 'CANCELLED'}}}

Retrieves a set of 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.

You can request data for a one or a list of ticket IDs. If the request is successful, a ticket object is returned for each requested ID. When specifying a list of ticket IDs, objects are returned only for tickets that currently exist.

Matchmaking-related operations include:

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

See also: AWS API Documentation

Request Syntax

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

list

param TicketIds

[REQUIRED]

Unique identifier for a matchmaking ticket. To request all existing tickets, leave this parameter empty.

  • (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),
            'Players': [
                {
                    'PlayerId': 'string',
                    'PlayerAttributes': {
                        'string': {
                            'S': 'string',
                            'N': 123.0,
                            'SL': [
                                'string',
                            ],
                            'SDM': {
                                'string': 123.0
                            }
                        }
                    },
                    'Team': 'string',
                    'LatencyInMs': {
                        'string': 123
                    }
                },
            ],
            'GameSessionConnectionInfo': {
                'GameSessionArn': 'string',
                'IpAddress': 'string',
                'Port': 123,
                'MatchedPlayerSessions': [
                    {
                        'PlayerId': 'string',
                        'PlayerSessionId': 'string'
                    },
                ]
            }
        },
    ]
}

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. Tickets with players who fail to accept a proposed match are placed in FAILED status; new matchmaking requests can be submitted for these players.

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

          • TIMED_OUT – The matchmaking request was not completed within the duration specified in the matchmaking configuration. Matchmaking requests that time out can be resubmitted.

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

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

            Object used in matchmaking to represent a player. When starting a matchmaking request, a player has a player ID 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 name:value pairs containing player information for use in matchmaking. Player attribute names need to match playerAttributes names in the rule set being used. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}} .

              • (string) --

                • (dict) --

                  Values for use in Player attribute type: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 occurances of the the repeated value after the first of a repeated value are ignored.

                    • (string) --

                  • SDM (dict) --

                    For a map of up to 10 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 that are included in the object map. If not present (that is, null), FlexMatch ignores latency issues and may place the match in any region in the queue.

              Note

              If this property contains an empty map, FlexMatch assumes that no regions are available to the player. In this scenario, the ticket is not matchable and always times out unless canceled.

              • (string) --

                • (integer) --

        • GameSessionConnectionInfo (dict) --

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

          • GameSessionArn (string) --

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

          • IpAddress (string) --

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

          • Port (integer) --

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

          • MatchedPlayerSessions (list) --

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

            • (dict) --

              New player session 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

StartMatchmaking (updated) Link ¶
Changes (response)
{'MatchmakingTicket': {'Status': {'COMPLETED', 'CANCELLED'}}}

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 . For complete information on setting up and using FlexMatch, see the topic Adding FlexMatch to Your Game.

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

Matchmaking-related operations include:

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

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

    Object used in matchmaking to represent a player. When starting a matchmaking request, a player has a player ID 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 name:value pairs containing player information for use in matchmaking. Player attribute names need to match playerAttributes names in the rule set being used. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}} .

      • (string) --

        • (dict) --

          Values for use in Player attribute type: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 occurances of the the repeated value after the first of a repeated value are ignored.

            • (string) --

          • SDM (dict) --

            For a map of up to 10 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 that are included in the object map. If not present (that is, null), FlexMatch ignores latency issues and may place the match in any region in the queue.

      Note

      If this property contains an empty map, FlexMatch assumes that no regions are available to the player. In this scenario, the ticket is not matchable and always times out unless canceled.

      • (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),
        'Players': [
            {
                'PlayerId': 'string',
                'PlayerAttributes': {
                    'string': {
                        'S': 'string',
                        'N': 123.0,
                        'SL': [
                            'string',
                        ],
                        'SDM': {
                            'string': 123.0
                        }
                    }
                },
                'Team': 'string',
                'LatencyInMs': {
                    'string': 123
                }
            },
        ],
        'GameSessionConnectionInfo': {
            'GameSessionArn': 'string',
            'IpAddress': 'string',
            'Port': 123,
            'MatchedPlayerSessions': [
                {
                    'PlayerId': 'string',
                    'PlayerSessionId': 'string'
                },
            ]
        }
    }
}

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. Tickets with players who fail to accept a proposed match are placed in FAILED status; new matchmaking requests can be submitted for these players.

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

        • TIMED_OUT – The matchmaking request was not completed within the duration specified in the matchmaking configuration. Matchmaking requests that time out can be resubmitted.

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

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

          Object used in matchmaking to represent a player. When starting a matchmaking request, a player has a player ID 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 name:value pairs containing player information for use in matchmaking. Player attribute names need to match playerAttributes names in the rule set being used. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}} .

            • (string) --

              • (dict) --

                Values for use in Player attribute type: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 occurances of the the repeated value after the first of a repeated value are ignored.

                  • (string) --

                • SDM (dict) --

                  For a map of up to 10 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 that are included in the object map. If not present (that is, null), FlexMatch ignores latency issues and may place the match in any region in the queue.

            Note

            If this property contains an empty map, FlexMatch assumes that no regions are available to the player. In this scenario, the ticket is not matchable and always times out unless canceled.

            • (string) --

              • (integer) --

      • GameSessionConnectionInfo (dict) --

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

        • GameSessionArn (string) --

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

        • IpAddress (string) --

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

        • Port (integer) --

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

        • MatchedPlayerSessions (list) --

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

          • (dict) --

            New player session 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