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

# XblMultiplayerManagerLobbySessionAddLocalUser

> XblMultiplayerManagerLobbySessionAddLocalUser

# XblMultiplayerManagerLobbySessionAddLocalUser

Joins an XBOX user to the lobby session.

## Syntax

```cpp theme={null}
HRESULT XblMultiplayerManagerLobbySessionAddLocalUser(  
         XblUserHandle user  
)  
```

### Parameters

*user*   \_In\_\
Type: XblUserHandle

The user handle of the user joining the lobby session.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

This function creates a new lobby session and adds the XBOX user specified in *user* to the session. Subsequent users are added to the newly-hosted lobby session as secondary users. You can send invites, set session properties, and access members of the lobby session only after the first local user is added to the lobby session. <br />The result of this function is delivered as a multiplayer event with an event type set to `XblMultiplayerEventType::JoinLobbyCompleted`. You can call [XblMultiplayerManagerDoWork](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerdowork) to retrieve multiplayer events.  <br />When attempting to join a lobby session, the service returns `HTTP_E_STATUS_BAD_REQUEST` if the server is full.  <br />After joining, you can set the properties for the lobby session by calling [XblMultiplayerManagerLobbySessionSetSynchronizedProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionsetsynchronizedproperties), or you can set the host for the lobby session by calling [XblMultiplayerManagerLobbySessionSetSynchronizedHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionsetsynchronizedhost) if the lobby session doesn't already have a host.  <br />You can also send an invite to another user by calling either [XblMultiplayerManagerLobbySessionInviteUsers](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninviteusers) or [XblMultiplayerManagerLobbySessionInviteFriends](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninvitefriends). If you don't need a lobby session, and if you haven't added local users by calling this function, you can instead call [XblMultiplayerManagerJoinGame](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerjoingame) and specify the list of users to join the game.

## Requirements

**Header:** multiplayer\_manager\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[multiplayer\_manager\_c](/reference/live/xsapi-c/multiplayer_manager_c/multiplayer_manager_c_members)\
[XblMultiplayerManagerJoinability](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerjoinability)\
[XblMultiplayerManagerJoinGameFromLobby](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerjoingamefromlobby)


## Related topics

- [XblMultiplayerManagerLobbySessionInviteUsers](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninviteusers.md)
- [XblMultiplayerManagerLobbySessionInviteFriends](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninvitefriends.md)
- [XblMultiplayerManagerLobbySessionRemoveLocalUser](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionremovelocaluser.md)
- [Play multiplayer with friends using Multiplayer Manager](/services/xbox-services/multiplayer/mpm/how-to/live-play-multiplayer-with-friends.md)
- [Multiplayer Manager API overview](/services/xbox-services/multiplayer/mpm/concepts/live-multiplayer-manager-api-overview.md)
