> ## 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::local 函式

> chat_user::local 函式

# chat\_user::local 函式

如果使用者是本機使用者，則傳回與此使用者相關聯之 [chat\_user\_local](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) 物件的指標。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
chat_user_local* local(  
)  
```

<a id="parametersSection" />

### 參數

無。

<a id="retvalSection" />

### 傳回值

類型：[chat\_user\_local](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local)\*

如果使用者是本機使用者，則傳回與此使用者相關聯之 [chat\_user\_local](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) 物件的指標；否則傳回 `NULL`。

<a id="remarksSection" />

## 備註

如果使用者是本機使用者，此方法會傳回與此 [chat\_user](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user) 物件相關聯之 [chat\_user\_local](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) 物件的指標。傳回的指標在相關聯的 `chat_user` 物件存留期間內都保持有效，也就是直到透過呼叫 [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::local](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function-overloads)\
[chat\_user](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [chat_user::local 函式 - 多載](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function-overloads.md)
- [chat_user::local](/zh-TW/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function_2.md)
- [chat_user_local::remote_user_muted](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_remote_user_muted.md)
- [chat_user_local::microphone_muted](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_microphone_muted.md)
- [chat_user_local::send_chat_text](/zh-TW/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_send_chat_text.md)
