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

# chat_user::xbox_user_id

> chat_user::xbox_user_id

# chat\_user::xbox\_user\_id

傳回此使用者的唯一 XBOX 使用者識別碼。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
_Ret_z_ xbox_user_id(  
)  
```

<a id="parametersSection" />

### 參數

無。

<a id="retvalSection" />

### 傳回值

類型：\_Ret\_z\_

傳回以 null 結尾之字串的指標，該字串代表此使用者的唯一 XBOX 使用者識別碼。

<a id="remarksSection" />

## 備註

此方法會傳回以 null 結尾之字串的指標，該字串代表此 [chat\_user](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user) 物件的唯一 XBOX 使用者識別碼。傳回之字串指標的記憶體在 `chat_user object` 存留期間內都保持有效，也就是直到透過呼叫 [chat\_manager::remove\_user](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user) 方法移除該使用者為止。如需使用應用程式之本機 [chat\_manager](/zh-TW/reference/chat/gamechat2/classes/chat_manager/chat_manager) 執行個體管理使用者的詳細資訊，請參閱[使用 Game Chat 2 C++ API](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2) 中的[將使用者新增至 Game Chat 2](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2#adding_users_to_game_chat_2) 一節。

<a id="requirementsSection" />

## 需求

**標頭：** GameChat2.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[Game Chat 2 簡介](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_user::custom\_user\_context](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context)\
[chat\_user](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [PartyXblManager::CreateRemoteChatUser](/zh-TW/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_createremotechatuser.md)
- [PartyXblChatUser::GetXboxUserId](/zh-TW/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getxboxuserid.md)
- [chat_user::chat_indicator](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_chat_indicator.md)
- [chat_user::local](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function_2.md)
- [chat_user::custom_user_context](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context.md)
