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

# XblMatchmakingCreateMatchTicketAsync

> XblMatchmakingCreateMatchTicketAsync

# XblMatchmakingCreateMatchTicketAsync

將配對要求傳送至伺服器，並傳回具有票證識別碼的配對票證。完成時呼叫 XblMatchmakingCreateMatchTicketResult 以取得結果。

## 語法

```cpp theme={null}
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](/zh-TW/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

本機使用者的 XBOX Live 內容。

*ticketSessionReference*   \_In\_\
類型：[XblMultiplayerSessionReference](/zh-TW/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference)

要用於配對的多人遊戲工作階段。

*matchmakingServiceConfigurationId*   \_In\_\
類型：char\*

配對的服務設定識別碼。

*hopperName*   \_In\_\
類型：char\*

hopper 的名稱。

*ticketTimeout*   \_In\_\
類型：uint64\_t

等待玩家加入工作階段的最長時間。

*preserveSession*   \_In\_\
類型：[XblPreserveSessionMode](/zh-TW/reference/live/xsapi-c/matchmaking_c/enums/xblpreservesessionmode)

表示是否應保留工作階段。

*ticketAttributesJson*   \_In\_\
類型：char\*

工作階段的票證屬性。(選用)

*asyncBlock*   \_In\_\
類型：XAsyncBlock\*

此作業的 AsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的 HRESULT 傳回碼。

## 備註

配對票證物件包含伺服器傳回的資訊 (例如票證識別碼和等候時間)，也包含票證資料物件中遊戲指定資料的複本。

## REST 呼叫

呼叫 V103 POST /serviceconfigs/{serviceConfigId}/hoppers/{hopperName}

## 需求

**標頭：** matchmaking\_c.h

**程式庫：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另請參閱

[matchmaking\_c](/zh-TW/reference/live/xsapi-c/matchmaking_c/matchmaking_c_members)


## Related topics

- [XblMatchmakingCreateMatchTicketAsync](/reference/live/xsapi-c/matchmaking_c/functions/xblmatchmakingcreatematchticketasync.md)
- [XblMatchmakingCreateMatchTicketResult](/reference/live/xsapi-c/matchmaking_c/functions/xblmatchmakingcreatematchticketresult.md)
