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

# PFLobbyJoinLobbyAsServerCompletedStateChange

> Details of the JoinLobbyAsServerCompleted PlayFab Multiplayer state change, raised when a game server finishes joining a client-owned lobby.

Information specific to the *JoinLobbyAsServerCompleted* type of state change.

## Syntax

```cpp theme={null}
struct PFLobbyJoinLobbyAsServerCompletedStateChange : PFLobbyStateChange {  
    HRESULT result;  
    PFEntityKey newServer;  
    void* asyncContext;  
    PFLobbyHandle lobby;  
}  
```

### Members

**`result`**   HRESULT

Indicates the result of the PFMultiplayerJoinLobbyAsServer() operation.

The human-readable form of this result can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

**`newServer`**   [PFEntityKey](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The server entity - which is joining the lobby - provided to the call associated with this state change.

**`asyncContext`**   void\*

The async context provided to the call associated with this state change.

**`lobby`**   PFLobbyHandle\
*must not be null*

The lobby that was joined.

## Remarks

To use this feature, you must define PFMULTIPLAYER\_INCLUDE\_SERVER\_APIS before including PFLobby.h.

## Requirements

**Header:** PFLobby.h

## See also

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


## Related topics

- [PFMultiplayerJoinLobbyAsServer](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerjoinlobbyasserver.md)
- [PFLobbyGetLobbyId](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetlobbyid.md)
- [PFLobbyStateChangeType](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbystatechangetype.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [PFLobbyJoinLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyjoinlobbycompletedstatechange.md)
