> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

本機使用者的 XBOX Live 內容。

*ticketSessionReference*   \_In\_\
類型：[XblMultiplayerSessionReference](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference.md)

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

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

配對的服務設定識別碼。

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

hopper 的名稱。

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

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

*preserveSession*   \_In\_\
類型：[XblPreserveSessionMode](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/matchmaking_c/enums/xblpreservesessionmode.md)

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

*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](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/matchmaking_c/matchmaking_c_members.md)


## Related topics

- [XblMatchmakingCreateMatchTicketResult](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/matchmaking_c/functions/xblmatchmakingcreatematchticketresult.md)
- [matchmaking_c](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/matchmaking_c/matchmaking_c_members.md)
- [從 MPSD 移至 PlayFab Multiplayer 與 MPA](https://docs.xbox.com/zh-TW/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [使用 SmartMatch 配對](https://docs.xbox.com/zh-TW/services/xbox-services/multiplayer/matchmaking/concepts/live-matchmaking-how-tos.md)
- [在 Partner Center 中設定配對](https://docs.xbox.com/zh-TW/services/xbox-services/multiplayer/matchmaking/config/live-matchmaking-config.md)
