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

# XGameStreamingRegisterClientPropertiesChanged

> XGameStreamingRegisterClientPropertiesChanged

# XGameStreamingRegisterClientPropertiesChanged

스트리밍 클라이언트 장치의 속성이 변경될 때마다 호출될 콜백을 등록합니다.

<Note>등록 시, 콜백은 클라이언트 장치의 현재 클라이언트 속성에 대해 호출됩니다.</Note>

## 구문

```cpp theme={null}
HRESULT XGameStreamingRegisterClientPropertiesChanged(  
         XGameStreamingClientId client,  
         XTaskQueueHandle queue,  
         void* context,  
         XGameStreamingClientPropertiesChangedCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  
```

### 매개 변수

*client*   \_In\_\
형식: XGameStreamingClientId

콜백을 등록할 게임 스트리밍 클라이언트의 ID입니다.

*queue*   \_In\_opt\_\
형식: XTaskQueueHandle

변경 콜백을 배치할 비동기 큐에 대한 핸들입니다.

*context*   \_In\_opt\_\
형식: void\*

콜백 함수에 전달될 컨텍스트에 대한 선택적 포인터입니다.

*callback*   \_In\_\
형식: [XGameStreamingClientPropertiesChangedCallback\*](/reference/system/xgamestreaming/functions/xgamestreamingclientpropertieschangedcallback)

클라이언트의 속성이 변경될 때 호출될 콜백 함수입니다.

*token*   \_Out\_\
형식: XTaskQueueRegistrationToken\*

이벤트 등록을 해제하는 데 사용할 수 있는 등록 토큰에 대한 포인터입니다.

### 반환 값

형식: HRESULT

성공하면 **S\_OK**를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.

#### 잠재적 오류

| 오류 코드                                    | 오류 값       | 오류 원인                                                                                                                                                    |
| ---------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTREAMING\_NOT\_INITIALIZED       | 0x89245400 | XGameStreaming 런타임이 초기화되지 않았습니다. 다른 API를 호출하기 전에 [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize)를 호출하세요. |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED | 0x89245401 | 지정한 클라이언트가 연결되어 있지 않습니다.                                                                                                                                 |

오류 코드 목록은 [오류 코드](/reference/errorcodes)를 참조하세요.

## 설명

<Note>이 함수는 시간에 민감한 스레드에서 호출하기에 안전하지 않습니다. 자세한 내용은 [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)를 참조하세요.</Note>

이 API를 사용하면 스트림 물리적 크기와 같은 [XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty)가 변경될 때마다 게임이 `XGameStreamingClientPropertiesChangedCallback`을 받을 수 있습니다.

등록 시 콜백은 해당하는 모든 `XGameStreamingClientProperty`에 대해 호출되므로 현재 속성 세부 정보를 쿼리할 수 있습니다.

스트리밍 클라이언트 장치가 연결 해제될 때는 [XGameStreamingUnregisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged)를 사용하여 콜백 등록을 해제하세요.

## 예제

```cpp theme={null}
    // On client connection maintain a list of clients and do per client initialization
    void GameStreamingClientManager::OnClientConnected(XGameStreamingClientId client)
    {
        StreamingClient connectedClient;
        connectedClient.clientId = client;
        connectedClient.propertiesChangedToken = token;

        // Do per-client initialization
        XGameStreamingClientPropertiesChangedRegistrationToken token = {0};
        XGameStreamingRegisterClientPropertiesChanged(
            client, m_taskQueue, this, &OnClientPropertiesChanged, &token);        

        connectedClient.propertiesChangedToken = token;
        m_streamingClients.push_back(connectedClient);
    }

    // Some of the properties of our streaming client have changed, react to any of the changes which apply to our game
    void GameStreamingClientManager::OnClientPropertiesChanged(
        void* context,
        XGameStreamingClientId client,
        uint32_t updatedPropertiesCount,
        XGameStreamingClientProperty* updatedProperties)
    {
        GameStreamingClientManager* gsClientManager = reinterpret_cast<GameStreamingClientManager*>(context);

        for (uint32_t i = 0; i < updatedPropertiesCount; ++i)
        {
            switch (updatedProperties[i])
            {
                // The client now has a new physical size of the game stream - update our list of stream
                // sizes to reflect this.
            case XGameStreamingClientProperty::StreamPhysicalDimensions:
                gsClientManager->UpdateClientPhysicalDimensions(client); 
                break;

            case XGameStreamingClientProperty::TouchInputEnabled: 
                gsClientManager->UpdateClientTouchEnabled(client); 
                break;

            default:
                // A characteristic we are not tracking - do nothing
                break;
            }
        }
    }

```

## 요구 사항

**헤더:** xgamestreaming.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 개념 문서

* [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 함께 보기

[XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty)\
[XGameStreamingClientPropertiesChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingclientpropertieschangedcallback)\
[XGameStreamingUnregisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreamingUnregisterClientPropertiesChanged](/ko/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged.md)
- [XGameStreamingClientPropertiesChangedCallback](/ko/reference/system/xgamestreaming/functions/xgamestreamingclientpropertieschangedcallback.md)
- [XGameStreamingClientProperty](/ko/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [XGameStreamingIsTouchInputEnabled](/ko/reference/system/xgamestreaming/functions/xgamestreamingistouchinputenabled.md)
- [XGameStreamingGetSessionId](/ko/reference/system/xgamestreaming/functions/xgamestreaminggetsessionid.md)
