> ## 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.

# 읽기 전용 플레이어 데이터 설정 방법

> 서버 API에서 읽기 전용 PlayFab 플레이어 데이터를 작성하여 클라이언트가 이를 수정할 수 없이 신뢰할 수 있는 진행도 값을 읽을 수 있도록 합니다.

읽기 전용 KVP를 설정하려면 서버 프로세스에서 서버 API [UpdateUserReadOnlyData](xref:titleid.playfabapi.com.server.playerdatamanagement.updateuserreadonlydata) 메서드를 호출해야 합니다. 이 데이터는 서버가 수정할 수 있지만 클라이언트는 읽기만 가능합니다.

이 문서의 C# 샘플은 Unity SDK용으로 작성되었습니다. Unity SDK는 이벤트 기반 모델을 사용하여 비동기 작업을 처리합니다. C# SDK를 사용하여 샘플 코드를 실행하려면 async Task 모델을 사용하도록 코드를 수정해야 합니다. 수정해야 하는 메서드는 시그니처의 메서드 이름 끝에 Async가 추가되어 있습니다. 예를 들어, Unity SDK의 SetObject는 C# SDK에서 SetObjectAsync가 됩니다. 자세한 내용은 [async 및 await를 사용한 비동기 프로그래밍](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/)을 참조하세요.

## C# 코드 예제

다음 **C#** 코드 예제는 PlayFab 서버 API를 사용하여 `Father`라는 키에 `Fred` 값, `Mother`에 `Alice` 값, `Sister`에 `Lucy` 값, `Brother`에 `Doug` 값을 가진 KVP를 생성(또는 KVP가 이미 존재하는 경우 업데이트)합니다.

```csharp theme={null}
public void UpdateUserReadOnlyData() {
    PlayFabServerAPI.UpdateUserReadOnlyData(new UpdateUserDataRequest() {
        PlayFabId = "user PlayFabId here - obtained from any successful LoginResult",
        Data = new Dictionary<string, string>() {
            {"Father", "Fred"},
            {"Mother", "Alice"},
            {"Sister", "Lucy"},
            {"Brother", "Doug"}
        },
        Permission = UserDataPermission.Public
    },
    result => Debug.Log("Set read-only user data successful"),
    error => {
        Debug.Log("Got error updating read-only user data:");
        Debug.Log(error.GenerateErrorReport());
    });
}
```

## 참고 자료

[읽기 전용 플레이어 데이터 가져오기 방법](/services/playfab/player-progression/player-data/how-to-get-read-only-player-data)


## Related topics

- [읽기 전용 플레이어 데이터 가져오기 방법](/ko/services/playfab/player-progression/player-data/how-to-get-read-only-player-data.md)
- [플레이어 데이터 빠른 시작](/ko/services/playfab/player-progression/player-data/quickstart.md)
- [CloudScript를 통해 읽기 전용 또는 내부 플레이어 데이터 수정](/ko/services/playfab/player-progression/player-data/how-to-modify-read-only-internal-player-data.md)
- [내부 플레이어 데이터 설정 방법](/ko/services/playfab/player-progression/player-data/how-to-set-internal-player-data.md)
- [내부 플레이어 데이터를 가져오는 방법](/ko/services/playfab/player-progression/player-data/how-to-get-internal-player-data.md)
