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

# XGameStreamingGetServerLocationName

> XGameStreamingGetServerLocationName

# XGameStreamingGetServerLocationName

ストリーミング サーバーのデータ センターの場所の名前を取得します。

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetServerLocationName(
         size_t serverLocationNameSize,
         char* serverLocationName
)
```

### Parameters

*serverLocationNameSize*   \_In\_\
型: size\_t

返すデータ センターの場所名の最大サイズ。
`serverLocationNameSize` は [XGameStreamingGetServerLocationNameSize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md) を呼び出して取得してください。

*serverLocationName*   \_Out\_writes\_z\_(serverLocationNameSize)\
型: char\*

ストリーミング XBOX サーバーをホストするデータ センターがある Azure リージョンの名前。

### Return value

型: HRESULT

成功した場合は **S\_OK** を返します。それ以外の場合はエラー コードを返します。

**想定されるエラー**

| エラー コード | エラー値 | エラーの理由 |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming ランタイムが初期化されていません。他の API を呼び出す前に [XGameStreamingInitialize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminginitialize.md) を呼び出してください。 |
| E\_NOT\_SUFFICIENT\_BUFFER | 0x7A | *serverLocationSize* が、サーバー ロケーションの完全な名前 (および終端の null 文字) を格納するのに十分な大きさではありません。 |
| E\_GAMESTREAMING\_NO\_DATACENTER | 0x89245403 | 現在のマシンはデータ センターで動作していません。 |

エラー コードの一覧については、[Error Codes](https://docs.xbox.com/ja-jp/reference/errorcodes.md) を参照してください。

## Remarks

この関数を呼び出す前に、[XGameStreamingGetServerLocationNameSize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md) を呼び出してサーバー ロケーション名のサイズを取得し、バッファーを割り当てることができます。

ゲームが Azure PlayFab Multiplayer Servers でホストされているゲーム サーバーに接続する場合や、ゲーム サーバーとのレイテンシを最小限に抑えたい場合に、Azure リージョンを活用できます。

`E_GAMESTREAMING_NO_DATACENTER` エラーは、プレイヤーがコンソール ストリーミングを使用して自宅の XBOX からゲームをストリーミングしているときに発生することがあります。このエラーは、XBOX Developer Kit でオーバーライド値が設定されていない場合にも発生することがあります。

XBOX Developer Kit では、テスト中に返される `serverLocationName` を **Developer Home** の **Streaming** タブで設定できます。

## Requirements

**ヘッダー:** xgamestreaming.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## See also

[XGameStreaming](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)\
[XGameStreamingGetServerLocationNameSize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md)


## Related topics

- [XGameStreamingGetServerLocationNameSize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md)
- [XGameStreaming (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XBOX Game Streaming の開発のベスト プラクティス](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [Unity プロジェクトでの GDK API 用 C# ラッパーの使用](https://docs.xbox.com/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingGetTouchBundleVersionNameSize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize.md)
