Editar

Compartir a través de


PFMultiplayerJoinMatchmakingTicketFromId

Joins one or more multiple local users to a matchmaking ticket using a ticket ID and queue name.

Syntax

HRESULT PFMultiplayerJoinMatchmakingTicketFromId(  
    PFMultiplayerHandle handle,  
    uint32_t localUserCount,  
    const PFEntityKey* localUsers,  
    const char* localUserAttributes,  
    const char* ticketId,  
    const char* queueName,  
    void* asyncContext,  
    PFMatchmakingTicketHandle* ticket  
)  

Parameters

handle   PFMultiplayerHandle

The handle of the PFMultiplayer API instance.

localUserCount   uint32_t

The count of local users to join the ticket.

localUsers   PFEntityKey*
input array of size localUserCount

The array of local users to join to the ticket.

localUserAttributes   char*
input array of size localUserCount

The array of local user attribute strings. There should be one attribute string for each local user. Each attribute string should either be an empty string or a serialized JSON object. For example, {"player_color":"blue","player_role":"tank"}.

ticketId   char*
is null-terminated

The ID of the ticket to join.

queueName   char*
is null-terminated

The queue to which the ticket belongs.

asyncContext   void*
optional

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

ticket   PFMatchmakingTicketHandle*
library-allocated output

The resulting ticket object.

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

The library automatically, and asynchronously, submits all specified local users to join the ticket on the matchmaking service. Each time the ticket status changes, a PFMatchmakingTicketStatusChangedStateChange is provided. The ticket status can be queried at any time via PFMatchmakingTicketGetStatus(). The ticket immediately starts in the PFMatchmakingTicketStatus::Joining state.

When the ticket completes, a PFMatchmakingTicketStatusChangedStateChange is provided. At that point, a match was found or the ticket stopped due to failure. On success, the match that was found can be queried via PFMatchmakingTicketGetMatch().

If ticket creation fails because there are already too many tickets for the specified users, the transparently cancels those outstanding tickets and then retries ticket creation.

Requirements

Header: PFMatchmaking.h

See also

PFMatchmaking members