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

# XblUserStatisticsGetSingleUserStatisticsAsync

> XblUserStatisticsGetSingleUserStatisticsAsync

# XblUserStatisticsGetSingleUserStatisticsAsync

获取单个用户的指定统计信息。

## 语法

```cpp theme={null}
HRESULT XblUserStatisticsGetSingleUserStatisticsAsync(  
         XblContextHandle xblContextHandle,  
         uint64_t xboxUserId,  
         const char* serviceConfigurationId,  
         const char** statisticNames,  
         size_t statisticNamesCount,  
         XAsyncBlock* async  
)  
```

### 参数

*xblContextHandle*   \_In\_\
类型：[XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

本地用户的 XBOX Live 上下文。

*xboxUserId*   \_In\_\
类型：uint64\_t

要获取统计信息的玩家的 XBOX 用户 ID。

*serviceConfigurationId*   \_In\_z\_\
类型：char\*

标题的服务配置 ID (SCID)。SCID 区分大小写，因此请直接从合作伙伴中心粘贴。

*statisticNames*   \_In\_\
类型：char\*\*

要查找的统计信息名称集合。

*statisticNamesCount*   \_In\_\
类型：size\_t

统计信息名称的数量。

*async*   \_In\_\
类型：XAsyncBlock\*

此操作的 AsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 备注

完成后调用 [XblUserStatisticsGetSingleUserStatisticsResultSize](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticsresultsize) 和 [XblUserStatisticsGetSingleUserStatisticsResult](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticsresult) 以获取结果。仅返回具有值的统计信息。例如，如果请求 3 个统计信息名称但只有 2 个具有值，则服务只返回 2 个统计信息。

如果使用[基于事件的统计信息](/services/xbox-services/player-data/stats-leaderboards/event-based/live-stats-eb-overview)，统计信息名称将与每个统计信息的[统计信息实例](/services/xbox-services/player-data/stats-leaderboards/event-based/live-stats-eb-overview#defining-stat-instances)一致。如果使用[基于标题托管的统计信息](/services/xbox-services/player-data/stats-leaderboards/title-managed/live-stats-tm-overview)，统计信息名称将与每个统计信息的 ID 一致。

通过此 API 请求的统计信息将转换为逗号分隔的列表，字符限制为 260。如果在调用此方法时收到 400 错误，请尝试请求更少的统计信息以缩短转换后字符串的长度。

## REST 调用

V1 GET /users/xuid({xuid})/scids/{scid}/stats/{statname1},...,{statnameN}

## 要求

**头文件：** user\_statistics\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

[user\_statistics\_c](/reference/live/xsapi-c/user_statistics_c/user_statistics_c_members)


## Related topics

- [XblUserStatisticsGetSingleUserStatisticsResult](/zh-CN/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticsresult.md)
- [XblUserStatisticsGetSingleUserStatisticResultSize](/zh-CN/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticresultsize.md)
- [XblUserStatisticsGetSingleUserStatisticsResultSize](/zh-CN/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticsresultsize.md)
- [XblUserStatisticsGetSingleUserStatisticAsync](/zh-CN/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticasync.md)
- [XblUserStatisticsGetSingleUserStatisticResult](/zh-CN/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticresult.md)
