Skip to content

Commit 9c8b6c6

Browse files
author
awstools
committed
feat(client-gamelift): Amazon GameLift adds the ability to add and update the game properties of active game sessions.
1 parent f6658b4 commit 9c8b6c6

File tree

5 files changed

+84
-49
lines changed

5 files changed

+84
-49
lines changed

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ export interface SearchGameSessionsCommandOutput extends SearchGameSessionsOutpu
4343
* @public
4444
* <p>Retrieves all active game sessions that match a set of search criteria and sorts them
4545
* into a specified order. </p>
46-
* <p>This operation is not designed to be continually called to track game session status.
47-
* This practice can cause you to exceed your API limit, which results in errors. Instead,
48-
* you must configure configure an Amazon Simple Notification Service (SNS) topic to receive notifications from
49-
* FlexMatch or queues. Continuously polling game session status with
50-
* <code>DescribeGameSessions</code> should only be used for games in development with
51-
* low game session usage. </p>
46+
* <p>This operation is not designed to continually track game session status because that practice can cause you to exceed your API limit and generate errors. Instead, configure an Amazon Simple Notification Service (Amazon SNS) topic to receive notifications from a matchmaker or game session placement queue.</p>
5247
* <p>When searching for game sessions, you specify exactly where you want to search and
5348
* provide a search filter expression, a sort expression, or both. A search request can
5449
* search only one fleet, but it can search all of a fleet's locations. </p>
@@ -70,7 +65,7 @@ export interface SearchGameSessionsCommandOutput extends SearchGameSessionsOutpu
7065
* <p>If successful, a <code>GameSession</code> object is returned for each game session
7166
* that matches the request. Search finds game sessions that are in <code>ACTIVE</code>
7267
* status only. To retrieve information on game sessions in other statuses, use <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessions.html">DescribeGameSessions</a> .</p>
73-
* <p>You can search or sort by the following game session attributes:</p>
68+
* <p>To set search and sort criteria, create a filter expression using the following game session attributes. For game session search examples, see the Examples section of this topic.</p>
7469
* <ul>
7570
* <li>
7671
* <p>
@@ -84,14 +79,14 @@ export interface SearchGameSessionsCommandOutput extends SearchGameSessionsOutpu
8479
* </li>
8580
* <li>
8681
* <p>
87-
* <b>gameSessionProperties</b> -- Custom data defined
88-
* in a game session's <code>GameProperty</code> parameter.
89-
* <code>GameProperty</code> values are stored as key:value pairs; the filter
90-
* expression must indicate the key and a string to search the data values for. For
91-
* example, to search for game sessions with custom data containing the key:value
92-
* pair "gameMode:brawl", specify the following:
93-
* <code>gameSessionProperties.gameMode = "brawl"</code>. All custom data
94-
* values are searched as strings.</p>
82+
* <b>gameSessionProperties</b> -- A set of key-value pairs that can store custom data in a game session.
83+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.
84+
* The filter expression must specify the <a>GameProperty</a> -- a <code>Key</code> and a string <code>Value</code> to search for the game sessions.</p>
85+
* <p>For example, to search for the above key-value pair, specify the following search filter: <code>gameSessionProperties.difficulty = "novice"</code>.
86+
* All game property values are searched as strings.</p>
87+
* <p>
88+
* For examples of searching game sessions, see the ones below, and also see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-search">Search game sessions by game property</a>.
89+
* </p>
9590
* </li>
9691
* <li>
9792
* <p>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export interface UpdateGameSessionCommandOutput extends UpdateGameSessionOutput,
6060
* Name: "STRING_VALUE",
6161
* PlayerSessionCreationPolicy: "ACCEPT_ALL" || "DENY_ALL",
6262
* ProtectionPolicy: "NoProtection" || "FullProtection",
63+
* GameProperties: [ // GamePropertyList
64+
* { // GameProperty
65+
* Key: "STRING_VALUE", // required
66+
* Value: "STRING_VALUE", // required
67+
* },
68+
* ],
6369
* };
6470
* const command = new UpdateGameSessionCommand(input);
6571
* const response = await client.send(command);

