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

# CreateAndClaimServerLobby

> CreateAndClaimServerLobby

## Method (1 of 2)

Create a new lobby as a game\_server entity.

```csharp theme={null}
public static Lobby CreateAndClaimServerLobby(PFEntityKey server, 
    LobbyCreateConfiguration createConfiguration)
```

| parameter | description |
| - | - |
| server | The PlayFab Entity Key of the game server creating the lobby. It's entity type must be "game\_server". |
| createConfiguration | The initial configuration data used when creating 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 [`OnServerLobbyCreateAndClaimCompleted`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyCreateAndClaimCompleted) with the `OnServerLobbyCreateAndClaimCompleted.result` field set to [`Success`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success). Upon a failed completion, the title will be provided a [`OnServerLobbyCreateAndClaimCompleted`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyCreateAndClaimCompleted) with the with the `OnServerLobbyCreateAndClaimCompleted.result` field set to a failed error code.

While this method is present in the unified, cross-platform header, it is only implemented for Windows and, XBOX. The method will return errors on other platforms.

***

## Method (2 of 2)

Create a new lobby as a game\_server entity.

```csharp theme={null}
public static Lobby CreateAndClaimServerLobby(PlayFabAuthenticationContext server, 
    LobbyCreateConfiguration createConfiguration)
```

| parameter | description |
| - | - |
| server | The PlayFab Entity Key of the game server creating the lobby. It's entity type must be "game\_server". |
| createConfiguration | The initial configuration data used when creating 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 [`OnServerLobbyCreateAndClaimCompleted`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyCreateAndClaimCompleted) with the `OnServerLobbyCreateAndClaimCompleted.result` field set to [`Success`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyError/Success). Upon a failed completion, the title will be provided a [`OnServerLobbyCreateAndClaimCompleted`](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyCreateAndClaimCompleted) with the with the `OnServerLobbyCreateAndClaimCompleted.result` field set to a failed error code.

While this method is present in the unified, cross-platform header, it is only implemented for Windows and, XBOX. The method will return errors on other platforms.

## See Also

* class [Lobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/overview.md)
* class [PFEntityKey](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PFEntityKey/overview.md)
* class [LobbyCreateConfiguration](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbyCreateConfiguration/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

- [PFLobbyCreateAndClaimServerLobbyCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbycreateandclaimserverlobbycompletedstatechange.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyCreateAndClaimCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyCreateAndClaimCompleted.md)
- [Real-time messages for Lobby and Matchmaking APIs](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/overview.md)
- [PFMultiplayerCreateAndClaimServerLobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayercreateandclaimserverlobby.md)
- [ClaimServerLobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/ClaimServerLobby.md)
