Skip to content

Commit e8c1f67

Browse files
author
awstools
committed
feat(client-gamelift): Amazon GameLift releases a new game session placement feature: PriorityConfigurationOverride. You can now override how a game session queue prioritizes placement locations for a single StartGameSessionPlacement request.
1 parent 11a7885 commit e8c1f67

File tree

9 files changed

+420
-179
lines changed

9 files changed

+420
-179
lines changed

clients/client-gamelift/src/commands/DescribeGameSessionPlacementCommand.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export interface DescribeGameSessionPlacementCommandOutput
4242
* <p>To get game session placement details, specify the placement ID.</p>
4343
* <p>This operation is not designed to be continually called to track game session status.
4444
* This practice can cause you to exceed your API limit, which results in errors. Instead,
45-
* you must configure configure an Amazon Simple Notification Service (SNS) topic to receive notifications from
46-
* FlexMatch or queues. Continuously polling with <code>DescribeGameSessionPlacement</code>
47-
* should only be used for games in development with low game session usage. </p>
45+
* you must configure an Amazon Simple Notification Service (SNS) topic to receive notifications from FlexMatch or
46+
* queues. Continuously polling with <code>DescribeGameSessionPlacement</code> should only
47+
* be used for games in development with low game session usage. </p>
4848
* @example
4949
* Use a bare-bones client and the command you need to make an API call.
5050
* ```javascript
@@ -92,6 +92,12 @@ export interface DescribeGameSessionPlacementCommandOutput
9292
* // ],
9393
* // GameSessionData: "STRING_VALUE",
9494
* // MatchmakerData: "STRING_VALUE",
95+
* // PriorityConfigurationOverride: { // PriorityConfigurationOverride
96+
* // PlacementFallbackStrategy: "DEFAULT_AFTER_SINGLE_PASS" || "NONE",
97+
* // LocationOrder: [ // LocationOrderOverrideList // required
98+
* // "STRING_VALUE",
99+
* // ],
100+
* // },
95101
* // },
96102
* // };
97103
*

clients/client-gamelift/src/commands/ListContainerFleetsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
ListContainerFleetsInput,
1111
ListContainerFleetsOutput,
1212
ListContainerFleetsOutputFilterSensitiveLog,
13-
} from "../models/models_0";
13+
} from "../models/models_1";
1414
import { de_ListContainerFleetsCommand, se_ListContainerFleetsCommand } from "../protocols/Aws_json1_1";
1515

1616
/**

clients/client-gamelift/src/commands/StartGameSessionPlacementCommand.ts

Lines changed: 83 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,84 @@ export interface StartGameSessionPlacementCommandInput extends StartGameSessionP
3333
export interface StartGameSessionPlacementCommandOutput extends StartGameSessionPlacementOutput, __MetadataBearer {}
3434

3535
/**
36-
* <p>Places a request for a new game session in a queue. When processing a placement
37-
* request, Amazon GameLift searches for available resources on the queue's destinations, scanning
38-
* each until it finds resources or the placement request times out.</p>
39-
* <p>A game session placement request can also request player sessions. When a new game
40-
* session is successfully created, Amazon GameLift creates a player session for each player
41-
* included in the request.</p>
42-
* <p>When placing a game session, by default Amazon GameLift tries each fleet in the order they are
43-
* listed in the queue configuration. Ideally, a queue's destinations are listed in
44-
* preference order.</p>
45-
* <p>Alternatively, when requesting a game session with players, you can also provide
46-
* latency data for each player in relevant Regions. Latency data indicates the performance
47-
* lag a player experiences when connected to a fleet in the Region. Amazon GameLift uses latency
48-
* data to reorder the list of destinations to place the game session in a Region with
49-
* minimal lag. If latency data is provided for multiple players, Amazon GameLift calculates each
50-
* Region's average lag for all players and reorders to get the best game play across all
51-
* players. </p>
52-
* <p>To place a new game session request, specify the following:</p>
36+
* <p>Makes a request to start a new game session using a game session queue. When
37+
* processing a placement request in a queue, Amazon GameLift finds the best possible available
38+
* resource to host the game session and prompts the resource to start the game session. </p>
39+
* <p>
40+
* <b>Request options</b>
41+
* </p>
42+
* <p>Call this API with the following minimum parameters:
43+
* <i>GameSessionQueueName</i>,
44+
* <i>MaximumPlayerSessionCount</i>, and
45+
* <i>PlacementID</i>. You can also include game session data (data formatted
46+
* as strings) or game properties (data formatted as key-value pairs) to pass to the new
47+
* game session.</p>
5348
* <ul>
5449
* <li>
55-
* <p>The queue name and a set of game session properties and settings</p>
50+
* <p>You can change how Amazon GameLift chooses a hosting resource for the new game session.
51+
* Prioritizing resources for game session placements is defined when you configure
52+
* a game session queue. You can use the default prioritization process or specify
53+
* a custom process by providing a <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_PriorityConfiguration.html">
54+
* PriorityConfiguration</a> when you create or update a queue.</p>
55+
* <ul>
56+
* <li>
57+
* <p>Prioritize based on resource cost and location, using the queue's
58+
* configured priority settings. Call this API with the minimum
59+
* parameters.</p>
60+
* </li>
61+
* <li>
62+
* <p>Prioritize based on latency. Include a set of values for
63+
* <i>PlayerLatencies</i>. You can provide latency data
64+
* with or without player session data. This option instructs Amazon GameLift to
65+
* reorder the queue's prioritized locations list based on the latency
66+
* data. If latency data is provided for multiple players, Amazon GameLift
67+
* calculates each location's average latency for all players and reorders
68+
* to find the lowest latency across all players. Don't include latency
69+
* data if you're providing a custom list of locations.</p>
70+
* </li>
71+
* <li>
72+
* <p>Prioritize based on a custom list of locations. If you're using a
73+
* queue that's configured to prioritize location first (see <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_PriorityConfiguration.html">PriorityConfiguration</a> for game session queues), use the
74+
* <i>PriorityConfigurationOverride</i> parameter to
75+
* substitute a different location list for this placement request. When
76+
* prioritizing placements by location, Amazon GameLift searches each location in
77+
* prioritized order to find an available hosting resource for the new game
78+
* session. You can choose whether to use the override list for the first
79+
* placement attempt only or for all attempts.</p>
80+
* </li>
81+
* </ul>
5682
* </li>
5783
* <li>
58-
* <p>A unique ID (such as a UUID) for the placement. You use this ID to track the
59-
* status of the placement request</p>
84+
* <p>You can request new player sessions for a group of players. Include the
85+
* <i>DesiredPlayerSessions</i> parameter and include at minimum
86+
* a unique player ID for each. You can also include player-specific data to pass
87+
* to the new game session. </p>
6088
* </li>
89+
* </ul>
90+
* <p>
91+
* <b>Result</b>
92+
* </p>
93+
* <p>If successful, this request generates a new game session placement request and adds it
94+
* to the game session queue for Amazon GameLift to process in turn. You can track the status of
95+
* individual placement requests by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionPlacement.html">DescribeGameSessionPlacement</a>. A new game session is running if the status
96+
* is <code>FULFILLED</code> and the request returns the game session connection
97+
* information (IP address and port). If you include player session data, Amazon GameLift creates a
98+
* player session for each player ID in the request.</p>
99+
* <p>The request results in a <code>BadRequestException</code> in the following
100+
* situations:</p>
101+
* <ul>
61102
* <li>
62-
* <p>(Optional) A set of player data and a unique player ID for each player that
63-
* you are joining to the new game session (player data is optional, but if you
64-
* include it, you must also provide a unique ID for each player)</p>
103+
* <p>If the request includes both <i>PlayerLatencies</i> and
104+
* <i>PriorityConfigurationOverride</i> parameters.</p>
65105
* </li>
66106
* <li>
67-
* <p>Latency data for all players (if you want to optimize game play for the
68-
* players)</p>
107+
* <p>If the request includes the <i>PriorityConfigurationOverride</i>
108+
* parameter and designates a queue doesn't prioritize locations.</p>
69109
* </li>
70110
* </ul>
71-
* <p>If successful, a new game session placement is created.</p>
72-
* <p>To track the status of a placement request, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionPlacement.html">DescribeGameSessionPlacement</a> and check the request's status. If the status
73-
* is <code>FULFILLED</code>, a new game session has been created and a game session ARN
74-
* and Region are referenced. If the placement request times out, you can resubmit the
75-
* request or retry it with a different queue. </p>
111+
* <p>Amazon GameLift continues to retry each placement request until it reaches the queue's timeout
112+
* setting. If a request times out, you can resubmit the request to the same queue or try a
113+
* different queue. </p>
76114
* @example
77115
* Use a bare-bones client and the command you need to make an API call.
78116
* ```javascript
@@ -104,6 +142,12 @@ export interface StartGameSessionPlacementCommandOutput extends StartGameSession
104142
* },
105143
* ],
106144
* GameSessionData: "STRING_VALUE",
145+
* PriorityConfigurationOverride: { // PriorityConfigurationOverride
146+
* PlacementFallbackStrategy: "DEFAULT_AFTER_SINGLE_PASS" || "NONE",
147+
* LocationOrder: [ // LocationOrderOverrideList // required
148+
* "STRING_VALUE",
149+
* ],
150+
* },
107151
* };
108152
* const command = new StartGameSessionPlacementCommand(input);
109153
* const response = await client.send(command);
@@ -143,6 +187,12 @@ export interface StartGameSessionPlacementCommandOutput extends StartGameSession
143187
* // ],
144188
* // GameSessionData: "STRING_VALUE",
145189
* // MatchmakerData: "STRING_VALUE",
190+
* // PriorityConfigurationOverride: { // PriorityConfigurationOverride
191+
* // PlacementFallbackStrategy: "DEFAULT_AFTER_SINGLE_PASS" || "NONE",
192+
* // LocationOrder: [ // LocationOrderOverrideList // required
193+
* // "STRING_VALUE",
194+
* // ],
195+
* // },
146196
* // },
147197
* // };
148198
*
@@ -168,6 +218,9 @@ export interface StartGameSessionPlacementCommandOutput extends StartGameSession
168218
* @throws {@link UnauthorizedException} (client fault)
169219
* <p>The client failed authentication. Clients should not retry such requests.</p>
170220
*
221+
* @throws {@link UnsupportedRegionException} (client fault)
222+
* <p>The requested operation is not supported in the Region specified.</p>
223+
*
171224
* @throws {@link GameLiftServiceException}
172225
* <p>Base exception class for all service exceptions from GameLift service.</p>
173226
*

