player_sessions
Creates, updates, deletes, gets or lists a player_sessions resource.
Overview
| Name | player_sessions |
| Type | Resource |
| Id | aws.gamelift.player_sessions |
Fields
The following fields are returned by SELECT queries:
- describe_player_sessions
| Name | Datatype | Description |
|---|---|---|
creation_time | string (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_name | string | The 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_arn | string | The 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_id | string | A 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_id | string | An 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>/<location>/<ID string>. |
ip_address | string | The 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_data | string | Developer-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_id | string | A unique identifier for a player that is associated with this player session. |
player_session_id | string | A unique identifier for a player session. (pattern: <code>^psess-\S+$</code>) |
port | integer | Port number for the game session. To connect to a Amazon GameLift Servers server process, an app needs both the IP address and port number. |
status | string | Current 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_time | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_player_sessions | select | region | 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 | |
create_player_session | insert | region, GameSessionId, PlayerId | 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 | |
create_player_sessions | insert | region, GameSessionId, PlayerIds | This 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_player_sessions
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
- create_player_session
- create_player_sessions
- Manifest
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
;
This 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
INSERT INTO aws.gamelift.player_sessions (
GameSessionId,
PlayerIds,
PlayerDataMap,
region
)
SELECT
'{{ GameSessionId }}' /* required */,
'{{ PlayerIds }}' /* required */,
'{{ PlayerDataMap }}',
'{{ region }}'
RETURNING
player_sessions
;
# Description fields are for documentation purposes
- name: player_sessions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the player_sessions resource.
- name: GameSessionId
value: "{{ GameSessionId }}"
description: |
An identifier for the game session that is unique across all regions to add players 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>/`<location>`/<ID string>.
- name: PlayerId
value: "{{ PlayerId }}"
description: |
A unique identifier for a player. Player IDs are developer-defined.
- name: PlayerData
value: "{{ PlayerData }}"
description: |
Developer-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.
- name: PlayerIds
value:
- "{{ PlayerIds }}"
description: |
List of unique identifiers for the players to be added.
- name: PlayerDataMap
value: "{{ PlayerDataMap }}"
description: |
Map of string pairs, each specifying a player ID and a set of developer-defined information related to the player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game. Any player data strings for player IDs that are not included in the PlayerIds parameter are ignored.