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

# PFLobbyGetServer

> PFLobbyGetServer reference for retrieving the game_server entity currently joined to a PlayFab lobby using the PlayFab Multiplayer C++ SDK lobby APIs.

Gets the server entity joined to the lobby.

## Syntax

```cpp theme={null}
HRESULT PFLobbyGetServer(  
    PFLobbyHandle lobby,  
    const PFEntityKey** server  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`server`**   [PFEntityKey\*\*](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk.md)\
*library-allocated output, may return nullptr*

The output lobby server entity.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage.md).

## Remarks

If this lobby isn't a client-owned lobby, no server is returned.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)


## Related topics

- [PlayFab Multiplayer C++ SDK Release Notes](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [PFLobbyGetServerProperty](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetserverproperty.md)
- [PFLobbyGetServerConnectionStatus](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetserverconnectionstatus.md)
- [PFLobbyGetServerPropertyKeys](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetserverpropertykeys.md)
