Amazon GameLift server SDK 4.x for C++: Data types
Use the Amazon GameLift C++ server SDK reference to integrate your multiplayer game for hosting with Amazon GameLift. For guidance about the integration process, see Add Amazon GameLift to your game server.
Note
This reference is for an earlier version of the Amazon GameLift server SDK. For the latest version, see Amazon GameLift server SDK 5.x for C++: Data types.
This API is defined in GameLiftServerAPI.h
,
LogParameters.h
, and ProcessParameters.h
.
Amazon GameLift server SDK 4.x for C++: Actions
DescribePlayerSessionsRequest
This data type is used to specify which player session(s) to retrieve. You can use it as follows:
-
Provide a PlayerSessionId to request a specific player session.
-
Provide a GameSessionId to request all player sessions in the specified game session.
-
Provide a PlayerId to request all player sessions for the specified player.
For large collections of player sessions, use the pagination parameters to retrieve results in sequential blocks.
Contents
- GameSessionId
-
Unique game session identifier. Use this parameter to request all player sessions for the specified game session. Game session ID format is as follows:
arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>
. The value of <ID string> is either a custom ID string or (if one was specified when the game session was created) a generated string.Type: String
Required: No
- Limit
-
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.
Type: Integer
Required: No
- NextToken
-
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value. If a player session ID is specified, this parameter is ignored.
Type: String
Required: No
- PlayerId
-
Unique identifier for a player. Player IDs are defined by the developer. See Generate player IDs.
Type: String
Required: No
- PlayerSessionId
-
Unique identifier for a player session.
Type: String
Required: No
- PlayerSessionStatusFilter
-
Player session status to filter results on. 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 time-out limit (60 seconds).
Type: String
Required: No
-
LogParameters
This data type is used to identify which files generated during a game session that you want Amazon GameLift to upload and store once the game session ends. This information is communicated to the Amazon GameLift service in a ProcessReady() call.
Contents
- logPaths
-
Directory paths to game server log files that you want Amazon GameLift to store for future access. These files are generated during each game session. File paths and names are defined in your game server and stored in the root game build directory. The log paths must be absolute. For example, if your game build stores game session logs in a path like
MyGame\sessionlogs\
, then the log path would bec:\game\MyGame\sessionLogs
(on a Windows instance) or/local/game/MyGame/sessionLogs
(on a Linux instance).Type: std:vector<std::string>
Required: No
ProcessParameters
This data type contains the set of parameters sent to the Amazon GameLift service in a ProcessReady() call.
Contents
- port
-
Port number the server process listens on for new player connections. The value must fall into the port range configured for any fleet deploying this game server build. This port number is included in game session and player session objects, which game sessions use when connecting to a server process.
Type: Integer
Required: Yes
- logParameters
-
Object with a list of directory paths to game session log files.
Type: Aws::GameLift::Server::LogParameters
Required: No
- onStartGameSession
-
Name of callback function that the Amazon GameLift service invokes to activate a new game session. Amazon GameLift calls this function in response to the client request CreateGameSession. The callback function passes a GameSession object (defined in the Amazon GameLift Service API Reference).
Type:
const std::function<void(Aws::GameLift::Model::GameSession)> onStartGameSession
Required: Yes
- onProcessTerminate
-
Name of callback function that the Amazon GameLift service invokes to force the server process to shut down. After calling this function, Amazon GameLift waits five minutes for the server process to shut down and respond with a ProcessEnding() call. If no response is receive, it shuts down the server process.
Type:
std::function<void()> onProcessTerminate
Required: No
- onHealthCheck
-
Name of callback function that the Amazon GameLift service invokes to request a health status report from the server process. Amazon GameLift calls this function every 60 seconds. After calling this function Amazon GameLift waits 60 seconds for a response, and if none is received. records the server process as unhealthy.
Type:
std::function<bool()> onHealthCheck
Required: No
- onUpdateGameSession
-
Name of callback function that the Amazon GameLift service invokes to pass an updated game session object to the server process. Amazon GameLift calls this function when a match backfill request has been processed in order to provide updated matchmaker data. It passes a GameSession object, a status update (
updateReason
), and the match backfill ticket ID.Type:
std::function<void(Aws::GameLift::Server::Model::UpdateGameSession)> onUpdateGameSession
Required: No
StartMatchBackfillRequest
This data type is used to send a matchmaking backfill request. The information is communicated to the Amazon GameLift service in a StartMatchBackfill() call.
Contents
- GameSessionArn
-
Unique game session identifier. The API action GetGameSessionId() returns the identifier in ARN format.
Type: String
Required: Yes
- MatchmakingConfigurationArn
-
Unique identifier, in the form of an ARN, for the matchmaker to use for this request. To find the matchmaker that was used to create the original game session, look in the game session object, in the matchmaker data property. Learn more about matchmaker data in Word with matchmaker data.
Type: String
Required: Yes
- Players
-
A set of data representing all players who are currently in the game session. The matchmaker uses this information to search for new players who are good matches for the current players. See the Amazon GameLift API Reference Guide for a description of the Player object format. To find player attributes, IDs, and team assignments, look in the game session object, in the matchmaker data property. If latency is used by the matchmaker, gather updated latency for the current region and include it in each player's data.
Type: std:vector<player>
Required: Yes
- TicketId
-
Unique identifier for a matchmaking or match backfill request ticket. If no value is provided here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status or cancel the request if needed.
Type: String
Required: No
StopMatchBackfillRequest
This data type is used to cancel a matchmaking backfill request. The information is communicated to the Amazon GameLift service in a StopMatchBackfill() call.
Contents
- GameSessionArn
-
Unique game session identifier associated with the request being canceled.
Type: String
Required: Yes
- MatchmakingConfigurationArn
-
Unique identifier of the matchmaker this request was sent to.
Type: String
Required: Yes
- TicketId
-
Unique identifier of the backfill request ticket to be canceled.
Type: String
Required: Yes