XblMatchmakingCreateMatchTicketAsync

向服务器发送匹配请求,并返回含票证 ID 的匹配票证。完成后,调用 XblMatchmakingCreateMatchTicketResult 获取结果。

语法

HRESULT XblMatchmakingCreateMatchTicketAsync(  
         XblContextHandle xboxLiveContext,  
         XblMultiplayerSessionReference ticketSessionReference,  
         const char* matchmakingServiceConfigurationId,  
         const char* hopperName,  
         const uint64_t ticketTimeout,  
         XblPreserveSessionMode preserveSession,  
         const char* ticketAttributesJson,  
         XAsyncBlock* asyncBlock  
)  

参数

xboxLiveContext _In_
类型:XblContextHandle

本地用户的 Xbox Live 上下文。

ticketSessionReference _In_
类型:XblMultiplayerSessionReference

用于匹配的多人游戏会话。

matchmakingServiceConfigurationId _In_
类型:char*

匹配的服务配置 ID。

hopperName _In_
类型:char*

漏斗的名称。

ticketTimeout _In_
类型:uint64_t

等待玩家加入会话的最长时间。

preserveSession _In_
类型:XblPreserveSessionMode

表示是否应该保留会话。

ticketAttributesJson _In_
类型:char*

会话的票证属性。 (可选)

asyncBlock _In_
类型:XAsyncBlock*

此操作的 AsyncBlock。

返回值

类型:HRESULT

此 API 操作的 HRESULT 返回代码。

备注

匹配票证对象包含服务器返回的信息,例如票证 ID 和等待时间,还包含票证数据对象中游戏指定数据的副本。

REST 调用

Calls V103 POST /serviceconfigs/{serviceConfigId}/hoppers/{hopperName}

要求

头文件:matchmaking_c.h

库:Microsoft.Xbox.Services.141.GSDK.C.lib

另请参阅

matchmaking_c