Redigera

PFLobbyServerLeaveAsServer

Important

XBOX Docs are now on docs.xbox.com! This page is kept as an archive and is no longer being updated. Visit our documentation on docs.xbox.com for the latest information and updates.

Visit the latest docs on docs.xbox.com

Requests that the server leave the client-owned lobby it's currently in.

Syntax

HRESULT PFLobbyServerLeaveAsServer(  
    PFLobbyHandle lobby,  
    void* asyncContext  
)  

Parameters

lobby   PFLobbyHandle

The handle of the lobby.

asyncContext   void*
optional

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

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().

Remarks

To use this feature, you must define PFMULTIPLAYER_INCLUDE_SERVER_APIS before including PFLobby.h.

This method queues an asynchronous operation to exit the client-owned lobby. On completion, a PFLobbyServerLeaveLobbyAsServerCompletedStateChange is provided indicating that the operation completed.

This operation is restricted to client-owned lobbies that are using connections.

Any server-owned data previously added to the lobby is NOT automatically deleted when the server leaves the lobby. If there's a desire to also delete the serverData, it should be explicitly done by calling PFLobbyServerPostUpdateAsServer() before leaving the lobby.

Requirements

Header: PFLobby.h

See also

PFLobby members