> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PlayFabMultiplayer.PlayFabMultiplayerServer.JoinLobbyAsServer method

> This document describes the 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](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange.md) with the `LobbyUpdatedStateChange.serverUpdate` member appropriately populated, and a [OnJoinLobbyAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md) with the `OnJoinLobbyAsServerCompleted.result` field set to [Success](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success.md).

Upon a failed completion, the title is provided a [OnJoinLobbyAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md) 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](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange.md) with the `LobbyUpdatedStateChange.serverUpdate` member appropriately populated, and a [OnJoinLobbyAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md) with the `OnJoinLobbyAsServerCompleted.result` field set to [Success](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success.md).

Upon a failed completion, the title is provided a [OnJoinLobbyAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md) 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](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview.md)
* class [LobbyServerJoinConfiguration](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyServerJoinConfiguration/overview.md)
* class [PlayFabMultiplayerServer](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/overview.md)
* namespace [PlayFab.Multiplayer](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference.md)


## Related topics

- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnJoinLobbyAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnJoinLobbyAsServerCompleted.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyLeaveAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyLeaveAsServerCompleted.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyClaimCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyDeleteCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyDeleteCompleted.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyPostUpdateAsServerCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyPostUpdateAsServerCompleted.md)
