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

# PFAccountManagementServerDeletePlayerAsync

> 從遊戲中移除使用者的玩家帳戶，並刪除所有相關聯的資料

從遊戲中移除使用者的玩家帳戶，並刪除所有相關聯的資料

## 語法

```cpp theme={null}
HRESULT PFAccountManagementServerDeletePlayerAsync(  
    PFEntityHandle titleEntityHandle,  
    const PFAccountManagementDeletePlayerRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`titleEntityHandle`**   PFEntityHandle

使用 PFAuthenticationGetEntityWithSecretKeyAsync 取得之遊戲 Entity 的 PFEntityHandle。

**`request`**   [PFAccountManagementDeletePlayerRequest\*](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementdeleteplayerrequest)

已填入的要求物件。

**`async`**   XAsyncBlock\*<br />*Inout*

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 適用於 Win32、Linux 和 macOS。刪除與玩家相關聯的所有資料，包括統計資料、自訂資料、物品欄、購買項目、虛擬貨幣餘額、角色及共用群組成員資格。將玩家從所有排行榜和玩家搜尋索引中移除。不會刪除與玩家相關聯的 PlayStream 事件記錄。不會刪除在遊戲中建立該玩家的發行者使用者帳戶，也不會刪除使用者名稱、密碼、電子郵件地址、帳戶連結或好友清單等相關聯資料。請注意，此 API 會將玩家排入刪除佇列並立即傳回。可能需要幾分鐘或更久，所有玩家資料才會完全刪除。在玩家資料完全刪除之前，嘗試在同一遊戲中以相同的使用者帳戶重新建立玩家將會失敗，並出現 'AccountDeleted' 錯誤。此 API 必須在 Game Manager 網站中以選項方式啟用才能使用。預設為停用。呼叫 XAsyncGetStatus 以取得作業的狀態。如果服務呼叫失敗，非同步結果將為 E\_PF\_API\_NOT\_ENABLED\_FOR\_GAME\_SERVER\_ACCESS 或任何全域 PlayFab 服務錯誤。如需錯誤處理的詳細資訊，請參閱文件頁面「Handling PlayFab Errors」。

## 需求

**標頭：** PFAccountManagement.h

## 另請參閱

[PFAccountManagement 成員](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [服務 C API 概觀 - PFAccountManagement.h](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFPlayerDataManagementServerDeletePlayerCustomPropertiesAsync](/zh-TW/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementserverdeleteplayercustompropertiesasync.md)
- [PFPlayerDataManagementServerDeletePlayerCustomPropertiesGetResult](/zh-TW/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementserverdeleteplayercustompropertiesgetresult.md)
- [PFPlayerDataManagementServerGetPlayerCustomPropertyAsync](/zh-TW/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementservergetplayercustompropertyasync.md)
- [PFPlayerDataManagementServerListPlayerCustomPropertiesAsync](/zh-TW/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementserverlistplayercustompropertiesasync.md)
