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

# PartyLocalUser::SetCustomContext

> 設定與此本機使用者物件相關聯的選用自訂指標大小內容值。

設定與此本機使用者物件相關聯的選用自訂指標大小內容值。

## 語法

```cpp theme={null}
PartyError SetCustomContext(  
    void* customContext  
)  
```

### 參數

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

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

### 傳回值

PartyError

`c_partyErrorSuccess` (如果設定自訂內容成功)，否則為錯誤碼。可透過 [PartyManager::GetErrorMessage()](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage) 擷取錯誤碼的人類可讀形式。

## 備註

自訂內容通常用作「捷徑」，可簡化存取與本機使用者相關聯的本機遊戲專屬記憶體，而不需要進行對應查閱。可使用 [GetCustomContext()](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getcustomcontext) 方法擷取此值。 <br /><br /> 程式庫會將任何設定的值視為不透明，且只在本機裝置上有效；該值不會透過網路傳輸。

## 需求

**標頭：** Party.h

## 另請參閱

[PartyLocalUser](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/partylocaluser)\
[PartyLocalUser::GetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getcustomcontext)


## Related topics

- [PartyLocalUser::GetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getcustomcontext.md)
- [PartyXblChatUser::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_setcustomcontext.md)
- [PartyEndpoint::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_setcustomcontext.md)
- [PartyNetwork::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_setcustomcontext.md)
- [PartyDevice::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyDevice/methods/partydevice_setcustomcontext.md)
