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

# PFAccountManagementServerLinkPSNAccountAsync

> 服务器 API，用于将 PlayStation Network 账户（使用提供的访问代码）关联到指定的 PlayFab 玩家账户，以便进行跨会话登录。

将与提供的访问代码关联的 PlayStation :tm: Network 账户关联到用户的 PlayFab 账户

## 语法

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

### 参数

**`titleEntityHandle`**   PFEntityHandle

使用 PFAuthenticationGetEntityWithSecretKeyAsync 获得的标题实体的 PFEntityHandle。

**`request`**   [PFAccountManagementServerLinkPSNAccountRequest\*](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementserverlinkpsnaccountrequest)

已填充的请求对象。

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

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

此 API 适用于 Win32、Linux 和 macOS。 另请参阅 ServerUnlinkPSNAccountAsync。 调用 XAsyncGetStatus 以获取操作的状态。 如果服务调用不成功，异步结果将是 E\_PF\_ACCOUNT\_ALREADY\_LINKED, E\_PF\_ACCOUNT\_NOT\_FOUND, E\_PF\_INVALID\_NAMESPACE\_MISMATCH, E\_PF\_INVALID\_PSN\_AUTH\_CODE, E\_PF\_INVALID\_PSN\_ISSUER\_ID, E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED, E\_PF\_PSN\_INACCESSIBLE, E\_PF\_REQUEST\_VIEW\_CONSTRAINT\_PARAMS\_NOT\_ALLOWED 或任何全局 PlayFab 服务错误。 有关错误处理的详细信息，请参阅文档页面 "Handling PlayFab Errors"。

## 要求

**头文件：** PFAccountManagement.h

## 另请参阅

[PFAccountManagement 成员](/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [服务 C API 概览 - PFAccountManagement.h](/zh-CN/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFAccountManagementServerLinkXboxAccountAsync](/zh-CN/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinkxboxaccountasync.md)
- [PFAccountManagementServerLinkNintendoServiceAccountAsync](/zh-CN/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinknintendoserviceaccountasync.md)
- [PFAccountManagementServerLinkNintendoServiceAccountSubjectAsync](/zh-CN/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinknintendoserviceaccountsubjectasync.md)
- [PFAccountManagementServerLinkServerCustomIdAsync](/zh-CN/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinkservercustomidasync.md)