clients/client-gamelift/src/commands/StopGameSessionPlacementCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ export interface StopGameSessionPlacementCommandOutput extends StopGameSessionPl
8282
* // ],
8383
* // GameSessionData: "STRING_VALUE",
8484
* // MatchmakerData: "STRING_VALUE",
85+
* // PriorityConfigurationOverride: { // PriorityConfigurationOverride
86+
* // PlacementFallbackStrategy: "DEFAULT_AFTER_SINGLE_PASS" || "NONE",
87+
* // LocationOrder: [ // LocationOrderOverrideList // required
88+
* // "STRING_VALUE",
89+
* // ],
90+
* // },
8591
* // },
8692
* // };
8793
*

clients/client-gamelift/src/commands/TerminateGameSessionCommand.ts

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,55 @@ export interface TerminateGameSessionCommandInput extends TerminateGameSessionIn
3232
export interface TerminateGameSessionCommandOutput extends TerminateGameSessionOutput, __MetadataBearer {}
3333

3434
/**
35-
* <p>Ends a game session that's currently in progress. You can use this action to terminate
36-
* any game session that isn't in <code>TERMINATED</code> or <code>TERMINATING</code>
37-
* status. Terminating a game session is the most efficient way to free up a server process
38-
* when it's hosting a game session that's in a bad state or not ending naturally. You can
39-
* use this action to terminate a game session that's being hosted on any type of Amazon GameLift
40-
* fleet compute, including computes for managed EC2, managed container, and Anywhere
41-
* fleets.</p>
42-
* <p>There are two potential methods for terminating a game session:</p>
43-
* <ul>
44-
* <li>
45-
* <p>With a graceful termination, the Amazon GameLift service prompts the server process to initiate its
46-
* normal game session shutdown sequence. This sequence is implemented in the game
47-
* server code and might involve a variety of actions to gracefully end a game
48-
* session, such as notifying players, and stop the server process. </p>
49-
* </li>
50-
* <li>
51-
* <p>With a forceful termination, the Amazon GameLift service takes immediate action to terminate the game
52-
* session by stopping the server process. Termination occurs without the normal
53-
* game session shutdown sequence. </p>
54-
* </li>
55-
* </ul>
35+
* <p>Ends a game session that's currently in progress. Use this action to terminate any
36+
* game session that isn't in <code>ERROR</code> status. Terminating a game session is the
37+
* most efficient way to free up a server process when it's hosting a game session that's
38+
* in a bad state or not ending properly. You can use this action to terminate a game
39+
* session that's being hosted on any type of Amazon GameLift fleet compute, including computes for
40+
* managed EC2, managed container, and Anywhere fleets. The game server must be integrated
41+
* with Amazon GameLift server SDK 5.x or greater.</p>
5642
* <p>
5743
* <b>Request options</b>
5844
* </p>
45+
* <p>Request termination for a single game session. Provide the game session ID and the
46+
* termination mode. There are two potential methods for terminating a game session:</p>
5947
* <ul>
6048
* <li>
61-
* <p>Request termination for a single game session. Provide the game session ID and
62-
* the termination method. </p>
49+
* <p>Initiate a graceful termination using the normal game session shutdown
50+
* sequence. With this mode, the Amazon GameLift service prompts the server process that's
51+
* hosting the game session by calling the server SDK callback method
52+
* <code>OnProcessTerminate()</code>. The callback implementation is part of
53+
* the custom game server code. It might involve a variety of actions to gracefully
54+
* end a game session, such as notifying players, before stopping the server
55+
* process.</p>
56+
* </li>
57+
* <li>
58+
* <p>Force an immediate game session termination. With this mode, the Amazon GameLift
59+
* service takes action to stop the server process, which ends the game session
60+
* without the normal game session shutdown sequence. </p>
6361
* </li>
6462
* </ul>
6563
* <p>
6664
* <b>Results</b>
6765
* </p>
68-
* <p>If successful, game session termination is initiated, which includes changing the game
69-
* session status to <code>TERMINATING</code>. As a result of this action, and depending on
70-
* the implementation of <code>OnProcessTerminate()</code>, the server process either
71-
* becomes available to host a new game session, or it's recycled and a new server process
72-
* started with availability to host a game session. The game session status is changed to
73-
* <code>TERMINATED</code>, with a status reason that indicates the termination method
74-
* used.</p>
66+
* <p>If successful, game session termination is initiated. During this activity, the game
67+
* session status is changed to <code>TERMINATING</code>. When completed, the server
68+
* process that was hosting the game session has been stopped and replaced with a new
69+
* server process that's ready to host a new game session. The old game session's status is
70+
* changed to <code>TERMINATED</code> with a status reason that indicates the termination
71+
* method used.</p>
72+
* <p>
73+
* <b>Learn more</b>
74+
* </p>
75+
* <p>
76+
* <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html">Add Amazon GameLift to your game server</a>
77+
* </p>
78+
* <p>Amazon GameLift server SDK 5 reference guide for <code>OnProcessTerminate()</code>
79+
* (<a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk5-cpp-initsdk.html">C++</a>)
80+
* (<a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk5-csharp-initsdk.html">C#</a>)
81+
* (<a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk5-unreal-initsdk.html">Unreal</a>)
82+
* (<a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk-go-initsdk.html">Go</a>)
83+
* </p>
7584
* @example
7685
* Use a bare-bones client and the command you need to make an API call.
7786
* ```javascript

0 commit comments

Comments
 (0)