Editar

Partilhar via


PFLobbyPostUpdate

Post an update to the lobby as a player.

Syntax

HRESULT PFLobbyPostUpdate(  
    PFLobbyHandle lobby,  
    const PFEntityKey* localUser,  
    const PFLobbyDataUpdate* lobbyUpdate,  
    const PFLobbyMemberDataUpdate* memberUpdate,  
    void* asyncContext  
)  

Parameters

lobby   PFLobbyHandle

The handle of the lobby.

localUser   PFEntityKey*

The local user posting the update.

lobbyUpdate   PFLobbyDataUpdate*
optional

An optional update to apply to the shared portion of the lobby on behalf of localUser. If this is not provided, memberUpdate must be provided.

memberUpdate   PFLobbyMemberDataUpdate*
optional

An optional update to apply to the portion of the lobby owned by localUser. If this parameter is not provided, lobbyUpdate must be provided.

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

This is an asynchronous operation. Upon successful completion, the title will be provided a PFLobbyPostUpdateCompletedStateChange with the PFLobbyPostUpdateCompletedStateChange::result field set to S_OK. Upon a failed completion, the title will be provided a PFLobbyPostUpdateCompletedStateChange with the PFLobbyPostUpdateCompletedStateChange::result field set to a failure. If applying the update would change the state of the lobby, the title will be provided a PFLobbyUpdatedStateChange sometime afterwards.

This operation completing successfully only indicates that the Lobby service has accepted the update. The title's local view of the Lobby state will not reflect this update until a PFLobbyUpdatedStateChange is provided to the title with the updated state.

The lobbyUpdate contains fields that can only be modified by the owner of the lobby. This method will return an error if one of those fields is specified and localUser is not the owner of the lobby.

If both a lobbyUpdate and memberUpdate are supplied to this method on behalf of a single entity, both updates will happen atomically.

Requirements

Header: PFLobby.h

See also

PFLobby members
PFLobbyServerPostUpdate