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

# PlayFabMultiplayer.JoinLobby

> PlayFabMultiplayer.JoinLobby

## Method (1 of 2)

Join a lobby as the local PlayFab entity.

```csharp theme={null}
public static Lobby JoinLobby(PFEntityKey newMember, string connectionString, 
    IDictionary<string, string> memberKeyValuePairs)
```

| parameter           | description                                                          |
| ------------------- | -------------------------------------------------------------------- |
| newMember           | The local entity joining the lobby.                                  |
| connectionString    | The connection string used by the entity to join the lobby.          |
| memberKeyValuePairs | The number of initial member properties for the joiner of the lobby. |

## Return Value (1 of 2)

Output lobby object which can be used to queue operations for immediate execution of this operation.

## Remarks (1 of 2)

This is an asynchronous operation. Upon successful completion, the title will be provided a [`OnLobbyMemberAdded`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyMemberAdded) followed by a [`OnLobbyUpdated`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyUpdated) and [`OnLobbyJoinCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted) with the `OnLobbyJoinCompleted.result` field set to [`Success`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success). Upon a failed completion, the title will be provided a [`OnLobbyJoinCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted) with the `result` field set to a failure.

***

## Method (2 of 2)

Join a lobby as the local PlayFab entity.

```csharp theme={null}
public static Lobby JoinLobby(PlayFabAuthenticationContext newMember, string connectionString, 
    IDictionary<string, string> memberKeyValuePairs)
```

| parameter           | description                                                          |
| ------------------- | -------------------------------------------------------------------- |
| newMember           | The local entity joining the lobby.                                  |
| connectionString    | The connection string used by the entity to join the lobby.          |
| memberKeyValuePairs | The number of initial member properties for the joiner of the lobby. |

## Return Value (2 of 2)

Output lobby object which can be used to queue operations for immediate execution of this operation.

## Remarks (2 of 2)

This is an asynchronous operation. Upon successful completion, the title will be provided a [`OnLobbyMemberAdded`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyMemberAdded) followed by a [`OnLobbyUpdated`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyUpdated) and [`OnLobbyJoinCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted) with the `OnLobbyJoinCompleted.result` field set to [`Success`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success). Upon a failed completion, the title will be provided a [`OnLobbyJoinCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted) with the `result` field set to a failure.

## See Also

* class [Lobby](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview)
* class [PFEntityKey](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PFEntityKey/overview)
* class [PlayFabMultiplayer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/overview)
* namespace [PlayFab.Multiplayer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference)


## Related topics

- [PlayFabMultiplayerServer.JoinLobbyAsServer method](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/JoinLobbyAsServer.md)
- [PlayFabMultiplayer.OnLobbyJoinCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinCompleted.md)
- [PlayFabMultiplayer class](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/overview.md)
- [PlayFabMultiplayer.JoinArrangedLobby](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/JoinArrangedLobby.md)
- [PlayFabMultiplayer.OnLobbyJoinArrangedLobbyCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinArrangedLobbyCompleted.md)
