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

# PFLobbyServerDeleteLobby

> PFLobbyServerDeleteLobby reference for deleting a server-owned PlayFab lobby on behalf of the game_server entity through the PlayFab Multiplayer C++ SDK.

Delete a lobby on behalf of the game\_server entity that owns the lobby.

## Syntax

```cpp theme={null}
HRESULT PFLobbyServerDeleteLobby(  
    PFLobbyHandle lobby,  
    void* asyncContext  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

TBD

**`asyncContext`**   void\*\
*optional*

TBD

### 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()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

To use this feature, you must define PFMULTIPLAYER\_INCLUDE\_SERVER\_APIS before including PFLobby.h. <br /><br /> This method queues an asynchronous operation to delete the lobby on behalf of the game\_server entity. On completion, a [PFLobbyServerDeleteLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyserverdeletelobbycompletedstatechange) will be provided indicating that the operation has completed.   <br /><br /> This method does not guarantee the delete will succeed. The operation may fail due to networking or service errors. If the delete attempt fails but is retriable, the library will continue to retry the delete operation. Once the operation can no longer be retried, the operation will complete and a [PFLobbyServerDeleteLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyserverdeletelobbycompletedstatechange) will be provided.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)
