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

# ClaimServerLobby

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

- [PFLobbyClaimServerLobbyCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyclaimserverlobbycompletedstatechange.md)
- [PlayFabMultiplayer.PlayFabMultiplayerServer.OnServerLobbyClaimCompleted](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/OnServerLobbyClaimCompleted.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)
- [PFMultiplayerClaimServerLobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerclaimserverlobby.md)
- [CreateAndClaimServerLobby](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/CreateAndClaimServerLobby.md)
