

# C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Actions
C\$1\$1 (Unreal) server SDK: Actions

Use the Amazon GameLift Servers Unreal server SDK 5.x reference to help you prepare your multiplayer game for use with Amazon GameLift Servers. For details about the integration process, see [Add Amazon GameLift Servers to your game server with the server SDK](gamelift-sdk-server-api.md). If you're using the Amazon GameLift Servers plugin for Unreal, see also [Amazon GameLift Servers plugin for Unreal Engine](unreal-plugin.md).

**Note**  
This topic describes the Amazon GameLift Servers C\$1\$1 API that you can use when you build for the Unreal Engine. Specifically, this documentation applies to code that you compile with the `-DBUILD_FOR_UNREAL=1` option. 

# C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Data types
Data types

Use the Amazon GameLift Servers Unreal server SDK 5.x reference to help you prepare your multiplayer game for use with Amazon GameLift Servers. For details about the integration process, see [Add Amazon GameLift Servers to your game server with the server SDK](gamelift-sdk-server-api.md). If you're using the Amazon GameLift Servers plugin for Unreal, see also [Amazon GameLift Servers plugin for Unreal Engine](unreal-plugin.md).

**Note**  
This topic describes the Amazon GameLift Servers C\$1\$1 API that you can use when you build for the Unreal Engine. Specifically, this documentation applies to code that you compile with the `-DBUILD_FOR_UNREAL=1` option. 

[C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Actions](integration-server-sdk5-unreal-actions.md)

