

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Amazon GameLift Servers용 C\$1 서버 SDK 5.x - 작업
<a name="integration-server-sdk5-csharp-actions"></a>

해당 서버 SDK 5.x 참조를 사용하여 Amazon GameLift Servers와 함께 호스팅할 멀티플레이어 게임을 통합합니다. 통합 프로세스에 대한 지침은 [서버 SDK를 사용하여 게임 서버에 Amazon GameLift Servers를 추가합니다.](gamelift-sdk-server-api.md) 페이지를 참조하세요. 또한 Unity용 Amazon GameLift Servers 플러그인을 사용하는 경우 [Amazon GameLift Servers Unity용 플러그인(서버 SDK 5.x)](unity-plug-in.md) 페이지를 참조하세요.

[Amazon GameLift Servers용 C\$1 서버 SDK 5.x - 데이터 유형](integration-server-sdk5-csharp-datatypes.md)

**Topics**
+ [Amazon GameLift Servers용 C\$1 서버 SDK 5.x - 데이터 유형](integration-server-sdk5-csharp-datatypes.md)
+ [GetSdkVersion()](#integration-server-sdk5-csharp-getsdkversion)
+ [InitMetrics()](#integration-server-sdk5-csharp-initmetrics)
+ [InitSDK()](#integration-server-sdk5-csharp-initsdk)
+ [InitSDK()](#integration-server-sdk5-csharp-initsdk-anywhere)
+ [ProcessReady()](#integration-server-sdk5-csharp-processready)
+ [ProcessEnding()](#integration-server-sdk5-csharp-processending)
+ [ActivateGameSession()](#integration-server-sdk5-csharp-activategamesession)
+ [UpdatePlayerSessionCreationPolicy()](#integration-server-sdk5-csharp-updateplayersessioncreationpolicy)
+ [GetGameSessionId()](#integration-server-sdk5-csharp-getgamesessionid)
+ [GetTerminationTime()](#integration-server-sdk5-csharp-getterm)
+ [AcceptPlayerSession()](#integration-server-sdk5-csharp-acceptplayersession)
+ [RemovePlayerSession()](#integration-server-sdk5-csharp-removeplayersession)
+ [DescribePlayerSessions()](#integration-server-sdk5-csharp-describeplayersessions)
+ [StartMatchBackfill()](#integration-server-sdk5-csharp-startmatchbackfill)
+ [StopMatchBackfill()](#integration-server-sdk5-csharp-stopmatchbackfill)
+ [GetComputeCertificate()](#integration-server-sdk5-csharp-getcomputecertificate)
+ [GetFleetRoleCredentials()](#integration-server-sdk5-csharp-getfleetrolecredentials)
+ [Destroy()](#integration-server-sdk5-csharp-destroy)

## GetSdkVersion()
<a name="integration-server-sdk5-csharp-getsdkversion"></a>

현재 서버 프로세스에 빌드된 SDK 버전 번호를 반환합니다.

### 구문
<a name="integration-server-sdk5-csharp-getsdkversion-syntax"></a>

```
AwsStringOutcome GetSdkVersion();
```

### 반환 값
<a name="integration-server-sdk5-csharp-getsdkversion-return"></a>

성공하면 현재 SDK 버전을 [AwsStringOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-awsstringoutcome) 객체로 반환합니다. 반환된 문자열에는 버전 번호(예: `5.0.0`)가 포함됩니다. 실패하면 오류 메시지를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-getsdkversion-example"></a>

```
var getSdkVersionOutcome = GameLiftServerAPI.GetSdkVersion();
```

## InitMetrics()
<a name="integration-server-sdk5-csharp-initmetrics"></a>

서버 성능 데이터를 수집하고 보고하기 위한 지표 시스템을 초기화합니다. 최상의 결과를 얻으려면 [InitSDK()](#integration-server-sdk5-csharp-initsdk) 전에 이 메서드를 호출하여 SDK 초기화 중에 지표 수집을 활성화합니다.

### 구문
<a name="integration-server-sdk5-csharp-initmetrics-syntax"></a>

```
MetricsManagerOutcome InitMetrics();
MetricsManagerOutcome InitMetrics(MetricsParameters metricsParameters);
```

### 파라미터
<a name="integration-server-sdk5-csharp-initmetrics-parameter"></a>

[MetricsParameters](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-metricsparameters) (선택 사항)  
지표 수집을 위한 구성 파라미터입니다. 제공되지 않은 경우 환경 변수로 재정의할 수 있는 기본값을 사용합니다.

### 반환 값
<a name="integration-server-sdk5-csharp-initmetrics-return"></a>

성공하면 MetricsManager 인스턴스를 포함하는 [MetricsManagerOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-metricsmanageroutcome) 객체를 반환합니다. 실패하면 오류 메시지를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-initmetrics-example"></a>

```
// Initialize with default parameters (uses environment variables if available)
var outcome = GameLiftServerAPI.InitMetrics();
if (outcome.Success) {
    var metricsManager = outcome.Result;
} else {
    Console.WriteLine("Failed to initialize metrics: " + outcome.Error.ErrorMessage);
}

// Initialize with custom parameters
var metricsParams = new MetricsParameters("localhost", 8125, "crash-host", 9999, 1000, 1024);
var customOutcome = GameLiftServerAPI.InitMetrics(metricsParams);
if (customOutcome.Success) {
    var metricsManager = customOutcome.Result;
}
```

## InitSDK()
<a name="integration-server-sdk5-csharp-initsdk"></a>

관리형 EC2 플릿의 Amazon GameLift Servers SDK를 초기화합니다. Amazon GameLift Servers와 관련된 다른 초기화가 발생하기 전에 시작 시 이 메서드를 호출합니다. 이 메서드는 호스트 환경에서 서버 파라미터를 읽어 서버와 Amazon GameLift Servers 서비스 간의 통신을 설정합니다. 멱등성 토큰을 사용하므로 실패 시 이 호출을 안전하게 다시 시도할 수 있습니다.

### 구문
<a name="integration-server-sdk5-csharp-initsdk-syntax"></a>

```
GenericOutcome InitSDK();
```

### 반환 값
<a name="integration-server-sdk5-csharp-initsdk-return"></a>

성공하는 경우, 서버 프로세스가 [ProcessReady()](#integration-server-sdk5-csharp-processready)를 호출할 준비가 되었음을 나타내는 InitSdkOutcome 객체를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-initsdk-example"></a>

```
//Call InitSDK to establish a local connection with the GameLift agent to enable further communication.
GenericOutcome initSDKOutcome = GameLiftServerAPI.InitSDK();
```

## InitSDK()
<a name="integration-server-sdk5-csharp-initsdk-anywhere"></a>

Anywhere 플릿용 Amazon GameLift Servers SDK를 초기화합니다. Amazon GameLift Servers와 관련된 다른 초기화가 발생하기 전에 시작 시 이 메서드를 호출합니다. 이 메서드는 명시적인 서버 파라미터를 통해 서버와 Amazon GameLift Servers 서비스 간의 통신을 설정합니다. 멱등성 토큰을 사용하므로 실패 시 이 호출을 안전하게 다시 시도할 수 있습니다.

### 구문
<a name="integration-server-sdk5-csharp-initsdk-anywhere-syntax"></a>

```
GenericOutcome InitSDK(ServerParameters serverParameters);
```

### 파라미터
<a name="integration-server-sdk5-csharp-initsdk-anywhere-parameter"></a>

[ServerParameters](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-serverparameters)  
Amazon GameLift Servers Anywhere 플릿에서 게임 서버를 초기화하려면 다음 정보를 사용하여 `ServerParameters` 객체를 구성합니다.  
+ 게임 서버에 연결하는 데 사용되는 WebSocket의 URL입니다.
+ 게임 서버를 호스팅하는 데 사용되는 프로세스의 ID입니다.
+ 게임 서버 프로세스를 호스팅하는 컴퓨팅의 ID입니다.
+ Amazon GameLift Servers Anywhere 컴퓨팅이 포함된 Amazon GameLift Servers 플릿의 ID입니다.
+ Amazon GameLift Servers 작업을 통해 생성된 인증 토큰입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-initsdk-anywhere-return"></a>

성공하는 경우, 서버 프로세스가 [ProcessReady()](#integration-server-sdk5-csharp-processready)를 호출할 준비가 되었음을 나타내는 InitSdkOutcome 객체를 반환합니다.

**참고**  
Anywhere 플릿에 배포된 게임 빌드에 대한 `InitSDK()`로의 호출이 실패하는 경우 빌드 리소스를 생성할 때 사용된 `ServerSdkVersion` 파라미터를 확인합니다. 명시적으로 이 값을 사용 중인 Server SDK 버전으로 설정해야 합니다. 이 파라미터의 기본값은 4.x이며 호환되지 않습니다. 이 문제를 해결하려면 새 빌드를 생성하여 새 플릿에 배포해야 합니다.

### 예제
<a name="integration-server-sdk5-csharp-initsdk-anywhere-example"></a>

```
//Define the server parameters
string websocketUrl = "wss://us-west-1.api.amazongamelift.com";
string processId = "PID1234";
string fleetId = "aarn:aws:gamelift:us-west-1:111122223333:fleet/fleet-9999ffff-88ee-77dd-66cc-5555bbbb44aa";
string hostId = "HardwareAnywhere";
string authToken = "1111aaaa-22bb-33cc-44dd-5555eeee66ff";
ServerParameters serverParameters = 
  new ServerParameters(webSocketUrl, processId, hostId, fleetId, authToken);

//Call InitSDK to establish a local connection with the GameLift agent to enable further communication.
GenericOutcome initSDKOutcome = GameLiftServerAPI.InitSDK(serverParameters);
```

## ProcessReady()
<a name="integration-server-sdk5-csharp-processready"></a>

Amazon GameLift Servers에 서버 프로세스가 게임 세션을 호스팅할 준비가 되었음을 알립니다. [InitSDK()](#integration-server-sdk5-csharp-initsdk) 호출 후 이 메서드를 호출합니다. 이 메서드는 프로세스당 한 번만 호출해야 합니다.

### 구문
<a name="integration-server-sdk5-csharp-processready-syntax"></a>

```
GenericOutcome ProcessReady(ProcessParameters processParameters)
```

### 파라미터
<a name="integration-server-sdk5-csharp-processready-parameter"></a>

**[ProcessParameters](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-process)**  
`ProcessParameters` 객체에는 서버 프로세스에 대한 정보가 들어 있습니다.

### 반환 값
<a name="integration-server-sdk5-csharp-processready-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-processready-example"></a>

이 예에서는 메서드 및 위임 함수 구현을 모두 보여줍니다.

```
// Set parameters and call ProcessReady
ProcessParameters processParams = new ProcessParameters(
  this.OnStartGameSession,
  this.OnProcessTerminate,
  this.OnHealthCheck,
  this.OnUpdateGameSession,
  port,
  new LogParameters(new List<string>()  
  // Examples of log and error files written by the game server
  {
    "C:\\game\\logs",
    "C:\\game\\error"
  })
);
GenericOutcome processReadyOutcome = GameLiftServerAPI.ProcessReady(processParams);
```

## ProcessEnding()
<a name="integration-server-sdk5-csharp-processending"></a>

서버 프로세스가 종료 중임을 Amazon GameLift Servers에 알립니다. 활성 게임 세션의 종료 등 다른 모든 정리 작업 이후 및 프로세스를 종료하기 전에 이 메서드를 호출합니다. `ProcessEnding()`의 결과에 따라 프로세스가 성공(0) 또는 오류(-1)로 종료되고 플릿 이벤트가 생성됩니다. 오류가 발생하여 프로세스가 종료되는 경우 생성되는 플릿 이벤트는 `SERVER_PROCESS_TERMINATED_UNHEALTHY`입니다.

### 구문
<a name="integration-server-sdk5-csharp-processending-syntax"></a>

```
GenericOutcome ProcessEnding()
```

### 반환 값
<a name="integration-server-sdk5-csharp-processending-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-processending-example"></a>

이 예제에서는 성공 또는 오류 발생 시 서버 프로세스를 종료하기 전에 `ProcessEnding()` 및 `Destroy()`를 호출합니다.

```
GenericOutcome processEndingOutcome = GameLiftServerAPI.ProcessEnding();
GameLiftServerAPI.Destroy();

if (processEndingOutcome.Success)
  {
    Environment.Exit(0);
  }
else
  {
    Console.WriteLine("ProcessEnding() failed. Error: " + processEndingOutcome.Error.ToString());
    Environment.Exit(-1);  
  }
```

## ActivateGameSession()
<a name="integration-server-sdk5-csharp-activategamesession"></a>

Amazon GameLift Servers에 서버 프로세스가 게임 세션을 활성화했으며 이제 플레이어 연결을 수신할 준비가 되었음을 알립니다. 이 작업은 모든 게임 세션 초기화 후 `onStartGameSession()` 콜백 함수의 일부로 호출되어야 합니다.

### 구문
<a name="integration-server-sdk5-csharp-activategamesession-syntax"></a>

```
GenericOutcome ActivateGameSession()
```

### 반환 값
<a name="integration-server-sdk5-csharp-activategamesession-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-activategamesession-example"></a>

이 예에서는 `onStartGameSession()` 위임 함수의 일부로 `ActivateGameSession()`이 호출되는 것을 보여줍니다.

```
void OnStartGameSession(GameSession gameSession)
{
  // game-specific tasks when starting a new game session, such as loading map   
  // When ready to receive players   
  GenericOutcome activateGameSessionOutcome = GameLiftServerAPI.ActivateGameSession();
}
```

## UpdatePlayerSessionCreationPolicy()
<a name="integration-server-sdk5-csharp-updateplayersessioncreationpolicy"></a>

현재 게임 세션의 새 플레이어 세션 수락 가능성을 업데이트합니다. 모든 새 플레이어 세션을 수락하거나 거부하도록 게임 세션을 설정할 수 있습니다.

### 구문
<a name="integration-server-sdk5-csharp-updateplayersessioncreationpolicy-syntax"></a>

```
GenericOutcome UpdatePlayerSessionCreationPolicy(PlayerSessionCreationPolicy playerSessionPolicy)
```

### 파라미터
<a name="integration-server-sdk5-csharp-updateplayersessioncreationpolicy-parameter"></a>

**playerSessionPolicy**  
게임 세션이 새 플레이어를 수락하는지 여부를 나타내는 문자열 값입니다.  
유효한 값으로는 다음이 포함됩니다.  
+ **ACCEPT\$1ALL** - 모든 새 플레이어 세션을 수락합니다.
+ **DENY\$1ALL** - 모든 새 플레이어 세션을 거부합니다.

### 반환 값
<a name="integration-server-sdk5-csharp-updateplayersessioncreationpolicy-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-updateplayersessioncreationpolicy-example"></a>

이 예는 모든 플레이어를 수락하도록 현재 게임 세션의 참여 정책을 설정합니다.

```
GenericOutcome updatePlayerSessionPolicyOutcome = 
  GameLiftServerAPI.UpdatePlayerSessionCreationPolicy(PlayerSessionCreationPolicy.ACCEPT_ALL);
```

## GetGameSessionId()
<a name="integration-server-sdk5-csharp-getgamesessionid"></a>

활성 서버 프로세스가 호스팅된 게임 세션의 ID를 가져옵니다.

게임 세션으로 활성화되지 않은 유휴 프로세스의 경우 호출은 [GameLiftError](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-gamelifterror)를 반환합니다.

### 구문
<a name="integration-server-sdk5-csharp-getgamesessionid-syntax"></a>

```
AwsStringOutcome GetGameSessionId()
```

### 반환 값
<a name="integration-server-sdk5-csharp-getgamesessionid-return"></a>

성공하면 게임 세션 ID를 [AwsStringOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-awsstringoutcome) 객체로 반환합니다. 실패하면 오류 메시지를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-getgamesessionid-example"></a>

```
AwsStringOutcome getGameSessionIdOutcome = GameLiftServerAPI.GetGameSessionId();
```

## GetTerminationTime()
<a name="integration-server-sdk5-csharp-getterm"></a>

종료 시간을 사용할 수 있는 경우 서버 프로세스가 종료되도록 예약된 시간을 반환합니다. 서버 프로세스는 Amazon GameLift Servers에서 `onProcessTerminate()` 콜백을 수신한 후 이 작업을 수행합니다. 다음과 같은 이유로 Amazon GameLift Servers가 `onProcessTerminate()`를 호출합니다.
+ 서버 프로세스가 상태 불량을 보고했거나 Amazon GameLift Servers에 응답하지 않은 경우
+ 스케일 다운 이벤트 중에 인스턴스를 종료하는 경우
+ [스팟 인스턴스 중단](spot-tasks.md)으로 인해 인스턴스가 종료되는 경우

### 구문
<a name="integration-server-sdk5-csharp-getterm-syntax"></a>

```
AwsDateTimeOutcome GetTerminationTime()
```

### 반환 값
<a name="integration-server-sdk5-csharp-getterm-return"></a>

성공하면 종료 시간을 [AwsDateTimeOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-awsdatetimeoutcome) 객체로 반환합니다. 값은 종료 시간이며, `0001 00:00:00` 이후 경과된 틱 수로 표시됩니다. 예를 들어, 날짜 시간 값 `2020-09-13 12:26:40 -000Z`는 `637355968000000000` 틱 수와 같습니다. 사용 가능한 종료 시간이 없는 경우 오류 메시지를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-getterm-example"></a>

```
AwsDateTimeOutcome getTerminationTimeOutcome = GameLiftServerAPI.GetTerminationTime(); 
```

## AcceptPlayerSession()
<a name="integration-server-sdk5-csharp-acceptplayersession"></a>

Amazon GameLift Servers에 지정된 플레이어 세션 ID의 플레이어가 서버 프로세스에 연결되었고 검증이 필요함을 알립니다. Amazon GameLift Servers는 플레이어 세션 ID가 유효한지 확인합니다. 플레이어 세션이 검증된 후 Amazon GameLift Servers는 플레이어 슬롯의 상태를 RESERVED에서 ACTIVE로 변경합니다.

### 구문
<a name="integration-server-sdk5-csharp-acceptplayersession-syntax"></a>

```
GenericOutcome AcceptPlayerSession(String playerSessionId)
```

### 파라미터
<a name="integration-server-sdk5-csharp-acceptplayersession-parameter"></a>

playerSessionId  
새로운 플레이어 세션이 생성되었을 때 GameLift가 발행한 고유 ID입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-acceptplayersession-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-acceptplayersession-example"></a>

이 예는 잘못된 플레이어 세션 ID 검증 및 거부를 비롯해 연결 요청을 처리하기 위한 함수를 보여줍니다.

```
void ReceiveConnectingPlayerSessionID (Connection connection, String playerSessionId)
{
  GenericOutcome acceptPlayerSessionOutcome = GameLiftServerAPI.AcceptPlayerSession(playerSessionId);
  if(acceptPlayerSessionOutcome.Success)
  {
    connectionToSessionMap.emplace(connection, playerSessionId);
    connection.Accept();
  }
  else 
  {
    connection.Reject(acceptPlayerSessionOutcome.Error.ErrorMessage);
  }       
}
```

## RemovePlayerSession()
<a name="integration-server-sdk5-csharp-removeplayersession"></a>

플레이어가 서버 프로세스와의 연결이 끊겼음을 Amazon GameLift Servers에 알립니다. 이에 따라 Amazon GameLift Servers는 플레이어 슬롯을 사용 가능한 것으로 변경합니다.

### 구문
<a name="integration-server-sdk5-csharp-removeplayersession-syntax"></a>

```
GenericOutcome RemovePlayerSession(String playerSessionId)
```

### 파라미터
<a name="integration-server-sdk5-csharp-removeplayersession-parameter"></a>

**playerSessionId**  
새로운 플레이어 세션이 생성되었을 때 Amazon GameLift Servers가 발행한 고유 ID입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-removeplayersession-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-removeplayersession-example"></a>

```
GenericOutcome removePlayerSessionOutcome = GameLiftServerAPI.RemovePlayerSession(playerSessionId);
```

## DescribePlayerSessions()
<a name="integration-server-sdk5-csharp-describeplayersessions"></a>

설정, 세션 메타데이터 및 플레이어 데이터 등의 플레이어 세션 데이터를 가져옵니다. 이 작업을 사용하면 단일 플레이어 세션 정보, 게임 세션에 있는 모든 플레이어 세션 정보 또는 단일 플레이어 ID와 관련된 모든 플레이어 세션 정보를 가져올 수 있습니다.

### 구문
<a name="integration-server-sdk5-csharp-describeplayersessions-syntax"></a>

```
DescribePlayerSessionsOutcome DescribePlayerSessions(DescribePlayerSessionsRequest describePlayerSessionsRequest)
```

### 파라미터
<a name="integration-server-sdk5-csharp-describeplayersessions-parameter"></a>

**[DescribePlayerSessionsRequest](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-playersessions)**  
검색할 플레이어 세션을 설명하는 [DescribePlayerSessionsRequest](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-playersessions) 객체입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-describeplayersessions-return"></a>

성공하는 경우, 요청 파라미터에 적합한 플레이어 세션 객체 집합이 들어 있는 [DescribePlayerSessionsOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-describeplayersessionsoutcome) 객체를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-describeplayersessions-example"></a>

다음은 지정된 게임 세션에 활성 상태로 연결되어 있는 모든 플레이어 세션을 검색하는 요청을 보여주는 예입니다. *NextToken*을 생략하고 *Limit* 값을 10으로 설정하면, Amazon GameLift Servers가 요청과 일치하는 처음 10개의 플레이어 세션 레코드를 반환합니다.

```
// Set request parameters 
DescribePlayerSessionsRequest describePlayerSessionsRequest = new DescribePlayerSessionsRequest()
{
  GameSessionId = GameLiftServerAPI.GetGameSessionId().Result,    //gets the ID for the current game session
  Limit = 10,
  PlayerSessionStatusFilter = 
    PlayerSessionStatusMapper.GetNameForPlayerSessionStatus(PlayerSessionStatus.ACTIVE)
}; 
// Call DescribePlayerSessions
DescribePlayerSessionsOutcome describePlayerSessionsOutcome = 
  GameLiftServerAPI.DescribePlayerSessions(describePlayerSessionsRequest);
```

## StartMatchBackfill()
<a name="integration-server-sdk5-csharp-startmatchbackfill"></a>

FlexMatch를 통해 생성된 게임 세션에서 열린 슬롯에 참여할 새로운 플레이어를 찾는 요청을 보냅니다. 자세한 내용은 [FlexMatch 채우기 기능](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-backfill.html)을 참조하세요.

이 작업은 비동기식입니다. 새로운 플레이어가 매치되면 Amazon GameLift Servers는 콜백 함수 `OnUpdateGameSession()`을 사용하여 업데이트된 매치메이커 데이터를 전달합니다.

서버 프로세스는 한 번에 하나의 활성 매치 채우기 요청만 할 수 있습니다. 새 요청을 보내려면 먼저 [StopMatchBackfill()](#integration-server-sdk5-csharp-stopmatchbackfill)을 호출하여 원본 요청을 취소해야 합니다.

### 구문
<a name="integration-server-sdk5-csharp-startmatchbackfill-syntax"></a>

```
StartMatchBackfillOutcome StartMatchBackfill (StartMatchBackfillRequest startBackfillRequest);
```

### 파라미터
<a name="integration-server-sdk5-csharp-startmatchbackfill-parameter"></a>

**[StartMatchBackfillRequest](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-startmatchbackfillrequest)**  
`StartMatchBackfillRequest` 객체에는 채우기 요청에 대한 정보가 들어 있습니다.

### 반환 값
<a name="integration-server-sdk5-csharp-startmatchbackfill-return"></a>

매치 채우기 티켓 ID와 함께 [StartMatchBackfillOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-startmatchbackfilloutcome) 객체나 오류 메시지를 포함한 결함을 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-startmatchbackfill-example"></a>

```
// Build a backfill request
StartMatchBackfillRequest startBackfillRequest = new StartMatchBackfillRequest()
{
  TicketId = "1111aaaa-22bb-33cc-44dd-5555eeee66ff", //optional
  MatchmakingConfigurationArn = "arn:aws:gamelift:us-west-2:111122223333:matchmakingconfiguration/MyMatchmakerConfig", 
  GameSessionId = GameLiftServerAPI.GetGameSessionId().Result,    // gets ID for current game session
  MatchmakerData matchmakerData = 
    MatchmakerData.FromJson(gameSession.MatchmakerData),  // gets matchmaker data for current players
  // get matchmakerData.Players
  // remove data for players who are no longer connected
  Players = ListOfPlayersRemainingInTheGame
};

// Send backfill request
StartMatchBackfillOutcome startBackfillOutcome = GameLiftServerAPI.StartMatchBackfill(startBackfillRequest);

// Implement callback function for backfill
void OnUpdateGameSession(GameSession myGameSession)
{
  // game-specific tasks to prepare for the newly matched players and update matchmaker data as needed  
}
```

## StopMatchBackfill()
<a name="integration-server-sdk5-csharp-stopmatchbackfill"></a>

활성 매치 채우기 요청을 취소합니다. 자세한 내용은 [FlexMatch 채우기 기능](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-backfill.html)을 참조하세요.

### 구문
<a name="integration-server-sdk5-csharp-stopmatchbackfill-syntax"></a>

```
GenericOutcome StopMatchBackfill (StopMatchBackfillRequest stopBackfillRequest);
```

### 파라미터
<a name="integration-server-sdk5-csharp-stopmatchbackfill-parameter"></a>

**[StopMatchBackfillRequest](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-stopmatchbackfillrequest)**  
중단하려는 매치메이킹 티켓에 대한 세부 정보를 제공하는 `StopMatchBackfillRequest` 객체입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-stopmatchbackfill-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-stopmatchbackfill-example"></a>

```
// Set backfill stop request parameters
StopMatchBackfillRequest stopBackfillRequest = new StopMatchBackfillRequest(){
  TicketId = "1111aaaa-22bb-33cc-44dd-5555eeee66ff", //optional, if not provided one is autogenerated
  MatchmakingConfigurationArn = "arn:aws:gamelift:us-west-2:111122223333:matchmakingconfiguration/MyMatchmakerConfig",
  GameSessionId = GameLiftServerAPI.GetGameSessionId().Result    //gets the ID for the current game session
};
GenericOutcome stopBackfillOutcome = GameLiftServerAPI.StopMatchBackfillRequest(stopBackfillRequest);
```

## GetComputeCertificate()
<a name="integration-server-sdk5-csharp-getcomputecertificate"></a>

 게임 서버 및 게임 클라이언트 간의 네트워크 연결을 암호화하는 데 사용되는 TLS 인증서의 경로를 검색합니다. Amazon GameLift Servers Anywhere 플릿에 컴퓨팅 디바이스를 등록할 때 인증서 경로를 사용할 수 있습니다. 자세한 내용은 [RegisterCompute](https://docs.aws.amazon.com/gameliftservers/latest/apireference/API_RegisterCompute.html)을 참조하세요.

### 구문
<a name="integration-server-sdk5-csharp-getcomputecertificate-syntax"></a>

```
GetComputeCertificateOutcome GetComputeCertificate();
```

### 반환 값
<a name="integration-server-sdk5-csharp-getcomputecertificate-return"></a>

다음을 포함하는 GetComputeCertificateResponse 객체를 반환합니다.
+  CertificatePath: 컴퓨팅 리소스에 있는 TLS 인증서의 경로입니다. Amazon GameLift Servers 관리형 플릿을 사용하는 경우 이 경로에는 다음이 포함됩니다.
  + `certificate.pem`: 최종 사용자 인증서입니다. 전체 인증서 체인은 이 인증서에 추가된 `certificateChain.pem`의 조합입니다.
  + `certificateChain.pem`: 루트 인증서와 중간 인증서를 포함하는 인증서 체인입니다.
  + `rootCertificate.pem`: 루트 인증서입니다.
  + `privateKey.pem`: 최종 사용자 인증서의 프라이빗 키입니다.
+ ComputeName: 컴퓨팅 리소스의 이름입니다.

### 예제
<a name="integration-server-sdk5-csharp-getcomputecertificate-example"></a>

```
GetComputeCertificateOutcome getComputeCertificateOutcome = GameLiftServerAPI.GetComputeCertificate();
```

## GetFleetRoleCredentials()
<a name="integration-server-sdk5-csharp-getfleetrolecredentials"></a>

Amazon GameLift Servers가 다른 AWS 서비스와 상호 작용할 수 있도록 승인하는 IAM 역할 자격 증명을 검색합니다. 자세한 내용은 [Amazon GameLift Servers 호스팅 게임 서버를 다른 AWS 리소스에 연결](gamelift-sdk-server-resources.md) 단원을 참조하십시오.

### 구문
<a name="integration-server-sdk5-csharp-getfleetrolecredentials-syntax"></a>

```
GetFleetRoleCredentialsOutcome GetFleetRoleCredentials(GetFleetRoleCredentialsRequest request);
```

### 파라미터
<a name="integration-server-sdk5-csharp-getfleetrolecredentials-parameters"></a>

[GetFleetRoleCredentialsRequest](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-dataypes-getfleetrolecredentialsrequest)  
 AWS 리소스에 대한 제한된 액세스를 게임 서버로 확장하는 역할 자격 증명입니다.

### 반환 값
<a name="integration-server-sdk5-csharp-getfleetrolecredentials-return"></a>

[GetFleetRoleCredentialsOutcome](integration-server-sdk5-csharp-datatypes.md#integration-server-sdk5-csharp-datatypes-getfleetrolecredentialsoutcome) 객체를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-getfleetrolecredentials-example"></a>

```
// form the fleet credentials request  
GetFleetRoleCredentialsRequest getFleetRoleCredentialsRequest = new GetFleetRoleCredentialsRequest(){  
  RoleArn = "arn:aws:iam::123456789012:role/service-role/exampleGameLiftAction"  
};
GetFleetRoleCredentialsOutcome GetFleetRoleCredentialsOutcome credentials = GetFleetRoleCredentials(getFleetRoleCredentialsRequest);
```

## Destroy()
<a name="integration-server-sdk5-csharp-destroy"></a>

Amazon GameLift Servers Game Server SDK를 메모리에서 분리합니다. `ProcessEnding()` 이후 및 프로세스를 종료하기 전에 이 메서드를 호출하는 것이 가장 좋습니다. Anywhere 플릿을 사용 중이고 게임 세션 이후마다 서버 프로세스를 종료하지 않는 경우, `Destroy()` 및 `InitSDK()`를 차례로 호출하여 Amazon GameLift Servers가 게임 세션을 `ProcessReady()`로 호스팅할 준비가 되었음을 알리기 전에 다시 초기화합니다.

### 구문
<a name="integration-server-sdk5-csharp-destroy-syntax"></a>

```
GenericOutcome Destroy()
```

### 반환 값
<a name="integration-server-sdk5-csharp-destroy-return"></a>

성공 또는 실패와 함께 오류 메시지로 구성된 일반적인 결과를 반환합니다.

### 예제
<a name="integration-server-sdk5-csharp-destroy-example"></a>

```
// Operations to end game sessions and the server process
GenericOutcome processEndingOutcome = GameLiftServerAPI.ProcessEnding();

// Shut down and destroy the instance of the GameLift Game Server SDK
GenericOutcome destroyOutcome = GameLiftServerAPI.Destroy();

// Exit the process with success or failure
if (processEndingOutcome.Success)
  { 
    Environment.Exit(0); 
  }
else
  {
    Console.WriteLine("ProcessEnding() failed. Error: " + processEndingOutcome.Error.ToString());
    Environment.Exit(-1); 
  }
```