> ## 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 플레이어 데이터를 설정하여 게임 클라이언트에서 접근할 수 없는 플레이어에 연결된 비공개 키-값 필드를 저장합니다.

내부 플레이어 데이터를 설정하려면 서버 API [UpdateUserInternalData](xref:titleid.playfabapi.com.server.playerdatamanagement.updateuserinternaldata) 메서드를 사용하세요. 이 데이터는 클라이언트가 접근할 수 없는 데이터입니다.

이 문서의 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를 사용하여 `Class`라는 키에 `Fighter` 값을, `Race`라는 키에 `Human` 값을 가진 KVP를 생성(또는 키 값이 이미 존재하는 경우 업데이트)합니다.

```csharp theme={null}
public void UpdateUserInternalData() {
    PlayFabServerAPI.UpdateUserInternalData(new UpdateUserInternalDataRequest() {
        PlayFabId = "user PlayFabId here - obtained from any successful LoginResult",
        Data = new Dictionary<string, string>() {
            {"Class", "Fighter"},
            {"Race", "Human"},
        },
    },
    result => Debug.Log("Set internal user data successful"),
    error => {
        Debug.Log("Got error updating internal user data:");
        Debug.Log(error.GenerateErrorReport());
    });
}
```

## 참고 자료

[내부 플레이어 데이터 가져오기 방법](/services/playfab/player-progression/player-data/how-to-get-internal-player-data)
