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

# PlayFabMultiplayerServer.JoinLobbyAsServer method

> This document describes the PlayFabMultiplayer.PlayFabMultiplayerServer.JoinLobbyAsServer.

# PlayFabMultiplayer.PlayFabMultiplayerServer.JoinLobbyAsServer

## PlayFabMultiplayer.PlayFabMultiplayerServer.JoinLobbyAsServer method (1 of 2)

Join a client-owned lobby as a server.

```csharp theme={null}
public static Lobby JoinLobbyAsServer(PFEntityKey server, string connectionString, 
    LobbyServerJoinConfiguration configuration)
```

| parameter        | description                                                                                     |
| ---------------- | ----------------------------------------------------------------------------------------------- |
| server           | The PlayFab Entity Key of the server joining the lobby. Its entity type must be "game\_server." |
| connectionString | The connection string used by the server to join the lobby.                                     |
| configuration    | The initial server-owned data to be stored when joining the lobby.                              |

### Return Value (1 of 2)

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

### Remarks (1 of 2)

JoinLobbyAsServer() is an asynchronous operation. Completion of this method's execution isn't necessarily completion of the operation.

Upon successful completion, the title is provided a [LobbyUpdatedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) with the `LobbyUpdatedStateChange.serverUpdate` member appropriately populated, and a [OnJoinLobbyAsServerCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted) with the `OnJoinLobbyAsServerCompleted.result` field set to [Success](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success).

Upon a failed completion, the title is provided a [OnJoinLobbyAsServerCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted) with the `OnJoinLobbyAsServerCompleted.result` field set to a failed error code.

JoinLobbyAsServer() operation is restricted to client-owned lobbies that are using connections.

***

## PlayFabMultiplayer.PlayFabMultiplayerServer.JoinLobbyAsServer method (2 of 2)

Join a client-owned lobby as a server.

```csharp theme={null}
public static Lobby JoinLobbyAsServer(PlayFabAuthenticationContext server, string connectionString, 
    LobbyServerJoinConfiguration configuration)
```

| parameter        | description                                                                                     |
| ---------------- | ----------------------------------------------------------------------------------------------- |
| server           | The PlayFab Entity Key of the server joining the lobby. Its entity type must be "game\_server." |
| connectionString | The connection string used by the server to join the lobby.                                     |
| configuration    | The initial server-owned data to be stored when joining the lobby.                              |

### Return Value (2 of 2)

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

### Remarks (2 of 2)

JoinLobbyAsServer() is an asynchronous operation. Completion of this method's execution isn't necessarily completion of the operation.

Upon successful completion, the title is provided a [LobbyUpdatedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) with the `LobbyUpdatedStateChange.serverUpdate` member appropriately populated, and a [OnJoinLobbyAsServerCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted) with the `OnJoinLobbyAsServerCompleted.result` field set to [Success](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success).

Upon a failed completion, the title is provided a [OnJoinLobbyAsServerCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted) with the `OnJoinLobbyAsServerCompleted.result` field set to a failed error code.

This operation is restricted to client-owned lobbies that are using connections.

## See Also

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


## Related topics

- [PlayFabMultiplayerServer class](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/overview.md)
- [PlayFabMultiplayerServer.OnJoinLobbyAsServerCompleted event](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md)
- [PlayFabMultiplayerServer.OnServerLobbyLeaveAsServerCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyLeaveAsServerCompleted.md)
- [PlayFabMultiplayerServer.OnServerLobbyClaimCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted.md)
- [PlayFabMultiplayerServer.OnServerLobbyDeleteCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyDeleteCompleted.md)