**Topics**
+ [

## FProcessParameters
](#integration-server-sdk5-unreal-dataypes-process)
+ [

## UpdateGameSession
](#integration-server-sdk5-unreal-dataypes-updategamesession)
+ [

## GameSession
](#integration-server-sdk5-unreal-dataypes-gamesession)
+ [

## FServerParameters
](#integration-server-sdk5-unreal-dataypes-serverparameters)
+ [

## FStartMatchBackfillRequest
](#integration-server-sdk5-unreal-dataypes-startmatchbackfillrequest)
+ [

## FPlayer
](#integration-server-sdk5-unreal-dataypes-player)
+ [

## FGameLiftDescribePlayerSessionsRequest
](#integration-server-sdk5-unreal-dataypes-playersessions)
+ [

## FStopMatchBackfillRequest
](#integration-server-sdk5-unreal-dataypes-stopmatchbackfillrequest)
+ [

## FAttributeValue
](#integration-server-sdk5-unreal-dataypes-attributevalue)
+ [

## FGameLiftGetFleetRoleCredentialsRequest
](#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsrequest)
+ [

## FGameLiftLongOutcome
](#integration-server-sdk5-unreal-dataypes-awslongoutcome)
+ [

## FGameLiftStringOutcome
](#integration-server-sdk5-unreal-dataypes-awsstringoutcome)
+ [

## FGameLiftDescribePlayerSessionsOutcome
](#integration-server-sdk5-unreal-dataypes-describeplayersessionsoutcome)
+ [

## FGameLiftDescribePlayerSessionsResult
](#integration-server-sdk5-unreal-dataypes-describeplayersessionresult)
+ [

## FGenericOutcome
](#integration-server-sdk5-unreal-dataypes-genericoutcome)
+ [

## FGameLiftPlayerSession
](#integration-server-sdk5-unreal-dataypes-playersession)
+ [

## FGameLiftGetComputeCertificateOutcome
](#integration-server-sdk5-unreal-dataypes-getcomputecertificateoutcome)
+ [

## FGameLiftGetComputeCertificateResult
](#integration-server-sdk5-unreal-dataypes-getcomputecertificateresult)
+ [

## FGameLiftGetFleetRoleCredentialsOutcome
](#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsoutcome)
+ [

## FGetFleetRoleCredentialsResult
](#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsresult)
+ [

## FGameLiftError
](#integration-server-sdk5-unreal-dataypes-gamelifterror)
+ [

## Enums
](#integration-server-sdk5-unreal-dataypes-enums)

## FProcessParameters


This data type contains the set of parameters sent to Amazon GameLift Servers in a [ProcessReady()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-processready).


|  |  | 
| --- |--- |
|  **Properties**  | Description | 
| LogParameters | An object with directory paths to files that are generated during a game session. Amazon GameLift Servers copies and stores the files for future access.**Type:** `TArray<FString>`**Required:** No | 
| OnHealthCheck | The callback function that Amazon GameLift Servers invokes to request a health status report from the server process. Amazon GameLift Servers calls this function every 60 seconds and waits 60 seconds for a response. The server process returns TRUE if healthy, FALSE if not healthy. If no response is returned, Amazon GameLift Servers records the server process as not healthy. This property is a delegate function defined as `DECLARE_DELEGATE_RetVal(bool, FOnHealthCheck)`;   **Type:** `FOnHealthCheck`**Required:** No | 
| OnProcessTerminate | The callback function that Amazon GameLift Servers invokes to force the server process to shut down. After calling this function, Amazon GameLift Servers waits 5 minutes for the server process to shut down and respond with a [ProcessEnding()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-processending) call before it shuts down the server process.**Type:** `FSimpleDelegate`**Required:** Yes | 
| OnStartGameSession | The callback function that Amazon GameLift Servers invokes to activate a new game session. Amazon GameLift Servers calls this function in response to a client request [CreateGameSession](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_CreateGameSession.html). The callback function passes a [GameSession](#integration-server-sdk5-unreal-dataypes-gamesession) object. This property is a delegate function defined as `DECLARE_DELEGATE_OneParam(FOnStartGameSession, Aws::GameLift::Server::Model::GameSession);`  **Type:** `FOnStartGameSession`**Required:** Yes | 
| OnUpdateGameSession | The callback function that Amazon GameLift Servers invokes to pass an updated game session object to the server process. Amazon GameLift Servers calls this function when a match backfill request has been processed to provide updated matchmaker data. It passes a [GameSession](#integration-server-sdk5-unreal-dataypes-gamesession) object, a status update (updateReason), and the match backfill ticket ID. This property is a delegate function defined as `DECLARE_DELEGATE_OneParam(FOnUpdateGameSession, Aws::GameLift::Server::Model::UpdateGameSession);` **Type:** `FOnUpdateGameSession`**Required:** No | 
| Port | The 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:** `int`**Required:** Yes | 

## UpdateGameSession


This data type updates to a game session object, which includes the reason that the game session was updated and the related backfill ticket ID if backfill is used to fill player sessions in the game session.


| Properties | **Description** | 
| --- | --- | 
| GameSession | A [GameSession](#integration-server-sdk5-unreal-dataypes-gamesession) object. The GameSession object contains properties describing a game session. **Type:** `Aws::GameLift::Server::GameSession`**Required:** No | 
| UpdateReason | The reason that the game session is being updated. **Type:** `enum class UpdateReason`  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/integration-server-sdk5-unreal-datatypes.html) **Required:** No   | 
| BackfillTicketId | The ID of the backfill ticket attempting to update the game session.**Type:** `char[]`**Required:** No | 

## GameSession


This data type provides details of a game session. 


| Properties | **Description** | 
| --- | --- | 
| GameSessionId |  A unique identifier for the game session. A game session ARN has the following format: `arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>`. **Type:** `char[]` **Required**: No  | 
| Name |  A descriptive label of the game session.  **Type:** `char[]` **Required**: No  | 
| FleetId |  A unique identifier for the fleet that the game session is running on. **Type:** `char[]` **Required**: No  | 
| MaximumPlayerSessionCount |  The maximum number of player connections to the game session. **Type:** `int` **Required**: No  | 
| Port |  The port number for the game session. To connect to an Amazon GameLift Servers game server, an app needs both the IP address and port number. **Type:** `int` **Required**: No  | 
| IpAddress |  The IP address of the game session. To connect to an Amazon GameLift Servers game server, an app needs both the IP address and port number. **Type:** `char[]` **Required**: No  | 
| GameSessionData |  A set of custom game session properties, formatted as a single string value.  **Type:** `char[]` **Required**: No  | 
| MatchmakerData |  Information about the matchmaking process that was used to create the game session, in JSON syntax, formatted as a string. In addition to the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. **Type:** `char[]` **Required**: No  | 
| GameProperties |  A set of custom properties for a game session, formatted as key:value pairs. These properties are passed with a request to start a new game session. **Type:** `GameProperty[]` **Required**: No  | 
| DnsName |  The DNS identifier assigned to the instance that's running the game session. Values have the following format: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/integration-server-sdk5-unreal-datatypes.html) When connecting to a game session that's running on a TLS-enabled fleet, you must use the DNS name, not the IP address. **Type:** `char[]` **Required**: No  | 

## FServerParameters


Information used to maintain the connection between an Amazon GameLift Servers Anywhere server and the Amazon GameLift Servers service. This information is used when launching new server processes with [InitSDK()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-initsdk). For servers hosted on Amazon GameLift Servers managed EC2 instances, use an empty object.


| Properties | **Description** | 
| --- | --- | 
| webSocketUrl |  The `GameLiftServerSdkEndpoint` Amazon GameLift Servers returns when you [https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html) for a Amazon GameLift Servers Anywhere compute resource. **Type:** `char[]` **Required**: Yes   | 
| processId |  A unique identifier registered to the server process hosting your game. **Type:** `char[]` **Required**: Yes  | 
| hostId | The HostID is the ComputeName used when you registered your compute. For more information see, [RegisterCompute](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html).**Type:** `char[]`**Required**: Yes | 
| fleetId | The unique identifier of the fleet that the compute is registered to. For more information see, [RegisterCompute](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html).**Type:** `char[]`**Required**: Yes | 
| authToken | The authentication token generated by Amazon GameLift Servers that authenticates your server to Amazon GameLift Servers. For more information see, [GetComputeAuthToken](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_GetComputeAuthToken.html).**Type:** `char[]`**Required**: Yes | 

## FStartMatchBackfillRequest


Information used to create a matchmaking backfill request. The game server communicates this information to Amazon GameLift Servers in a [StartMatchBackfill()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-startmatchbackfill) call.


| Properties | **Description** | 
| --- | --- | 
| GameSessionArn |  A unique game session identifier. The API operation `[GetGameSessionId](https://docs.aws.amazon.com/gameliftservers/latest/developerguide/integration-server-sdk5-unreal-actions.html#integration-server-sdk5-unreal-getgamesessionid)` returns the identifier in ARN format. **Type:** `char[]` **Required**: Yes  | 
| MatchmakingConfigurationArn |  A unique identifier, in the form of an ARN, for the matchmaker to use for this request. The matchmaker ARN for the original game session is in the game session object in the matchmaker data property. Learn more about matchmaker data in [Work with matchmaker data](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-server.html#match-server-data.html). **Type:** `char[]` **Required**: Yes  | 
| Players |  A set of data representing all players who are in the game session. The matchmaker uses this information to search for new players who are good matches for the current players. **Type:** `TArray<FPlayer>` **Required**: Yes  | 
| TicketId |  A unique identifier for a matchmaking or match backfill request ticket. If you don't provide a value, Amazon GameLift Servers generates one. Use this identifier to track the match backfill ticket status or cancel the request if needed.  **Type:** `char[]` **Required**: No  | 

## FPlayer


This data type represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and possibly latency data. Amazon GameLift Servers adds team information after a match is made.


| Properties | **Description** | 
| --- | --- | 
| LatencyInMS |  A set of values expressed in milliseconds that indicate the amount of latency that a player experiences when connected to a location.  If this property is used, the player is only matched for locations listed. If a matchmaker has a rule that evaluates player latency, players must report latency to be matched. **Type:** `TMap>FString, int32<` **Required**: No  | 
| PlayerAttributes |  A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the PlayerAttributes used in a matchmaking rule set. For more information about player attributes, see [AttributeValue](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_AttributeValue.html). **Type:** `TMap>FString, FAttributeValue<` **Required**: No  | 
| PlayerId |  A unique identifier for a player. **Type:** `std::string` **Required**: No  | 
| Team |  The name of the team that the player is assigned to in a match. You define team name in the matchmaking rule set. **Type:** `FString` **Required**: No  | 

## FGameLiftDescribePlayerSessionsRequest


An object that specifies which player sessions to retrieve. The server process provides this information with a [DescribePlayerSessions()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-describeplayersessions) call to Amazon GameLift Servers.


| Properties | **Description** | 
| --- | --- | 
| GameSessionId |  A unique game session identifier. Use this parameter to request all player sessions for the specified game session.  Game session ID format is `FString`. The `GameSessionID` is a custom ID string or a **Type:** `std::string` **Required**: No  | 
| PlayerSessionId |  The unique identifier for a player session. Use this parameter to request a single specific player session. **Type:** `FString` **Required**: No  | 
| PlayerId |  The unique identifier for a player. Use this parameter to request all player sessions for a specific player. See [Generate player IDs](player-sessions-player-identifiers.md). **Type:** `FString` **Required**: No  | 
| PlayerSessionStatusFilter |  The player session status to filter results on. Possible player session statuses include: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/integration-server-sdk5-unreal-datatypes.html) **Type:** `FString` **Required**: No  | 
| NextToken |  The token indicating the start of the next page of results. To specify the start of the result set, don't provide a value. If you provide a player session ID, this parameter is ignored. **Type:** `FString` **Required**: No  | 
| Limit |  The maximum number of results to return. If you provide a player session ID, this parameter is ignored. **Type:** `int` **Required**: No  | 

## FStopMatchBackfillRequest


Information used to cancel a matchmaking backfill request. The game server communicates this information to Amazon GameLift Servers service in a [StopMatchBackfill()](integration-server-sdk5-unreal-actions.md#integration-server-sdk5-unreal-stopmatchbackfill) call.


| Properties | **Description** | 
| --- | --- | 
| GameSessionArn |  A unique game session identifier of the request being canceled. **Type:** `FString` **Required**: Yes  | 
| MatchmakingConfigurationArn |  A unique identifier of the matchmaker this request was sent to. **Type:** `FString` **Required**: Yes  | 
| TicketId |  A unique identifier of the backfill request ticket to be canceled. **Type:** `FString` **Required**: Yes  | 

## FAttributeValue


Use these values in [FPlayer](#integration-server-sdk5-unreal-dataypes-player) attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each `AttributeValue` object can use only one of the available properties.


| Properties | Description | 
| --- | --- | 
| attrType |  Specifies the type of attribute value. **Type:** An `FAttributeType` [enum](#integration-server-sdk5-unreal-dataypes-enums) value.  **Required:** No  | 
| S |  Represents a string attribute value. **Type:** `FString` **Required:** No  | 
| N |  Represents a numeric attribute value. **Type:** `double` **Required:** No  | 
| SL |  Represents an array of string attribute values. **Type:** `TArray<FString>` **Required:** No  | 
| SDM |  Represents a dictionary of string keys and double values. **Type:** `TMap<FString, double>` **Required:** No  | 

## FGameLiftGetFleetRoleCredentialsRequest


This data type provides role credentials that extend limited access to your AWS resources to the game server. For more information see, [Set up an IAM service role for Amazon GameLift Servers](setting-up-role.md).


| Properties | **Description** | 
| --- | --- | 
| RoleArn | The Amazon Resource Name (ARN) of the service role that extends limited access to your AWS resources.**Type:** `FString`**Required**: No | 
| RoleSessionName | The name of the session describing the use of the role credentials.**Type:** `FString`**Required**: No | 

## FGameLiftLongOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Result |  The result of the action. **Type:** `long` **Required:** No  | 
| ResultWithOwnership |   The result of the action, cast as an rvalue, so that the calling code can take ownership of the object.  **Type:** `long&&` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGameLiftStringOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Result |  The result of the action. **Type:** `FString` **Required:** No  | 
| ResultWithOwnership |   The result of the action, cast as an rvalue, so that the calling code can take ownership of the object.  **Type:** `FString&&` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGameLiftDescribePlayerSessionsOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Result |  The result of the action. **Type:** [FGameLiftDescribePlayerSessionsResult](#integration-server-sdk5-unreal-dataypes-describeplayersessionresult) **Required:** No   | 
| ResultWithOwnership |   The result of the action, cast as an rvalue, so that the calling code can take ownership of the object.  **Type:** `FGameLiftDescribePlayerSessionsResult&&` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGameLiftDescribePlayerSessionsResult



| Properties | Description | 
| --- | --- | 
| PlayerSessions |   **Type:** `TArray<FGameLiftPlayerSession>` **Required:** Yes  | 
| NextToken |  The token indicating the start of the next page of results. To specify the start of the result set, don't provide a value. If you provide a player session ID, this parameter is ignored. **Type:** `FString` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGenericOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGameLiftPlayerSession



| Properties | Description | 
| --- | --- | 
| CreationTime |  **Type:** `long` **Required:** Yes  | 
| FleetId |  **Type:** `FString` **Required:** Yes  | 
| GameSessionId |  **Type:** `FString` **Required:** Yes  | 
| IpAddress |  **Type:** `FString` **Required:** Yes  | 
| PlayerData |  **Type:** `FString` **Required:** Yes  | 
| PlayerId |  **Type:** `FString` **Required:** Yes  | 
| PlayerSessionId |  **Type:** `FString` **Required:** Yes  | 
| Port |  **Type:** `int` **Required:** Yes  | 
| Status |  **Type:** A `PlayerSessionStatus` [enum](integration-server-sdk5-cpp-datatypes.md#integration-server-sdk5-cpp-dataypes-enums). **Required:** Yes  | 
| TerminationTime |  **Type:** `long` **Required:** Yes  | 
| DnsName |  **Type:** `FString` **Required:** Yes  | 

## FGameLiftGetComputeCertificateOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Result |  The result of the action. **Type:** [FGameLiftGetComputeCertificateResult](#integration-server-sdk5-unreal-dataypes-getcomputecertificateresult) **Required:** No   | 
| ResultWithOwnership |   The result of the action, cast as an rvalue, so that the calling code can take ownership of the object.  **Type:** `FGameLiftGetComputeCertificateResult&&` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGameLiftGetComputeCertificateResult


The path to the TLS certificate on your compute and the compute's host name.


| Properties | Description | 
| --- | --- | 
| CertificatePath |  **Type:** `FString` **Required:** Yes  | 
| ComputeName |  **Type:** `FString` **Required:** Yes  | 

## FGameLiftGetFleetRoleCredentialsOutcome


This data type results from an action and produces an object with the following properties:


| Properties | Description | 
| --- | --- | 
| Result |  The result of the action. **Type:** [FGetFleetRoleCredentialsResult](#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsresult) **Required:** No   | 
| ResultWithOwnership |   The result of the action, cast as an rvalue, so that the calling code can take ownership of the object.  **Type:** `FGameLiftGetFleetRoleCredentialsResult&&` **Required**: No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [FGameLiftError](#integration-server-sdk5-unreal-dataypes-gamelifterror) **Required:** No  | 

## FGetFleetRoleCredentialsResult



| Properties | Description | 
| --- | --- | 
| AccessKeyId |  The access key ID to authenticate and provide access to your AWS resources. **Type:** `FString` **Required:** No  | 
| AssumedRoleId |  The ID of the user that the service role belongs to. **Type:** `FString` **Required:** No  | 
| AssumedRoleUserArn |  The Amazon Resource Name (ARN) of the user that the service role belongs to. **Type:** `FString` **Required:** No  | 
| Expiration |  The amount of time until your session credentials expire. **Type:** `FDateTime` **Required:** No  | 
| SecretAccessKey |  The secret access key ID for authentication. **Type:** `FString` **Required:** No  | 
| SessionToken |  A token to identify the current active session interacting with your AWS resources. **Type:** `FString` **Required:** No  | 
| Success |  Whether the action was successful or not. **Type:** `bool` **Required**: Yes  | 
| Error |  The error that occurred if the action was unsuccessful. **Type:** [GameLiftError](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-gamelifterror) **Required:** No  | 

## FGameLiftError



| Properties | Description | 
| --- | --- | 
| ErrorType |  The type of error. **Type:** A `GameLiftErrorType` [enum](integration-server-sdk5-cpp-datatypes.md#integration-server-sdk5-cpp-dataypes-enums). **Required:** No   | 
| ErrorName |  The name of the error.  **Type:** `std::string`  **Required:** No   | 
| ErrorMessage |  The error message.  **Type:** `std::string`  **Required:** No   | 

## Enums


Enums defined for the server SDK for Amazon GameLift Servers (Unreal) are defined as follows:

**FAttributeType**  
+ **NONE**
+ **STRING**
+ **DOUBLE**
+ **STRING\$1LIST**
+ **STRING\$1DOUBLE\$1MAP**

**GameLiftErrorType**  
String value indicating the error type. Valid values include:  
+ **SERVICE\$1CALL\$1FAILED** – A call to an AWS service has failed. 
+ **LOCAL\$1CONNECTION\$1FAILED** – The local connection to Amazon GameLift Servers failed. 
+ **NETWORK\$1NOT\$1INITIALIZED** – The network has not been initialized. 
+ **GAMESESSION\$1ID\$1NOT\$1SET** – The game session ID has not been set. 
+ **BAD\$1REQUEST\$1EXCEPTION** 
+ **INTERNAL\$1SERVICE\$1EXCEPTION** 
+ **ALREADY\$1INITIALIZED** – The Amazon GameLift Servers Server or Client has already been initialized with Initialize(). 
+ **FLEET\$1MISMATCH** – The target fleet does not match the fleet of a gameSession or playerSession. 
+ **GAMELIFT\$1CLIENT\$1NOT\$1INITIALIZED** – The Amazon GameLift Servers client has not been initialized. 
+ **GAMELIFT\$1SERVER\$1NOT\$1INITIALIZED** – The Amazon GameLift Servers server has not been initialized. 
+ **GAME\$1SESSION\$1ENDED\$1FAILED** – the server SDK for Amazon GameLift Servers could not contact the service to report the game session ended. 
+ **GAME\$1SESSION\$1NOT\$1READY** – The Amazon GameLift Servers Server Game Session was not activated. 
+ **GAME\$1SESSION\$1READY\$1FAILED** – the server SDK for Amazon GameLift Servers could not contact the service to report the game session is ready. 
+ **INITIALIZATION\$1MISMATCH** – A client method was called after Server::Initialize(), or vice versa. 
+ **NOT\$1INITIALIZED** – The Amazon GameLift Servers Server or Client has not been initialized with Initialize(). 
+ **NO\$1TARGET\$1ALIASID\$1SET** – A target aliasId has not been set. 
+ **NO\$1TARGET\$1FLEET\$1SET** – A target fleet has not been set. 
+ **PROCESS\$1ENDING\$1FAILED** – the server SDK for Amazon GameLift Servers could not contact the service to report the process is ending. 
+ **PROCESS\$1NOT\$1ACTIVE** – The server process is not yet active, not bound to a GameSession, and cannot accept or process PlayerSessions. 
+ **PROCESS\$1NOT\$1READY** – The server process is not yet ready to be activated. 
+ **PROCESS\$1READY\$1FAILED** – the server SDK for Amazon GameLift Servers could not contact the service to report the process is ready. 
+ **SDK\$1VERSION\$1DETECTION\$1FAILED** – SDK version detection failed. 
+ **STX\$1CALL\$1FAILED** – A call to the XStx server backend component has failed. 
+ **STX\$1INITIALIZATION\$1FAILED** – The XStx server backend component has failed to initialize. 
+ **UNEXPECTED\$1PLAYER\$1SESSION** – An unregistered player session was encountered by the server. 
+ **WEBSOCKET\$1CONNECT\$1FAILURE** 
+ **WEBSOCKET\$1CONNECT\$1FAILURE\$1FORBIDDEN** 
+ **WEBSOCKET\$1CONNECT\$1FAILURE\$1INVALID\$1URL** 
+ **WEBSOCKET\$1CONNECT\$1FAILURE\$1TIMEOUT** 
+ **WEBSOCKET\$1RETRIABLE\$1SEND\$1MESSAGE\$1FAILURE** – Retriable failure to send a message to the GameLift Service WebSocket. 
+ **WEBSOCKET\$1SEND\$1MESSAGE\$1FAILURE** – Failure to send a message to the GameLift Service WebSocket. 
+ **MATCH\$1BACKFILL\$1REQUEST\$1VALIDATION** – Validation of the request failed. 
+ **PLAYER\$1SESSION\$1REQUEST\$1VALIDATION** – Validation of the request failed. 

**EPlayerSessionCreationPolicy**  
String value indicating whether the game session accepts new players. Valid values include:   
+ **ACCEPT\$1ALL** – Accept all new player sessions. 
+ **DENY\$1ALL** – Deny all new player sessions. 
+ **NOT\$1SET** – The game session is not set to accept or deny new player sessions. 

**EPlayerSessionStatus**  
+ **ACTIVE**
+ **COMPLETED**
+ **NOT\$1SET**
+ **RESERVED**
+ **TIMEDOUT**

[C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Data types](integration-server-sdk5-unreal-datatypes.md)

**Topics**
+ [

# C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Data types
](integration-server-sdk5-unreal-datatypes.md)
+ [

## GetSdkVersion()
](#integration-server-sdk5-unreal-getsdkversion)
+ [

## InitSDK()
](#integration-server-sdk5-unreal-initsdk)
+ [

## InitSDK()
](#integration-server-sdk5-unreal-initsdk-anywhere)
+ [

## ProcessReady()
](#integration-server-sdk5-unreal-processready)
+ [

## ProcessEnding()
](#integration-server-sdk5-unreal-processending)
+ [

## ActivateGameSession()
](#integration-server-sdk5-unreal-activategamesession)
+ [

## UpdatePlayerSessionCreationPolicy()
](#integration-server-sdk5-unreal-updateplayersessioncreationpolicy)
+ [

## GetGameSessionId()
](#integration-server-sdk5-unreal-getgamesessionid)
+ [

## GetTerminationTime()
](#integration-server-sdk5-unreal-getterm)
+ [

## AcceptPlayerSession()
](#integration-server-sdk5-unreal-acceptplayersession)
+ [

## RemovePlayerSession()
](#integration-server-sdk5-unreal-removeplayersession)
+ [

## DescribePlayerSessions()
](#integration-server-sdk5-unreal-describeplayersessions)
+ [

## StartMatchBackfill()
](#integration-server-sdk5-unreal-startmatchbackfill)
+ [

## StopMatchBackfill()
](#integration-server-sdk5-unreal-stopmatchbackfill)
+ [

## GetComputeCertificate()
](#integration-server-sdk5-unreal-getcomputecertificate)
+ [

## GetFleetRoleCredentials()
](#integration-server-sdk5-unreal-getfleetrolecredentials)
+ [

## Destroy()
](#integration-server-sdk5-unreal-ref-destroy)

## GetSdkVersion()


Returns the current version number of the SDK built into the server process.

### Syntax


```
FGameLiftStringOutcome GetSdkVersion();
```

### Return value


If successful, returns the current SDK version as an [FGameLiftStringOutcome](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-awsstringoutcome) object. The returned object includes the version number (example `5.0.0`). If not successful, returns an error message.

### Example


```
Aws::GameLift::AwsStringOutcome SdkVersionOutcome = Aws::GameLift::Server::GetSdkVersion();  
```

## InitSDK()


Initializes the Amazon GameLift Servers SDK for a managed EC2 fleet. Call this method on launch, before any other initialization related to Amazon GameLift Servers occurs. This method reads server parameters from the host environment to set up communication between the server and the Amazon GameLift Servers service. It uses an idempotency token, so you safely retry this call when it fails.

### Syntax


```
FGameLiftGenericOutcome InitSDK()
```

### Return value


If successful, returns an `InitSdkOutcome` object indicating that the server process is ready to call [ProcessReady()](#integration-server-sdk5-unreal-processready). 

### Example


```
//Call InitSDK to establish a local connection with the Amazon GameLift Servers Agent to enable further communication.
FGameLiftGenericOutcome initSdkOutcome = GameLiftSdkModule->InitSDK();
```

## InitSDK()


Initializes the Amazon GameLift Servers SDK for an Anywhere fleet or managed container fleet. Call this method on launch, before any other initialization related to Amazon GameLift Servers occurs. This method requires explicit server parameters to set up communication between the server and the Amazon GameLift Servers service. It uses an idempotency token, so you safely retry this call when it fails.

### Syntax


```
FGameLiftGenericOutcome InitSDK(serverParameters)
```

### Parameters


[FServerParameters](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-serverparameters)  
To initialize a game server on an Amazon GameLift Servers Anywhere fleet, construct a `ServerParameters` object with the following information:  
+ The URL of the WebSocket used to connect to your game server. 
+ The ID of the process used to host your game server. 
+ The ID of the compute hosting your game server processes. 
+ The ID of the Amazon GameLift Servers fleet containing your Amazon GameLift Servers Anywhere compute.
+ The authorization token generated by the Amazon GameLift Servers operation. 

### Return value


If successful, returns an `InitSdkOutcome` object indicating that the server process is ready to call [ProcessReady()](#integration-server-sdk5-unreal-processready). 

**Note**  
If calls to `InitSDK()` are failing for game builds deployed to Anywhere fleets, check the `ServerSdkVersion` parameter used when creating the build resource. You must explicitly set this value to the server SDK version in use. The default value for this parameter is 4.x, which is not compatible. To resolve this issue, create a new build and deploy it to a new fleet.

### Example


```
//Define the server parameters
FServerParameters serverParameters;
parameters.m_authToken = "1111aaaa-22bb-33cc-44dd-5555eeee66ff"; 
parameters.m_fleetId = "arn:aws:gamelift:us-west-1:111122223333:fleet/fleet-9999ffff-88ee-77dd-66cc-5555bbbb44aa";
parameters.m_hostId = "HardwareAnywhere"; 
parameters.m_processId = "PID1234";
parameters.m_webSocketUrl = "wss://us-west-1.api.amazongamelift.com"; 

//Call InitSDK to establish a local connection with the Amazon GameLift Servers Agent to enable further communication.
FGameLiftGenericOutcome initSdkOutcome = GameLiftSdkModule->InitSDK(serverParameters);
```

## ProcessReady()


Notifies Amazon GameLift Servers that the server process is ready to host game sessions. Call this method after invoking [InitSDK()](#integration-server-sdk5-unreal-initsdk). This method should be called only once per process.

### Syntax


`GenericOutcome ProcessReady(const Aws::GameLift::Server::ProcessParameters &processParameters);`

### Parameters


**processParameters**  
An [FProcessParameters](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-process) object communicating the following information about the server process:  
+ Names of callback methods implemented in the game server code that the Amazon GameLift Servers service invokes to communicate with the server process.
+ Port number that the server process is listening on.
+ Path to any game session-specific files that you want Amazon GameLift Servers to capture and store.

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


This example illustrates both the [ProcessReady()](#integration-server-sdk5-unreal-processready) call and delegate function implementations.

```
//Calling ProcessReady tells Amazon GameLift Servers this game server is ready to receive incoming game sessions!
UE_LOG(GameServerLog, Log, TEXT("Calling Process Ready"));
FGameLiftGenericOutcome processReadyOutcome = GameLiftSdkModule->ProcessReady(*params);
```

## ProcessEnding()


Notifies Amazon GameLift Servers that the server process is terminating. Call this method after all other cleanup tasks (including shutting down the active game session) and before terminating the process. Depending on the result of `ProcessEnding()`, the process exits with success (0) or error (-1) and generates a fleet event. If the process terminates with an error, the fleet event generated is `SERVER_PROCESS_TERMINATED_UNHEALTHY`).

### Syntax


```
FGameLiftGenericOutcome ProcessEnding()
```

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


```
//OnProcessTerminate callback. Amazon GameLift Servers will invoke this callback before shutting down an instance hosting this game server.
//It gives this game server a chance to save its state, communicate with services, etc., before being shut down.
//In this case, we simply tell Amazon GameLift Servers we are indeed going to shutdown.
params->OnTerminate.BindLambda([=]() {
  UE_LOG(GameServerLog, Log, TEXT("Game Server Process is terminating"));
  GameLiftSdkModule->ProcessEnding();
});
```

## ActivateGameSession()


Notifies Amazon GameLift Servers that the server process has activated a game session and is now ready to receive player connections. This action should be called as part of the `onStartGameSession()` callback function, after all game session initialization.

### Syntax


```
FGameLiftGenericOutcome ActivateGameSession()
```

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


This example shows `ActivateGameSession()` called as part of the `onStartGameSession()` delegate function. 

```
//When a game session is created, Amazon GameLift Servers sends an activation request to the game server and passes along the game session object containing game properties and other settings.
//Here is where a game server should take action based on the game session object.
//Once the game server is ready to receive incoming player connections, it should invoke GameLiftServerAPI.ActivateGameSession()
auto onGameSession = [=](Aws::GameLift::Server::Model::GameSession gameSession)
{
  FString gameSessionId = FString(gameSession.GetGameSessionId());
  UE_LOG(GameServerLog, Log, TEXT("GameSession Initializing: %s"), *gameSessionId);
  GameLiftSdkModule->ActivateGameSession();
};
```

## UpdatePlayerSessionCreationPolicy()


Updates the current game session's ability to accept new player sessions. A game session can be set to either accept or deny all new player sessions.

### Syntax


```
FGameLiftGenericOutcome UpdatePlayerSessionCreationPolicy(EPlayerSessionCreationPolicy policy)
```

### Parameters


**playerCreationSessionPolicy**  
String value indicating whether the game session accepts new players.   
Valid values include:  
+ **ACCEPT\$1ALL** – Accept all new player sessions.
+ **DENY\$1ALL** – Deny all new player sessions.

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


This example sets the current game session's join policy to accept all players.

```
FGameLiftGenericOutcome outcome = GameLiftSdkModule->UpdatePlayerSessionCreationPolicy(Aws::GameLift::Model::EPlayerSessionCreationPolicy::ACCEPT_ALL);
```

## GetGameSessionId()


Retrieves the ID of the game session hosted by the active server process. 

For idle processes that aren't activated with a game session, the call returns a [FGameLiftError](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-gamelifterror).

### Syntax


```
FGameLiftStringOutcome GetGameSessionId()
```

### Parameters


This action has no parameters.

### Return value


If successful, returns the game session ID as an [FGameLiftStringOutcome](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-awsstringoutcome) object. If not successful, returns an error message."

For idle processes that aren't activated with a game session, the call returns `Success`=`True` and `GameSessionId`=`""`.

### Example


```
//When a game session is created, Amazon GameLift Servers sends an activation request to the game server and passes along the game session object containing game properties and other settings.
//Here is where a game server should take action based on the game session object.
//Once the game server is ready to receive incoming player connections, it should invoke GameLiftServerAPI.ActivateGameSession()
auto onGameSession = [=](Aws::GameLift::Server::Model::GameSession gameSession)
{
  FString gameSessionId = FString(gameSession.GetGameSessionId());
  UE_LOG(GameServerLog, Log, TEXT("GameSession Initializing: %s"), *gameSessionId);
  GameLiftSdkModule->ActivateGameSession();
};
```

## GetTerminationTime()


Returns the time that a server process is scheduled to be shut down, if a termination time is available. A server process takes action after receiving an `onProcessTerminate()` callback from Amazon GameLift Servers. Amazon GameLift Servers calls `onProcessTerminate()` for the following reasons: 
+ When the server process has reported poor health or has not responded to Amazon GameLift Servers.
+ When terminating the instance during a scale-down event.
+ When an instance is terminated due to a [spot-instance interruption](spot-tasks.md).

### Syntax


```
AwsDateTimeOutcome GetTerminationTime()
```

### Return value


If successful, returns the termination time as an `AwsDateTimeOutcome` object. The value is the termination time, expressed in elapsed ticks since `0001 00:00:00`. For example, the date time value `2020-09-13 12:26:40 -000Z` is equal to `637355968000000000` ticks. If no termination time is available, returns an error message.

If the process hasn't received a` ProcessParameters.OnProcessTerminate()` callback, an error message is returned. For more information about shutting down a server process, see [Respond to a server process shutdown notification](gamelift-sdk-server-api.md#gamelift-sdk-server-terminate).

### Example


```
AwsDateTimeOutcome TermTimeOutcome = GameLiftSdkModule->GetTerminationTime();
```

## AcceptPlayerSession()


Notifies Amazon GameLift Servers that a player with the specified player session ID has connected to the server process and needs validation. Amazon GameLift Servers verifies that the player session ID is valid. After the player session is validated, Amazon GameLift Servers changes the status of the player slot from RESERVED to ACTIVE. 

### Syntax


```
FGameLiftGenericOutcome AcceptPlayerSession(const FString& playerSessionId)
```

### Parameters


playerSessionId  
Unique ID issued by Amazon GameLift Servers when a new player session is created.

### Return value


Returns a generic outcome consisting of success or failure with an error message. 

### Example


This example handles a connection request that includes validating and rejecting non-valid player session IDs.

```
bool GameLiftManager::AcceptPlayerSession(const FString& playerSessionId, const FString& playerId)
{
  #if WITH_GAMELIFT
  UE_LOG(GameServerLog, Log, TEXT("Accepting GameLift PlayerSession: %s . PlayerId: %s"), *playerSessionId, *playerId);
  FString gsId = GetCurrentGameSessionId();
  if (gsId.IsEmpty()) {
    UE_LOG(GameServerLog, Log, TEXT("No GameLift GameSessionId. Returning early!"));
    return false;
  }
  
  if (!GameLiftSdkModule->AcceptPlayerSession(playerSessionId).IsSuccess()) {
    UE_LOG(GameServerLog, Log, TEXT("PlayerSession not Accepted."));
    return false;
  }

  // Add PlayerSession from internal data structures keeping track of connected players
  connectedPlayerSessionIds.Add(playerSessionId);
  idToPlayerSessionMap.Add(playerSessionId, PlayerSession{ playerId, playerSessionId });
  return true;
  #else
  return false;
  #endif
}
```

## RemovePlayerSession()


Notifies Amazon GameLift Servers that a player has disconnected from the server process. In response, Amazon GameLift Servers changes the player slot to available. 

### Syntax


```
FGameLiftGenericOutcome RemovePlayerSession(const FString& playerSessionId)
```

### Parameters


**`playerSessionId`**  
Unique ID issued by Amazon GameLift Servers when a new player session is created.

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


```
bool GameLiftManager::RemovePlayerSession(const FString& playerSessionId)
{
  #if WITH_GAMELIFT
  UE_LOG(GameServerLog, Log, TEXT("Removing GameLift PlayerSession: %s"), *playerSessionId);

  if (!GameLiftSdkModule->RemovePlayerSession(playerSessionId).IsSuccess()) {
    UE_LOG(GameServerLog, Log, TEXT("PlayerSession Removal Failed"));
    return false;
  }

  // Remove PlayerSession from internal data structures that are keeping track of connected players
  connectedPlayerSessionIds.Remove(playerSessionId);
  idToPlayerSessionMap.Remove(playerSessionId);

  // end the session if there are no more players connected
  if (connectedPlayerSessionIds.Num() == 0) {
    EndSession();
  }

  return true;
  #else
  return false;
  #endif
}
```

## DescribePlayerSessions()


Retrieves player session data which includes settings, session metadata, and player data. Use this method to get information about the following:
+ A single player session
+ All player sessions in a game session
+ All player sessions associated with a single player ID

### Syntax


```
FGameLiftDescribePlayerSessionsOutcome DescribePlayerSessions(const FGameLiftDescribePlayerSessionsRequest &describePlayerSessionsRequest)
```

### Parameters


**[FGameLiftDescribePlayerSessionsRequest](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-playersessions)**  
A [FGameLiftDescribePlayerSessionsRequest](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-playersessions) object that describes which player sessions to retrieve.

### Return value


If successful, returns a [FGameLiftDescribePlayerSessionsOutcome](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-describeplayersessionsoutcome) object containing a set of player session objects that fit the request parameters.

### Example


This example requests all player sessions actively connected to a specified game session. By omitting *NextToken* and setting the *Limit* value to 10, Amazon GameLift Servers returns the first 10 player session records matching the request.

```
void GameLiftManager::DescribePlayerSessions()
{
  #if WITH_GAMELIFT
  FString localPlayerSessions;
  for (auto& psId : connectedPlayerSessionIds)
  {
    PlayerSession ps = idToPlayerSessionMap[psId];
    localPlayerSessions += FString::Printf(TEXT("%s : %s  ; "), *(ps.playerSessionId), *(ps.playerId));
  }
  UE_LOG(GameServerLog, Log, TEXT("LocalPlayerSessions: %s"), *localPlayerSessions);

  UE_LOG(GameServerLog, Log, TEXT("Describing PlayerSessions in this GameSession"));
  FGameLiftDescribePlayerSessionsRequest request;
  request.m_gameSessionId = GetCurrentGameSessionId();

  FGameLiftDescribePlayerSessionsOutcome outcome = GameLiftSdkModule->DescribePlayerSessions(request);
  LogDescribePlayerSessionsOutcome(outcome);
  #endif
}
```

## StartMatchBackfill()


Sends a request to find new players for open slots in a game session created with FlexMatch. For more information, see [FlexMatch backfill feature](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-backfill.html).

This action is asynchronous. If new players are matched, Amazon GameLift Servers delivers updated matchmaker data using the callback function `OnUpdateGameSession()`.

A server process can have only one active match backfill request at a time. To send a new request, first call [StopMatchBackfill()](#integration-server-sdk5-unreal-stopmatchbackfill) to cancel the original request.

### Syntax


```
FGameLiftStringOutcome StartMatchBackfill (FStartMatchBackfillRequest &startBackfillRequest);
```

### Parameters


**[FStartMatchBackfillRequest](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-startmatchbackfillrequest)**  
A StartMatchBackfillRequest object that communicates the following information:  
+ A ticket ID to assign to the backfill request. This information is optional; if no ID is provided, Amazon GameLift Servers will generate one.
+ The matchmaker to send the request to. The full configuration ARN is required. This value is in the game session's matchmaker data.
+ The ID of the game session to backfill.
+ The available matchmaking data for the game session's current players.

### Return value


Returns a `StartMatchBackfillOutcome` object with the match backfill ticket ID, or failure with an error message. 

### Example


```
FGameLiftStringOutcome FGameLiftServerSDKModule::StartMatchBackfill(const FStartMatchBackfillRequest& request) 
{
  #if WITH_GAMELIFT
  Aws::GameLift::Server::Model::StartMatchBackfillRequest sdkRequest;
  sdkRequest.SetTicketId(TCHAR_TO_UTF8(*request.m_ticketId));
  sdkRequest.SetGameSessionArn(TCHAR_TO_UTF8(*request.m_gameSessionArn));
  sdkRequest.SetMatchmakingConfigurationArn(TCHAR_TO_UTF8(*request.m_matchmakingConfigurationArn));
  for (auto player : request.m_players) {
    Aws::GameLift::Server::Model::Player sdkPlayer;
    sdkPlayer.SetPlayerId(TCHAR_TO_UTF8(*player.m_playerId));
    sdkPlayer.SetTeam(TCHAR_TO_UTF8(*player.m_team));
    for (auto entry : player.m_latencyInMs) {
      sdkPlayer.WithLatencyMs(TCHAR_TO_UTF8(*entry.Key), entry.Value);
    }

    std::map<std::string, Aws::GameLift::Server::Model::AttributeValue> sdkAttributeMap;
    for (auto attributeEntry : player.m_playerAttributes) {
      FAttributeValue value = attributeEntry.Value;
      Aws::GameLift::Server::Model::AttributeValue attribute;
      switch (value.m_type) {
        case FAttributeType::STRING:
          attribute = Aws::GameLift::Server::Model::AttributeValue(TCHAR_TO_UTF8(*value.m_S));
        break;
        case FAttributeType::DOUBLE:
          attribute = Aws::GameLift::Server::Model::AttributeValue(value.m_N);
        break;
        case FAttributeType::STRING_LIST:
          attribute = Aws::GameLift::Server::Model::AttributeValue::ConstructStringList();
          for (auto sl : value.m_SL) {
            attribute.AddString(TCHAR_TO_UTF8(*sl));
          };
        break;
        case FAttributeType::STRING_DOUBLE_MAP:
          attribute = Aws::GameLift::Server::Model::AttributeValue::ConstructStringDoubleMap();
          for (auto sdm : value.m_SDM) {
            attribute.AddStringAndDouble(TCHAR_TO_UTF8(*sdm.Key), sdm.Value);
          };
        break;
      }
      sdkPlayer.WithPlayerAttribute((TCHAR_TO_UTF8(*attributeEntry.Key)), attribute);
    }
    sdkRequest.AddPlayer(sdkPlayer);
  }
  auto outcome = Aws::GameLift::Server::StartMatchBackfill(sdkRequest);
  if (outcome.IsSuccess()) {
    return FGameLiftStringOutcome(outcome.GetResult().GetTicketId());
  }
  else {
    return FGameLiftStringOutcome(FGameLiftError(outcome.GetError()));
  }
  #else
  return FGameLiftStringOutcome("");
  #endif
}
```

## StopMatchBackfill()


Cancels an active match backfill request. For more information, see [FlexMatch backfill feature](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-backfill.html).

### Syntax


```
FGameLiftGenericOutcome StopMatchBackfill (FStopMatchBackfillRequest &stopBackfillRequest);
```

### Parameters


**[FStopMatchBackfillRequest](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-stopmatchbackfillrequest)**  
A StopMatchBackfillRequest object identifying the matchmaking ticket to cancel:   
+ The ticket ID assigned to the backfill request.
+ The matchmaker the backfill request was sent to.
+ The game session associated with the backfill request.

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


```
FGameLiftGenericOutcome FGameLiftServerSDKModule::StopMatchBackfill(const FStopMatchBackfillRequest& request)
{
  #if WITH_GAMELIFT
  Aws::GameLift::Server::Model::StopMatchBackfillRequest sdkRequest;
  sdkRequest.SetTicketId(TCHAR_TO_UTF8(*request.m_ticketId));
  sdkRequest.SetGameSessionArn(TCHAR_TO_UTF8(*request.m_gameSessionArn));
  sdkRequest.SetMatchmakingConfigurationArn(TCHAR_TO_UTF8(*request.m_matchmakingConfigurationArn));
  auto outcome = Aws::GameLift::Server::StopMatchBackfill(sdkRequest);
  if (outcome.IsSuccess()) {
    return FGameLiftGenericOutcome(nullptr);
  }
  else {
    return FGameLiftGenericOutcome(FGameLiftError(outcome.GetError()));
  }
  #else
  return FGameLiftGenericOutcome(nullptr);
  #endif
}
```

## GetComputeCertificate()


Retrieves the path to the TLS certificate used to encrypt the network connection between your Amazon GameLift Servers Anywhere compute resource and Amazon GameLift Servers. You can use the certificate path when you register your compute device to a Amazon GameLift Servers Anywhere fleet. For more information see, [RegisterCompute](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html).

### Syntax


```
FGameLiftGetComputeCertificateOutcome FGameLiftServerSDKModule::GetComputeCertificate()
```

### Return value


Returns a `GetComputeCertificateResponse` object containing the following: 
+ CertificatePath: The path to the TLS certificate on your compute resource. 
+ HostName: The host name of your compute resource.

### Example


```
FGameLiftGetComputeCertificateOutcome FGameLiftServerSDKModule::GetComputeCertificate()
{
  #if WITH_GAMELIFT
  auto outcome = Aws::GameLift::Server::GetComputeCertificate();
  if (outcome.IsSuccess()) {
    auto& outres = outcome.GetResult();
    FGameLiftGetComputeCertificateResult result;
    result.m_certificate_path = UTF8_TO_TCHAR(outres.GetCertificatePath());
    result.m_computeName = UTF8_TO_TCHAR(outres.GetComputeName());
    return FGameLiftGetComputeCertificateOutcome(result);
  }
  else {
    return FGameLiftGetComputeCertificateOutcome(FGameLiftError(outcome.GetError()));
  }
  #else
  return FGameLiftGetComputeCertificateOutcome(FGameLiftGetComputeCertificateResult());
  #endif
}
```

## GetFleetRoleCredentials()


Retrieves IAM role credentials that authorize Amazon GameLift Servers to interact with other AWS services. For more information, see [Connect your Amazon GameLift Servers hosted game server to other AWS resources](gamelift-sdk-server-resources.md).

### Syntax


```
FGameLiftGetFleetRoleCredentialsOutcome FGameLiftServerSDKModule::GetFleetRoleCredentials(const FGameLiftGetFleetRoleCredentialsRequest &request)
```

### Parameters


[FGameLiftGetFleetRoleCredentialsRequest](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsrequest)

### Return value


Returns a [FGameLiftGetFleetRoleCredentialsOutcome](integration-server-sdk5-unreal-datatypes.md#integration-server-sdk5-unreal-dataypes-getfleetrolecredentialsoutcome) object.

### Example


```
FGameLiftGetFleetRoleCredentialsOutcome FGameLiftServerSDKModule::GetFleetRoleCredentials(const FGameLiftGetFleetRoleCredentialsRequest &request)
{
  #if WITH_GAMELIFT
  Aws::GameLift::Server::Model::GetFleetRoleCredentialsRequest sdkRequest;
  sdkRequest.SetRoleArn(TCHAR_TO_UTF8(*request.m_roleArn));
  sdkRequest.SetRoleSessionName(TCHAR_TO_UTF8(*request.m_roleSessionName));

  auto outcome = Aws::GameLift::Server::GetFleetRoleCredentials(sdkRequest);

  if (outcome.IsSuccess()) {
    auto& outres = outcome.GetResult();
    FGameLiftGetFleetRoleCredentialsResult result;
    result.m_assumedUserRoleArn = UTF8_TO_TCHAR(outres.GetAssumedUserRoleArn());
    result.m_assumedRoleId = UTF8_TO_TCHAR(outres.GetAssumedRoleId());
    result.m_accessKeyId = UTF8_TO_TCHAR(outres.GetAccessKeyId());
    result.m_secretAccessKey = UTF8_TO_TCHAR(outres.GetSecretAccessKey());
    result.m_sessionToken = UTF8_TO_TCHAR(outres.GetSessionToken());
    result.m_expiration = FDateTime::FromUnixTimestamp(outres.GetExpiration());
    return FGameLiftGetFleetRoleCredentialsOutcome(result);
  }
  else {
    return FGameLiftGetFleetRoleCredentialsOutcome(FGameLiftError(outcome.GetError()));
  }
  #else
  return FGameLiftGetFleetRoleCredentialsOutcome(FGameLiftGetFleetRoleCredentialsResult());
  #endif
}
```

## Destroy()


Frees the Amazon GameLift Servers game server SDK from memory. As a best practice, call this method after `ProcessEnding()` and before terminating the process. If you're using an Anywhere fleet and you're not terminating server processes after every game session, call `Destroy()` and then `InitSDK()` to reinitialize before notifying Amazon GameLift Servers that the process is ready to host a game session with `ProcessReady()`.

### Syntax


```
FGameLiftGenericOutcome Destroy();
```

### Parameters


There are no parameters.

### Return value


Returns a generic outcome consisting of success or failure with an error message.

### Example


```
// First call ProcessEnding()
FGameLiftGenericOutcome processEndingOutcome = GameLiftSdkModule->ProcessEnding();
  
// Then call Destroy() to free the SDK from memory
FGameLiftGenericOutcome destroyOutcome = GameLiftSdkModule->Destroy();
  
// Exit the process with success or failure
if (processEndingOutcome.IsSuccess() && destroyOutcome.IsSuccess()) 
    {
    UE_LOG(GameServerLog, Log, TEXT("Server process ending successfully"));
}
else {
    if (!processEndingOutcome.IsSuccess()) {
        const FGameLiftError& error = processEndingOutcome.GetError();
        UE_LOG(GameServerLog, Error, TEXT("ProcessEnding() failed. Error: %s"),
        error.m_errorMessage.IsEmpty() ? TEXT("Unknown error") : *error.m_errorMessage);
    }
    if (!destroyOutcome.IsSuccess()) {
        const FGameLiftError& error = destroyOutcome.GetError();
        UE_LOG(GameServerLog, Error, TEXT("Destroy() failed. Error: %s"),
        error.m_errorMessage.IsEmpty() ? TEXT("Unknown error") : *error.m_errorMessage);
    }
}
```