

# Game and player sessions in the Amazon GameLift Servers console
<a name="gamelift-console-game-player-sessions-metrics"></a>

You can use the Amazon GameLift Servers console to work with games sessions and player sessions. For more information about game sessions and player sessions, see [Amazon GameLift Servers and the player experience](game-sessions-intro.md). The Amazon GameLift Servers console provides information and tools to help you investigate issues with your game sessions.

What you can do:
+ Explore game session and player session activity that is hosted on a specific fleet.
+ Look up game session activity for a specific player across multiple fleets.
+ Shut down a specific game session. 

## View game session detail
<a name="game-sessions"></a>

Game session and player session data is organized by the fleet that hosts the game session.

**To access game session and player session information**

1. In the [Amazon GameLift Servers console](https://console.aws.amazon.com/gamelift/), open the left navigation pane. Select a hosting solution type and open the **Fleets** page. For example:
   + **Hosting**, **Anywhere**, **Fleets**
   + **Hosting**, **Managed EC2**, **Fleets**
   + **Hosting**, **Managed containers**, **Fleets**

1. Each **Fleets** page displays the list of fleets for your currently selected AWS Region. Choose the fleet that you want to view game session data for.

1. In the fleet's detail page, open the **Game sessions** tab. This tab lists all game sessions that were hosted on the fleet, along with summary information. You can adjust the table content as needed using the **Preferences** tool (see the ![\[Gear icon representing settings or configuration options.\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/images/settings.png) icon in the upper right corner of the table). Custom preferences are saved to your AWS account user and are automatically applied whenever you view this page.

1. Choose a game session from the list to view additional information. 

1. If the game session includes player session data, choose **View player sessions** to open the player sessions lookup tool with the game session ID automatically filled in.

The **Game sessions** detail include the following information:
+ **Status** – Game session status.
  + **Activating** – The instance is initiating a game session.
  + **Active** – A game session is running and available to receive players, depending on the session's [player creation policy](https://docs.aws.amazon.com/gamelift/latest/apireference/API_GameSession.html).
  + **Terminated** – the game session has ended.
+ **ARN** – The Amazon Resource Name of the game session.
+ **Name** – Name generated for the game session.
+ **Location** – The location that Amazon GameLift Servers hosted the game session in.
+ **Creation time** – Date and time that Amazon GameLift Servers created the stream session.
+ **Ending time** – Date and time that the game session ended.
+ **DNS name** – The host name of the game session.
+ **IP address** – IP address specified for the game session.
+ **Port ** – Port number used to connect to the game session.
+ **Creator ID** – A unique identifier of the player that initiated the game session.
+ **Player session creation policy** – Indicates if the game session is accepting new players.
+ **Game scaling protection policy** – The type of game session protection to set on all new instances that Amazon GameLift Servers starts in the fleet.

**Game data**  
Game property data, formatted as a string, to send to your game session on start.

**Game properties**  
Game property data, formatted as key/value pairs, to send to your game session on start.

**Matchmaking data**  
If the game session was created with FlexMatch, matchmaking data describes information about the matchmaking configuration and rule set. This includes each match's player attributes and team assignments. Data is in JSON format. For more information about FlexMatch matchmaking, see [Build a matchmaker](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/matchmaker-build.html).

# Look up player session data
<a name="player-sessions"></a>

If your game hosting solution uses player sessions and provides unique player IDs, you can explore player-specific activity for past or present game sessions across multiple fleets. Open the Player session lookup tool using either of the following methods: 
+ In the Amazon GameLift Servers console, open the left navigation pane and choose **Player session lookup** and select the filter type to use.
+ When viewing a fleet's game session details, choose **View player sessions**. The lookup tool opens with the game session with the game session ID filter preselected and the game session value filled in. 

When using the lookup tool, you can provide any the following information:
+ A player session ID to get information on a specific player session.
+ A game session ID to get information on all player sessions for the requested game session. The results represent all players who reserved a slot or connected to the game session. You can optionally filter results by player session status.
+ A player ID to get information on all player sessions for the requested player. The results represent all game sessions that the player participated in.

**Note**  
The lookup tool searches for all player session activity across the currently selected AWS Region. If you have multiple fleets in the Region, the results include player session activity across all fleets. For multi-location fleets, the results also include player session activity across the fleets' remote locations.

 

The following player session data is collected for each game session:
+ **Player session ID** – The identifier assigned to the player session.
+ **Player ID** – A unique identifier for the player. Choose this ID to get additional player information.
+ **Game session ID** – The identifier assigned to the game session.
+ **Fleet ID** – The identifier assigned to the fleet that hosted the game session.
+ **Status** – The status of the player session. The following are possible statuses:
  + **Reserved** – Player session has been reserved, but the players isn't connected.
  + **Active** – Player session is connected to the game server.
  + **Completed** – Player session has ended; player is no longer connected.
  + **Timed Out** – Player failed to connect.
+ **Creation time** – The time the player connected to the game session.
+ **Ending time** – The time the player disconnected from the game session.
+ **Connection data** – IP address, DNS name and port that the player used to connect to the game session.
+ **Player data** – Information about the player that was provided during player session creation. 

# Shut down a game session
<a name="terminate-sessions"></a>

Use the Amazon GameLift Servers console to shut down a specific game session. This feature gives you a simple and fast method for locating a game session and sending a signal to terminate it. Another termination method requires that you find the fleet instance where the game session is running, remotely access the instance, and manually shut down the game session. 

You can shut down a game session for any reason. The most common reason is to resolve a game session that's failing to shut down naturally. As a result, the hosting resource for the game session can't be freed to host a new game session, and the fleet's hosting capacity is degraded.

**Note**  
This feature relies on certain configuration settings for your hosting solution. It has the following limitations:   
The game session must be hosted on a fleet that's running a game server build with server SDK for Amazon GameLift Servers v5 or greater. If your game servers are deployed with an older version, you need to use remote access to delete the game session.
If the game session is hosted on an Anywhere fleet, the fleet must be using the Amazon GameLift Servers Agent to manage game server processes. 

**To terminate a game session**

1. In the [Amazon GameLift Servers console](https://console.aws.amazon.com/gamelift/), open the left navigation pane. Select a hosting solution type and open the **Fleets** page. For example:
   + **Hosting**, **Anywhere**, **Fleets**
   + **Hosting**, **Managed EC2**, **Fleets**
   + **Hosting**, **Managed containers**, **Fleets**

1. Each **Fleets** page displays the list of fleets for your currently selected AWS Region. Choose the fleet that's hosting the game session that you want to terminate. 

1. In the fleet's detail page, open the **Game sessions** tab. In the list of game sessions, select the one that you want to terminate, and choose the **Terminate** button.

1. In the **Terminate game session?** window, verify that you're shutting down the right game session and choose a termination method. 
   + Normal game session shutdown – This option sends a signal to the server process that's hosting the game session to shut down. If your game server build was properly integrated for Amazon GameLift Servers, the server process initiates its game session shutdown sequence, notifies Amazon GameLift Servers that it's ending, and stops. Depending on your game design, the shutdown sequence might include steps to gracefully complete the game session, such as saving data and notifying active players. This method might require a small delay to complete the game session shutdown sequence.
   + Immediate game session shutdown – This option sends a signal to a process manager to shut down the server process that's hosting the game session. This option bypasses the normal game session shutdown. It's able to terminate the game session even when the server process is unable to respond.

1. Confirm game session termination. You can track the shutdown progress on the **Game sessions** console page. The game session status will change to "Terminating", and then to "Terminated" when shutdown is complete.

**Related topics**
+ You can also shutdown game sessions using the AWS SDK and the AWS CLI. For more details and examples, see the Amazon GameLift Servers API Reference topic [TerminateGameSession](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_TerminateGameSession.html).
+ For more information on game server integration and how a server process responds to signals from the Amazon GameLift Servers service, see [Add Amazon GameLift Servers to your game server with the server SDK](gamelift-sdk-server-api.md).