amazonka-gamelift-2.0: Amazon GameLift SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.GameLift.CreatePlayerSession

Description

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 PlayerSessions 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.

The maximum number of players per game session is 200. It is not adjustable.

Related actions

All APIs by task

Synopsis

Creating a Request

data CreatePlayerSession Source #

See: newCreatePlayerSession smart constructor.

Constructors

CreatePlayerSession' 

Fields

  • playerData :: Maybe Text

    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.

  • gameSessionId :: Text

    A unique identifier for the game session to add a player to.

  • playerId :: Text

    A unique identifier for a player. Player IDs are developer-defined.

Instances

Instances details
ToJSON CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

ToHeaders CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

ToPath CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

ToQuery CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

AWSRequest CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Associated Types

type AWSResponse CreatePlayerSession #

Generic CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Associated Types

type Rep CreatePlayerSession :: Type -> Type #

Read CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Show CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

NFData CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Methods

rnf :: CreatePlayerSession -> () #

Eq CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Hashable CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

type AWSResponse CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

type Rep CreatePlayerSession Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

type Rep CreatePlayerSession = D1 ('MetaData "CreatePlayerSession" "Amazonka.GameLift.CreatePlayerSession" "amazonka-gamelift-2.0-IjhNQby9jLV6gj30IrgsyK" 'False) (C1 ('MetaCons "CreatePlayerSession'" 'PrefixI 'True) (S1 ('MetaSel ('Just "playerData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "gameSessionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "playerId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newCreatePlayerSession Source #

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:

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.

CreatePlayerSession, createPlayerSession_gameSessionId - A unique identifier for the game session to add a player to.

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 #

See: newCreatePlayerSessionResponse smart constructor.

Constructors

CreatePlayerSessionResponse' 

Fields

Instances

Instances details
Generic CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Associated Types

type Rep CreatePlayerSessionResponse :: Type -> Type #

Read CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Show CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

NFData CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

Eq CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

type Rep CreatePlayerSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreatePlayerSession

type Rep CreatePlayerSessionResponse = D1 ('MetaData "CreatePlayerSessionResponse" "Amazonka.GameLift.CreatePlayerSession" "amazonka-gamelift-2.0-IjhNQby9jLV6gj30IrgsyK" 'False) (C1 ('MetaCons "CreatePlayerSessionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "playerSession") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe PlayerSession)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

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.