> ## 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_manager::add_remote_user

> chat_manager::add_remote_user

# chat\_manager::add\_remote\_user

Adds a remote user to the local chat\_manager instance.

## Syntax

```cpp theme={null}
chat_user* add_remote_user(  
    PCWSTR xboxUserId,  
    uint64_t locallyUniqueEndpointIdentifier  
)  
```

### Parameters

*xboxUserId*   \_In\_\
Type: PCWSTR

The XBOX User ID of the remote user to add.

*locallyUniqueEndpointIdentifier*   \_In\_\
Type: uint64\_t

An identifier generated by the title used to refer to the endpoint that the remote user is on. And endpoint is a device, such as an XBOX One or a PC. Each endpoint must have a unique identifier in the local instance of Game Chat; the identifier does not need to be globally unique across the network. Remote users on the same endpoint, such as two users playing on the same XBOX One, must be added with the same endpoint identifier. Game Chat will use this identifier to indicate which endpoints data must be sent to in the game\_chat\_data\_frame structure, and must be used by the title to indicate which endpoint data came from in chat\_manager::process\_incoming\_data().

### Return value

Type: chat\_user\*

## Remarks

The user will be added unconditionally, unless the total number of local and remote users is equal to the max user count that was indicated in chat\_manager::initialize(). <br /><br /> The return value is a pointer to the chat\_user object associated with this user. If the XBOX User ID is invalid, the user's chat\_indicator value will be game\_chat\_user\_chat\_indicator::platform\_restricted.

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager)\
[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)\
[chat\_manager::add\_remote\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_remote_user)\
[chat\_manager::remove\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user)\
[chat\_manager::process\_incoming\_data](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_process_incoming_data)\
[game\_chat\_data\_frame](/reference/chat/gamechat2/structs/game_chat_data_frame)


## Related topics

- [chat_manager::add_local_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_local_user.md)
- [chat_manager::remove_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user.md)
- [chat_manager::get_chat_users](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_chat_users.md)
- [chat_manager::process_incoming_data](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_process_incoming_data.md)
- [game_chat_data_frame](/reference/chat/gamechat2/structs/game_chat_data_frame.md)
