Copyright | (c) 2013-2021 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 |
Reserves an open player slot in a game session for a player. New player
sessions can be created in any game session with an open slot that is in
ACTIVE
status and has a player creation policy of ACCEPT_ALL
. You
can add a group of players to a game session with CreatePlayerSessions.
To create a player session, specify a game session ID, player ID, and optionally a set of player data.
If successful, a slot is reserved in the game session for the player and a new PlayerSession object is returned with a player session ID. The player references the player session ID when sending a connection request to the game session, and the game server can use it to validate the player reservation with the GameLift service. Player sessions cannot be updated.
Available in Amazon GameLift Local.
Related actions
CreatePlayerSession | CreatePlayerSessions | DescribePlayerSessions | StartGameSessionPlacement | DescribeGameSessionPlacement | All APIs by task
Synopsis
- data CreatePlayerSession = CreatePlayerSession' {
- playerData :: Maybe Text
- gameSessionId :: Text
- playerId :: Text
- newCreatePlayerSession :: Text -> Text -> CreatePlayerSession
- createPlayerSession_playerData :: Lens' CreatePlayerSession (Maybe Text)
- createPlayerSession_gameSessionId :: Lens' CreatePlayerSession Text
- createPlayerSession_playerId :: Lens' CreatePlayerSession Text
- data CreatePlayerSessionResponse = CreatePlayerSessionResponse' {}
- newCreatePlayerSessionResponse :: Int -> CreatePlayerSessionResponse
- createPlayerSessionResponse_playerSession :: Lens' CreatePlayerSessionResponse (Maybe PlayerSession)
- createPlayerSessionResponse_httpStatus :: Lens' CreatePlayerSessionResponse Int
Creating a Request
data CreatePlayerSession Source #
Represents the input for a request operation.
See: newCreatePlayerSession
smart constructor.
CreatePlayerSession' | |
|
Instances
newCreatePlayerSession Source #
:: Text | |
-> Text | |
-> CreatePlayerSession |
Create a value of CreatePlayerSession
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:playerData:CreatePlayerSession'
, createPlayerSession_playerData
- Developer-defined information related to a player. GameLift does not use
this data, so it can be formatted as needed for use in the game.
$sel:gameSessionId:CreatePlayerSession'
, createPlayerSession_gameSessionId
- A unique identifier for the game session to add a player to.
$sel:playerId:CreatePlayerSession'
, createPlayerSession_playerId
- A unique identifier for a player. Player IDs are developer-defined.
Request Lenses
createPlayerSession_playerData :: Lens' CreatePlayerSession (Maybe Text) Source #
Developer-defined information related to a player. GameLift does not use this data, so it can be formatted as needed for use in the game.
createPlayerSession_gameSessionId :: Lens' CreatePlayerSession Text Source #
A unique identifier for the game session to add a player to.
createPlayerSession_playerId :: Lens' CreatePlayerSession Text Source #
A unique identifier for a player. Player IDs are developer-defined.
Destructuring the Response
data CreatePlayerSessionResponse Source #
Represents the returned data in response to a request operation.
See: newCreatePlayerSessionResponse
smart constructor.
CreatePlayerSessionResponse' | |
|
Instances
newCreatePlayerSessionResponse Source #
Create a value of CreatePlayerSessionResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:playerSession:CreatePlayerSessionResponse'
, createPlayerSessionResponse_playerSession
- Object that describes the newly created player session record.
$sel:httpStatus:CreatePlayerSessionResponse'
, createPlayerSessionResponse_httpStatus
- The response's http status code.
Response Lenses
createPlayerSessionResponse_playerSession :: Lens' CreatePlayerSessionResponse (Maybe PlayerSession) Source #
Object that describes the newly created player session record.
createPlayerSessionResponse_httpStatus :: Lens' CreatePlayerSessionResponse Int Source #
The response's http status code.