> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tournaments & Leaderboards quickstart

> Quickstart for legacy PlayFab tournaments: create a HighScore statistic and leaderboard in Game Manager, then submit player scores from the client with C#.

# 토너먼트 및 리더보드 빠른 시작

이 빠른 시작에서는 플레이어의 최고 점수를 추적하는 통계를 만드는 방법과 최고 점수 리더보드를 가져오는 방법을 설명합니다. 이를 글로벌 리더보드로 사용하거나, [재설정 가능한 통계](/services/playfab/community/leaderboards/tournaments-leaderboards/using-resettable-statistics-and-leaderboards)와 함께 사용하여 특정 이벤트나 토너먼트를 위해 재설정할 수 있습니다.

## 필수 구성 요소

플레이어가 이미 PlayFab에 로그인되어 있습니다.

## 1단계 - 통계 및 연결된 리더보드 만들기

Game Manager에서:

* 왼쪽 메뉴에서 **Leaderboards**로 이동합니다.
* **NEW LEADERBOARD**를 선택합니다.
* **Statistic name** 필드에 **HighScore**라는 **Leaderboard**를 추가합니다.
* 제공된 드롭다운 메뉴를 사용해 **Reset frequency** 필드를 **Manually**로 설정합니다.
* **Aggregation method** 필드로 이동하여 드롭다운 메뉴에서 **Maximum**(항상 가장 높은 값 사용)을 선택합니다.

## 2단계 - 플레이어의 최고 점수로 통계 업데이트

클라이언트에서 [UpdatePlayerStatistics](xref:titleid.playfabapi.com.client.playerdatamanagement.updateplayerstatistics)를 사용하려면 먼저 **API Features**에서 활성화해야 합니다.

1. 타이틀의 Settings 메뉴에서 **Title settings**를 선택합니다.
2. **API Features** 탭을 선택합니다.
3. **Allow client to post player statistics** 체크박스를 선택합니다.
   참고: 일반적으로 이 옵션은 라이브 게임에서는 사용하지 않는 것이 좋습니다. 클라이언트에게 제출되는 값에 대한 권한을 부여하기 때문입니다. 이는 플레이어가 통계를 부정하게 조작할 우려가 없는 경우에만 유효합니다. 통계가 안전해야 한다면 Cloud Script 또는 사용자 지정 게임 서버와 같은 서버 권한 작업을 통해서만 업데이트해야 합니다.
4. 화면 하단의 **SAVE**를 선택합니다.

<img src="https://mintcdn.com/microsoft-4404708b/5IpvKlT-jmAaVkeY/images/playfab/community/leaderboards/tournaments-leaderboards/tutorials/api-features-allow-client-to-post-player-statistics.png?fit=max&auto=format&n=5IpvKlT-jmAaVkeY&q=85&s=71197d724d092da6b5ff0a4093ad843e" alt="Game Manager - Settings - API Features - Allow client to post player statistics" width="2079" height="1191" data-path="images/playfab/community/leaderboards/tournaments-leaderboards/tutorials/api-features-allow-client-to-post-player-statistics.png" />

### C# 코드 예시 - SubmitScore

이 코드 예시에서는 게임이 끝날 때 호출될 `SubmitScore` 함수를 사용합니다.

```csharp theme={null}

public void SubmitScore(int playerScore) {
    PlayFabClientAPI.UpdatePlayerStatistics(new UpdatePlayerStatisticsRequest {
        Statistics = new List<StatisticUpdate> {
            new StatisticUpdate {
                StatisticName = "HighScore",
                Value = playerScore
            }
        }
    }, result=> OnStatisticsUpdated(result), FailureCallback);
}

private void OnStatisticsUpdated(UpdatePlayerStatisticsResult updateResult) {
    Debug.Log("Successfully submitted high score");
}

private void FailureCallback(PlayFabError error){
    Debug.LogWarning("Something went wrong with your API call. Here's some debug information:");
    Debug.LogError(error.GenerateErrorReport());
}
```

### 3단계 - 최고 점수 리더보드 요청

게임을 플레이한 모든 플레이어의 최고 점수 리더보드를 가져오려면 [GetLeaderboard](xref:titleid.playfabapi.com.client.playerdatamanagement.getleaderboard)를 호출합니다.

### C# 코드 예시 - RequestLeaderboard

이 코드 예시에서는 리더보드를 가져오기 위해 호출되는 `RequestLeaderboard` 함수를 사용하며, 결과를 `DisplayLeaderboard` 함수에 전달합니다. 이 함수는 게임에서 최고 점수를 보여주는 경험을 채우게 됩니다.

```csharp theme={null}
//Get the players with the top 10 high scores in the game
public void RequestLeaderboard() {
    PlayFabClientAPI.GetLeaderboard(new GetLeaderboardRequest {
            StatisticName = "HighScore",
            StartPosition = 0,
            MaxResultsCount = 10
    }, result=> DisplayLeaderboard(result), FailureCallback);
}

private void FailureCallback(PlayFabError error){
    Debug.LogWarning("Something went wrong with your API call. Here's some debug information:");
    Debug.LogError(error.GenerateErrorReport());
}
```


## Related topics

- [Quickstart on leaderboards](/ko/services/playfab/community/leaderboards/quickstart-leaderboards.md)
- [Accessing Archived Tournament results](/ko/services/playfab/community/leaderboards/tournaments-leaderboards/accessing-archived-tournament-results.md)
- [Seasonal leaderboards](/ko/services/playfab/community/leaderboards/seasonal-leaderboards.md)
- [Friends Leaderboards](/ko/services/playfab/community/leaderboards/tournaments-leaderboards/friends-leaderboards.md)
- [Using resettable statistics and leaderboards](/ko/services/playfab/community/leaderboards/tournaments-leaderboards/using-resettable-statistics-and-leaderboards.md)
