Skip to main content

player_sessions

Creates, updates, deletes, gets or lists a player_sessions resource.

Overview

Nameplayer_sessions
TypeResource
Idaws.gamelift.player_sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestring (date-time)A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
dns_namestringThe DNS identifier assigned to the instance that is running the game session. Values have the following format: TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com. Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.) When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.
fleet_arnstringThe Amazon Resource Name (ARN) associated with the GameLift fleet that the player's game session is running on. (pattern: <code>^arn:.*:[a-z]*fleet/[a-z]*fleet-[a-zA-Z0-9-]+$</code>)
fleet_idstringA unique identifier for the fleet that the player's game session is running on. (pattern: <code>^[a-z]*fleet-[a-zA-Z0-9-]+$</code>)
game_session_idstringAn identifier for the game session that is unique across all regions that the player session is connected to. The value is always a full ARN in the following format: For Home Region game session - arn:aws:gamelift:<home_region>::gamesession/<fleet ID>/<ID string>. For Remote Location game session - arn:aws:gamelift:<home_region>::gamesession/<fleet ID>/&lt;location&gt;/<ID string>.
ip_addressstringThe IP address of the game session. To connect to a Amazon GameLift Servers game server, an app needs both the IP address and port number. (pattern: <code>^[0-9A-Fa-f:.]+$</code>)
player_datastringDeveloper-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.
player_idstringA unique identifier for a player that is associated with this player session.
player_session_idstringA unique identifier for a player session. (pattern: <code>^psess-\S+$</code>)
portintegerPort number for the game session. To connect to a Amazon GameLift Servers server process, an app needs both the IP address and port number.
statusstringCurrent status of the player session. Possible player session statuses include the following: RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated. ACTIVE -- The player has been validated by the server process and is currently connected. COMPLETED -- The player connection has been dropped. TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds). (RESERVED, ACTIVE, COMPLETED, TIMEDOUT)
termination_timestring (date-time)A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_player_sessionsselectregionThis API works with the following fleet types: EC2, Anywhere, Container Retrieves properties for one or more player sessions. This action can be used in the following ways: To retrieve a specific player session, provide the player session ID only. To retrieve all player sessions in a game session, provide the game session ID only. To retrieve all player sessions for a specific player, provide a player ID only. To request player sessions, specify either a player session ID, game session ID, or player ID. You can filter this request by player session status. If you provide a specific PlayerSessionId or PlayerId, Amazon GameLift Servers ignores the filter criteria. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a PlayerSession object is returned for each session that matches the request. Related actions All APIs by task
create_player_sessioninsertregion, GameSessionId, PlayerIdThis API works with the following fleet types: EC2, Anywhere, Container 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 Amazon GameLift Servers 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
create_player_sessionsinsertregion, GameSessionId, PlayerIdsThis API works with the following fleet types: EC2, Anywhere, Container Reserves open slots in a game session for a group of players. 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. To add a single player to a game session, use CreatePlayerSession To create player sessions, specify a game session ID and a list of player IDs. Optionally, provide a set of player data for each player ID. If successful, a slot is reserved in the game session for each player, and new PlayerSession objects are returned with player session IDs. Each player references their 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 Amazon GameLift Servers 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

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

This API works with the following fleet types: EC2, Anywhere, Container Retrieves properties for one or more player sessions. This action can be used in the following ways: To retrieve a specific player session, provide the player session ID only. To retrieve all player sessions in a game session, provide the game session ID only. To retrieve all player sessions for a specific player, provide a player ID only. To request player sessions, specify either a player session ID, game session ID, or player ID. You can filter this request by player session status. If you provide a specific PlayerSessionId or PlayerId, Amazon GameLift Servers ignores the filter criteria. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a PlayerSession object is returned for each session that matches the request. Related actions All APIs by task

SELECT
creation_time,
dns_name,
fleet_arn,
fleet_id,
game_session_id,
ip_address,
player_data,
player_id,
player_session_id,
port,
status,
termination_time
FROM aws.gamelift.player_sessions
WHERE region = '{{ region }}' -- required
;

INSERT examples

This API works with the following fleet types: EC2, Anywhere, Container 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 Amazon GameLift Servers 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

INSERT INTO aws.gamelift.player_sessions (
GameSessionId,
PlayerId,
PlayerData,
region
)
SELECT
'{{ GameSessionId }}' /* required */,
'{{ PlayerId }}' /* required */,
'{{ PlayerData }}',
'{{ region }}'
RETURNING
player_session
;