Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 IDs and player data for each player you want to join to the new game session
- 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.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
- Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
- startGameSessionPlacement :: Text -> Text -> Natural -> StartGameSessionPlacement
- data StartGameSessionPlacement
- sgspGameProperties :: Lens' StartGameSessionPlacement [GameProperty]
- sgspGameSessionName :: Lens' StartGameSessionPlacement (Maybe Text)
- sgspPlayerLatencies :: Lens' StartGameSessionPlacement [PlayerLatency]
- sgspGameSessionData :: Lens' StartGameSessionPlacement (Maybe Text)
- sgspDesiredPlayerSessions :: Lens' StartGameSessionPlacement [DesiredPlayerSession]
- sgspPlacementId :: Lens' StartGameSessionPlacement Text
- sgspGameSessionQueueName :: Lens' StartGameSessionPlacement Text
- sgspMaximumPlayerSessionCount :: Lens' StartGameSessionPlacement Natural
- startGameSessionPlacementResponse :: Int -> StartGameSessionPlacementResponse
- data StartGameSessionPlacementResponse
- sgsprsGameSessionPlacement :: Lens' StartGameSessionPlacementResponse (Maybe GameSessionPlacement)
- sgsprsResponseStatus :: Lens' StartGameSessionPlacementResponse Int
Creating a Request
startGameSessionPlacement Source #
:: Text | |
-> Text | |
-> Natural | |
-> StartGameSessionPlacement |
Creates a value of StartGameSessionPlacement
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
sgspGameProperties
- Set of developer-defined properties for a game session, formatted as a set of type:value pairs. These properties are included in theGameSession
object, which is passed to the game server with a request to start a new game session (see Start a Game Session ).sgspGameSessionName
- Descriptive label that is associated with a game session. Session names do not need to be unique.sgspPlayerLatencies
- 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.sgspGameSessionData
- Set of developer-defined game session properties, formatted as a single string value. This data is included in theGameSession
object, which is passed to the game server with a request to start a new game session (see Start a Game Session ).sgspDesiredPlayerSessions
- Set of information on each player to create a player session for.sgspPlacementId
- 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.sgspGameSessionQueueName
- Name of the queue to use to place the new game session.sgspMaximumPlayerSessionCount
- Maximum number of players that can be connected simultaneously to the game session.
data StartGameSessionPlacement Source #
Represents the input for a request action.
See: startGameSessionPlacement
smart constructor.
Request Lenses
sgspGameProperties :: Lens' StartGameSessionPlacement [GameProperty] Source #
Set of developer-defined properties for a game session, formatted as a set of type:value pairs. These properties are included in the GameSession
object, which is passed to the game server with a request to start a new game session (see Start a Game Session ).
sgspGameSessionName :: Lens' StartGameSessionPlacement (Maybe Text) Source #
Descriptive label that is associated with a game session. Session names do not need to be unique.
sgspPlayerLatencies :: Lens' StartGameSessionPlacement [PlayerLatency] Source #
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.
sgspGameSessionData :: Lens' StartGameSessionPlacement (Maybe Text) Source #
Set of developer-defined game session properties, formatted as a single string value. This data is included in the GameSession
object, which is passed to the game server with a request to start a new game session (see Start a Game Session ).
sgspDesiredPlayerSessions :: Lens' StartGameSessionPlacement [DesiredPlayerSession] Source #
Set of information on each player to create a player session for.
sgspPlacementId :: Lens' StartGameSessionPlacement Text Source #
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.
sgspGameSessionQueueName :: Lens' StartGameSessionPlacement Text Source #
Name of the queue to use to place the new game session.
sgspMaximumPlayerSessionCount :: Lens' StartGameSessionPlacement Natural Source #
Maximum number of players that can be connected simultaneously to the game session.
Destructuring the Response
startGameSessionPlacementResponse Source #
Creates a value of StartGameSessionPlacementResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
sgsprsGameSessionPlacement
- 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.sgsprsResponseStatus
- -- | The response status code.
data StartGameSessionPlacementResponse Source #
Represents the returned data in response to a request action.
See: startGameSessionPlacementResponse
smart constructor.
Response Lenses
sgsprsGameSessionPlacement :: Lens' StartGameSessionPlacementResponse (Maybe GameSessionPlacement) Source #
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.
sgsprsResponseStatus :: Lens' StartGameSessionPlacementResponse Int Source #
- - | The response status code.