start_game_session_placement
¶
start_game_session_placement(
*,
config_overrides: Optional[GameLiftClientConfig] = None,
placement_id: Optional[IdStringModel] = None,
game_session_queue_name: Optional[GameSessionQueueNameOrArn] = None,
game_properties: Optional[GamePropertyList] = None,
maximum_player_session_count: Optional[WholeNumber] = None,
game_session_name: Optional[NonZeroAndMaxString] = None,
player_latencies: Optional[PlayerLatencyList] = None,
desired_player_sessions: Optional[DesiredPlayerSessionList] = None,
game_session_data: Optional[LargeGameSessionData] = None,
priority_configuration_override: Optional[PriorityConfigurationOverride] = None,
) -> StartGameSessionPlacementOutput
This API works with the following fleet types: EC2, Anywhere, Container
Makes a request to start a new game session using a game session queue. When processing a placement request, Amazon GameLift Servers looks for the best possible available resource to host the game session, based on how the queue is configured to prioritize factors such as resource cost, latency, and location. After selecting an available resource, Amazon GameLift Servers prompts the resource to start a game session. A placement request can include a list of players to create a set of player sessions. The request can also include information to pass to the new game session, such as to specify a game map or other options.
Request options
Use this operation to make the following types of requests.
-
Request a placement using the queue's default prioritization process (see the default prioritization described in PriorityConfiguration). Include these required parameters:
-
GameSessionQueueName -
MaximumPlayerSessionCount -
PlacementID
-
-
Request a placement and prioritize based on latency. Include these parameters:
-
Required parameters
GameSessionQueueName,MaximumPlayerSessionCount,PlacementID. -
PlayerLatencies. Include a set of latency values for destinations in the queue. When a request includes latency data, Amazon GameLift Servers automatically reorders the queue's locations priority list based on lowest available latency values. If a request includes latency data for multiple players, Amazon GameLift Servers calculates each location's average latency for all players and reorders to find the lowest latency across all players. -
Don't include
PriorityConfigurationOverride.
-
Prioritize based on a custom list of locations. If you're using a queue that's configured to prioritize location first (see PriorityConfiguration for game session queues), you can optionally use the PriorityConfigurationOverride parameter to substitute a different location priority list for this placement request. Amazon GameLift Servers searches each location on the priority override list to find an available hosting resource for the new game session. Specify a fallback strategy to use in the event that Amazon GameLift Servers fails to place the game session in any of the locations on the override list.
-
-
Request a placement and prioritize based on a custom list of locations.
-
You can request new player sessions for a group of players. Include the DesiredPlayerSessions parameter and include at minimum a unique player ID for each. You can also include player-specific data to pass to the new game session.
Result
If successful, this operation generates a new game session placement request and adds it to the game session queue for processing. You can track the status of individual placement requests by calling DescribeGameSessionPlacement or by monitoring queue notifications. When the request status is FULFILLED, a new game session has started and the placement request is updated with connection information for the game session (IP address and port). If the request included player session data, Amazon GameLift Servers creates a player session for each player ID in the request.
The request results in a InvalidRequestException in the following situations:
-
If the request includes both PlayerLatencies and PriorityConfigurationOverride parameters.
-
If the request includes the PriorityConfigurationOverride parameter and specifies a queue that doesn't prioritize locations.
Amazon GameLift Servers continues to retry each placement request until it reaches the queue's timeout setting. If a request times out, you can resubmit the request to the same queue or try a different queue.
Parameters:
-
placement_id(Optional[IdStringModel], default:None) –A 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.
-
game_session_queue_name(Optional[GameSessionQueueNameOrArn], default:None) –Name of the queue to use to place the new game session. You can use either the queue name or ARN value.
-
game_properties(Optional[GamePropertyList], default:None) –A set of key-value pairs that can store custom data in a game session. For example:
{"Key": "difficulty", "Value": "novice"}.-
Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.
-
If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.
-
-
maximum_player_session_count(Optional[WholeNumber], default:None) –The maximum number of players that can be connected simultaneously to the game session.
-
game_session_name(Optional[NonZeroAndMaxString], default:None) –A descriptive label that is associated with a game session. Session names do not need to be unique.
-
player_latencies(Optional[PlayerLatencyList], default:None) –A set of values, expressed in milliseconds, that indicates the amount of latency that a player experiences when connected to a fleet location (Amazon Web Services Regions or custom locations for Amazon GameLift Servers Anywhere fleets). This information is used to try to place the new game session where it can offer the best possible gameplay experience for the players.
-
desired_player_sessions(Optional[DesiredPlayerSessionList], default:None) –Set of information on each player to create a player session for.
-
game_session_data(Optional[LargeGameSessionData], default:None) –A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session. For more information, see Start a game session.
-
priority_configuration_override(Optional[PriorityConfigurationOverride], default:None) –A prioritized list of locations to use for the game session placement and instructions on how to use it. This list overrides a queue's prioritized location list for this game session placement request only. You can include Amazon Web Services Regions, local zones, and custom locations (for Anywhere fleets). You can choose to limit placements to locations on the override list only, or you can prioritize locations on the override list first and then fall back to the queue's other locations if needed. Choose a fallback strategy to use in the event that Amazon GameLift Servers fails to place a game session in any of the locations on the priority override list.
Raises:
-
InternalServiceException–The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
-
InvalidRequestException–One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
-
NotFoundException–The requested resource was not found. The resource was either not created yet or deleted.
-
UnauthorizedException–The client failed authentication. Clients should not retry such requests.
-
UnsupportedRegionException–The requested operation is not supported in the Region specified.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/game_lift.py
9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 | |