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

# PFMatchmakingTicketSetCustomContext

> 將選用的指標大小自訂內容值附加至 PlayFab Multiplayer 配對票證，以便應用程式稍後擷取。

為此票證物件設定選用的自訂指標大小內容值。

## 語法

```cpp theme={null}
HRESULT PFMatchmakingTicketSetCustomContext(  
    PFMatchmakingTicketHandle ticket,  
    void* customContext  
)  
```

### 參數

**`ticket`**   PFMatchmakingTicketHandle

配對票證的控制代碼。

**`customContext`**   void\*\
*選用*

要與玩家物件一起儲存的任意指標大小值。

### 傳回值

類型：HRESULT

如果設定自訂內容成功，則為 `S_OK`；否則為錯誤碼。可透過 [PFMultiplayerGetErrorMessage()](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage) 擷取錯誤碼的人類可讀形式。

## 備註

自訂內容通常用作「捷徑」，可簡化存取與配對票證相關聯之本機遊戲專屬記憶體，而不需要進行對應查詢。可使用 [PFMatchmakingTicketGetCustomContext()](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetcustomcontext) 方法擷取此值。 <br /><br /> 任何設定的值都會被程式庫視為不透明，且只在本機裝置上有效；它不會透過網路傳輸。

## 需求

**標頭：** PFMatchmaking.h

## 另請參閱

[PFMatchmaking 成員](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members)\
[PFMatchmakingTicketGetCustomContext](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetcustomcontext)


## Related topics

- [PFMatchmakingTicketGetCustomContext](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetcustomcontext.md)
- [PlayFab Multiplayer C++ SDK 版本資訊](/zh-TW/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API 概觀 - PFMatchmaking.h](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)
- [MatchmakingTicket.Context](/zh-TW/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/MatchmakingTicket/Context.md)
- [MatchmakingTicket](/zh-TW/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/MatchmakingTicket/overview.md)