clients/client-gamelift/src/models/models_0.ts

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,11 +2877,15 @@ export interface CreateGameServerGroupOutput {
28772877

28782878
/**
28792879
* @public
2880-
* <p>Set of key-value pairs that contain information about a game session. When included in
2881-
* a game session request, these properties communicate details to be used when setting up
2882-
* the new game session. For example, a game property might specify a game mode, level, or
2883-
* map. Game properties are passed to the game server process when initiating a new game
2884-
* session. For more information, see the <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-create"> Amazon GameLift Developer Guide</a>.</p>
2880+
* <p>This key-value pair can store custom data about a game session.
2881+
* For example, you might use a <code>GameProperty</code> to track a game session's map, level of difficulty, or remaining time.
2882+
* The difficulty level could be specified like this: <code>\{"Key": "difficulty", "Value":"Novice"\}</code>.
2883+
* </p>
2884+
* <p>
2885+
* You can set game properties when creating a game session. You can also modify game properties of an active game session. When searching for game sessions, you can filter on game property keys and values. You can't delete game properties from a game session.
2886+
* </p>
2887+
* <p>For examples of working with game properties, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties">Create a game session with properties</a>.
2888+
* </p>
28852889
*/
28862890
export interface GameProperty {
28872891
/**
@@ -2930,7 +2934,10 @@ export interface CreateGameSessionInput {
29302934

29312935
/**
29322936
* @public
2933-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
2937+
* <p>A set of key-value pairs that can store custom data in a game session.
2938+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.
2939+
* For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-create">Create a game session with custom properties</a>.
2940+
* </p>
29342941
*/
29352942
GameProperties?: GameProperty[];
29362943

@@ -3116,7 +3123,8 @@ export interface GameSession {
31163123

31173124
/**
31183125
* @public
3119-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
3126+
* <p>A set of key-value pairs that can store custom data in a game session.
3127+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.</p>
31203128
*/
31213129
GameProperties?: GameProperty[];
31223130

@@ -3715,7 +3723,8 @@ export interface CreateMatchmakingConfigurationInput {
37153723

37163724
/**
37173725
* @public
3718-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>). This information is added to the new <code>GameSession</code> object that is
3726+
* <p>A set of key-value pairs that can store custom data in a game session.
3727+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>. This information is added to the new <code>GameSession</code> object that is
37193728
* created for a successful match. This parameter is not used if <code>FlexMatchMode</code>
37203729
* is set to <code>STANDALONE</code>.</p>
37213730
*/
@@ -3872,7 +3881,8 @@ export interface MatchmakingConfiguration {
38723881

38733882
/**
38743883
* @public
3875-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>). This information is added to the new <code>GameSession</code> object that is
3884+
* <p>A set of key-value pairs that can store custom data in a game session.
3885+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>. This information is added to the new <code>GameSession</code> object that is
38763886
* created for a successful match. This parameter is not used when
38773887
* <code>FlexMatchMode</code> is set to <code>STANDALONE</code>.</p>
38783888
*/
@@ -5466,18 +5476,19 @@ export interface Event {
54665476
* </li>
54675477
* <li>
54685478
* <p>SERVER_PROCESS_SDK_INITIALIZATION_TIMEOUT -- The server process did not call
5469-
* InitSDK() within the time expected. Check your game session log to see why
5470-
* InitSDK() was not called in time.</p>
5479+
* <code>InitSDK()</code> within the time expected (5 minutes). Check your game
5480+
* session log to see why <code>InitSDK()</code> was not called in time.</p>
54715481
* </li>
54725482
* <li>
54735483
* <p>SERVER_PROCESS_PROCESS_READY_TIMEOUT -- The server process did not call
5474-
* ProcessReady() within the time expected after calling InitSDK(). Check your game
5475-
* session log to see why ProcessReady() was not called in time.</p>
5484+
* <code>ProcessReady()</code> within the time expected (5 minutes) after
5485+
* calling <code>InitSDK()</code>. Check your game session log to see why
5486+
* <code>ProcessReady()</code> was not called in time.</p>
54765487
* </li>
54775488
* <li>
54785489
* <p>SERVER_PROCESS_CRASHED -- The server process exited without calling
5479-
* ProcessEnding(). Check your game session log to see why ProcessEnding() was not
5480-
* called.</p>
5490+
* <code>ProcessEnding()</code>. Check your game session log to see why
5491+
* <code>ProcessEnding()</code> was not called.</p>
54815492
* </li>
54825493
* <li>
54835494
* <p>SERVER_PROCESS_TERMINATED_UNHEALTHY -- The server process did not report a
@@ -5487,13 +5498,14 @@ export interface Event {
54875498
* </li>
54885499
* <li>
54895500
* <p>SERVER_PROCESS_FORCE_TERMINATED -- The server process did not exit cleanly
5490-
* after OnProcessTerminate() was sent within the time expected. Check your game
5491-
* session log to see why termination took longer than expected.</p>
5501+
* within the time expected after <code>OnProcessTerminate()</code> was sent. Check
5502+
* your game session log to see why termination took longer than expected.</p>
54925503
* </li>
54935504
* <li>
54945505
* <p>SERVER_PROCESS_PROCESS_EXIT_TIMEOUT -- The server process did not exit cleanly
5495-
* within the time expected after calling ProcessEnding(). Check your game session
5496-
* log to see why termination took longer than expected.</p>
5506+
* within the time expected (30 seconds) after calling
5507+
* <code>ProcessEnding()</code>. Check your game session log to see why termination
5508+
* took longer than expected.</p>
54975509
* </li>
54985510
* </ul>
54995511
* <p>
@@ -5502,8 +5514,9 @@ export interface Event {
55025514
* <ul>
55035515
* <li>
55045516
* <p>GAME_SESSION_ACTIVATION_TIMEOUT -- GameSession failed to activate within the
5505-
* expected time. Check your game session log to see why ActivateGameSession() took
5506-
* longer to complete than expected.</p>
5517+
* expected time. Check your game session log to see why
5518+
* <code>ActivateGameSession()</code> took longer to complete than
5519+
* expected.</p>
55075520
* </li>
55085521
* </ul>
55095522
* <p>
@@ -6289,7 +6302,8 @@ export interface GameSessionPlacement {
62896302

62906303
/**
62916304
* @public
6292-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
6305+
* <p>A set of key-value pairs that can store custom data in a game session.
6306+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.</p>
62936307
*/
62946308
GameProperties?: GameProperty[];
62956309

@@ -9010,7 +9024,8 @@ export interface StartGameSessionPlacementInput {
90109024

90119025
/**
90129026
* @public
9013-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
9027+
* <p>A set of key-value pairs that can store custom data in a game session.
9028+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.</p>
90149029
*/
90159030
GameProperties?: GameProperty[];
90169031

clients/client-gamelift/src/models/models_1.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,18 @@ export interface UpdateGameSessionInput {
329329
* </ul>
330330
*/
331331
ProtectionPolicy?: ProtectionPolicy;
332+
333+
/**
334+
* @public
335+
* <p>A set of key-value pairs that can store custom data in a game session.
336+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>.
337+
* You can use this parameter to modify game properties in an active game session.
338+
* This action adds new properties and modifies existing properties.
339+
* There is no way to delete properties.
340+
* For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.
341+
* </p>
342+
*/
343+
GameProperties?: GameProperty[];
332344
}
333345

334346
/**
@@ -498,7 +510,8 @@ export interface UpdateMatchmakingConfigurationInput {
498510

499511
/**
500512
* @public
501-
* <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>). This information is added to the new <code>GameSession</code> object that is
513+
* <p>A set of key-value pairs that can store custom data in a game session.
514+
* For example: <code>\{"Key": "difficulty", "Value": "novice"\}</code>. This information is added to the new <code>GameSession</code> object that is
502515
* created for a successful match. This parameter is not used if <code>FlexMatchMode</code>
503516
* is set to <code>STANDALONE</code>.</p>
504517
*/

0 commit comments

Comments
 (0)