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

# 建立遊戲的預設使用者

> 建立遊戲的預設使用者

當遊戲選擇使用簡化使用者模型時，遊戲可以使用 AddDefaultUserSilently 選項呼叫
[XUserAddAsync](/zh-TW/reference/system/xuser/functions/xuseraddasync)，
並保證會收到有效的使用者。取得使用者後，您
可以擷取其玩家代號，並指出由誰控制遊戲。

如果遊戲未使用簡化使用者模型，則無法保證
啟動時會有預設使用者。遊戲可以選擇是否
使用 AddDefaultUserSilently 或 AddDefaultUserAllowingUI 選項呼叫
[XUserAddAsync](/zh-TW/reference/system/xuser/functions/xuseraddasync) 來嘗試尋找該預設使用者。
如果這些呼叫傳回 E\_GAMEUSER\_NO\_DEFAULT\_USER，遊戲將需要提供
初始互動畫面，要求使用者登入。
當使用者選擇參與時 (可能是按一下遊戲提供的
按鈕)，遊戲可以在不使用預設選項的情況下呼叫
[XUserAddAsync](/zh-TW/reference/system/xuser/functions/xuseraddasync)。這會顯示 UI，並讓遊戲
取得遊戲的使用者。

## 另請參閱

[選擇需要預設使用者](/zh-TW/build/core-features/common/user/users-opting-into-simplified-model)
[XUserAddAsync](/zh-TW/reference/system/xuser/functions/xuseraddasync)


## Related topics

- [XBOX 遊戲的 XBOX 需求](/zh-TW/publishing/certification/xbox-requirements.md)
- [XBOX 主機遊戲的認證測試 XBOX 需求](/zh-TW/publishing/certification/console-cert-tested-requirements.md)
- [XR-112 在初始啟用和繼續時建立使用者與控制器](/zh-TW/publishing/certification/xr/xr-112.md)
- [XR-052 使用者狀態與遊戲存檔位置、漫遊及相依性](/zh-TW/publishing/certification/xr/xr-052.md)
- [XR052 使用者狀態與遊戲存檔位置、漫遊及相依性](/zh-TW/publishing/certification/fma/xr-052.md)
