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

# ClaimServerLobby

> ClaimServerLobby

# PlayFabMultiplayer.PlayFabMultiplayerServer.ClaimServerLobby

## Method (1 of 2)

Claim ownership of a pre-existing server lobby.

```csharp theme={null}
public static Lobby ClaimServerLobby(PFEntityKey server, string lobbyId)
```

| parameter | description                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------ |
| server    | The PlayFab Entity Key of the game server creating the lobby. It's entity type must be "game\_server". |
| lobbyId   | The ID of the Lobby to claim.                                                                          |

## 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 [`OnServerLobbyClaimCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted) with the `OnServerLobbyClaimCompleted.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 [`OnServerLobbyClaimCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted) with the with the `OnServerLobbyClaimCompleted.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)

Claim ownership of a pre-existing server lobby.

```csharp theme={null}
public static Lobby ClaimServerLobby(PlayFabAuthenticationContext server, string lobbyId)
```

| parameter | description                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------ |
| server    | The PlayFab Entity Key of the game server creating the lobby. It's entity type must be "game\_server". |
| lobbyId   | The ID of the Lobby to claim.                                                                          |

## 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 [`OnServerLobbyClaimCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted) with the `OnServerLobbyClaimCompleted.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 [`OnServerLobbyClaimCompleted`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted) with the with the `OnServerLobbyClaimCompleted.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](/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 [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.OnServerLobbyClaimCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted.md)
- [PFLobbyClaimServerLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyclaimserverlobbycompletedstatechange.md)
- [PlayFabMultiplayerServer class](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/overview.md)
- [PFMultiplayerClaimServerLobby](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerclaimserverlobby.md)
- [CreateAndClaimServerLobby](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/CreateAndClaimServerLobby.md)
