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

# Cloud Aware API 呼び出し

> Cloud Aware API 呼び出し

このトピックを使用して、Cloud Aware タイトルがストリーミング可能かどうかを検出し、XBOX Game Streaming 向けに[ゲームを最適化](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game)できるようにします。

## ストリーミング用にゲームをセットアップする

ゲームの初期化時に、次のコードに示すように `XGameStreamingInitialize` を使用してゲーム ストリーミング コンポーネントをセットアップしていることを確認してください。

```C++ theme={null}

// Initialize the game streaming component
XGameStreamingInitialize();

```

現在接続されているアクティブなストリーミング クライアントがあるかどうかを検出するには、次のコードに示すように `XGameStreamingIsStreaming` を使用します。

```C++ theme={null}
 if (XGameStreamingIsStreaming())
 {
     // The game is currently streaming to at least one device
     // Enable any customizations that might be useful when running from the cloud
 }
```

## 接続状態の管理

アクティブなストリーミング クライアントがある場合、`XGameStreamingIsStreaming` を使用すると、その時点でのクライアントの状況をゲームが把握できます。ストリーミング クライアントがゲームに接続または切断されたときに通知を受け取るには、[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged) を使用します。

## リファレンス API ドキュメント

* [XGameStreaming (API contents)](/reference/system/xgamestreaming/xgamestreaming_members)
  * 関数
    * [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)

## 関連項目

[XGameStreaming (API contents)](/reference/system/xgamestreaming/xgamestreaming_members#connection-state)
[ゲームの最適化](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game)


## Related topics

- [XBOX Game Streaming 向けにゲームを最適化する](/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [CloudScript から Webhook 呼び出しを行う](/ja-jp/services/playfab/live-service-management/service-gateway/automation/cloudscript/making-webhook-calls-from-cloudscript.md)
- [カスタム CloudScript の作成](/ja-jp/services/playfab/live-service-management/service-gateway/automation/cloudscript/writing-custom-cloudscript.md)
- [クイックスタート (Windows) - PlayFab サービスの呼び出し](/ja-jp/services/playfab/sdks/unified-sdk/quickstart-services.md)
- [XSAPI C API で非同期呼び出しを行う](/ja-jp/services/xbox-services/fundamentals/xbox-services-api/live-flatc-async-patterns.md)
