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

# 提交信誉反馈

> 调用 XblSocialSubmitReputationFeedbackAsync 的 XSAPI C 示例，用于从 XBOX 游戏发送正面或负面的玩家信誉反馈。

## 提交单个信誉反馈

**C API**

```cpp theme={null}
auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock }; // Take over ownership of the XAsyncBlock*
    HRESULT hr = XAsyncGetStatus(asyncBlock, false);
};

uint64_t xuid{ 123 };
HRESULT hr = XblSocialSubmitReputationFeedbackAsync(
    xboxLiveContext,
    xuid,
    XblReputationFeedbackType::PositiveHelpfulPlayer,
    nullptr,
    "Helpful player",
    nullptr,
    asyncBlock.get()
);
if (SUCCEEDED(hr))
{
    // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
    // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
    asyncBlock.release();
}
```

**参考**

* [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)
* [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus)
* [XblReputationFeedbackType](/reference/live/xsapi-c/social_c/enums/xblreputationfeedbacktype)
* [XblSocialSubmitReputationFeedbackAsync](/reference/live/xsapi-c/social_c/functions/xblsocialsubmitreputationfeedbackasync)

## 提交多个信誉反馈项

**C API**

```cpp theme={null}
std::vector<XblReputationFeedbackItem> feedbackItems;
feedbackItems.push_back(XblReputationFeedbackItem
    {
        123,
        XblReputationFeedbackType::PositiveHelpfulPlayer,
        nullptr,
        "Helpful player",
        nullptr
    });
// Add any additional feedback items here

auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock }; // Take over ownership of the XAsyncBlock*
    HRESULT hr = XAsyncGetStatus(asyncBlock, false);
};

HRESULT hr = XblSocialSubmitBatchReputationFeedbackAsync(
    xboxLiveContext,
    feedbackItems.data(),
    feedbackItems.size(),
    asyncBlock.get()
);
if (SUCCEEDED(hr))
{
    // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
    // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
    asyncBlock.release();
}
```

**参考**

* [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)
* [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus)
* [XblReputationFeedbackItem](/reference/live/xsapi-c/social_c/structs/xblreputationfeedbackitem)
* [XblReputationFeedbackType](/reference/live/xsapi-c/social_c/enums/xblreputationfeedbacktype)
* [XblSocialSubmitBatchReputationFeedbackAsync](/reference/live/xsapi-c/social_c/functions/xblsocialsubmitbatchreputationfeedbackasync)


## Related topics

- [信誉示例代码](/zh-CN/services/xbox-services/community/reputation/how-to/live-reputation-howto-nav.md)
- [XblReputationFeedbackItem](/zh-CN/reference/live/xsapi-c/social_c/structs/xblreputationfeedbackitem.md)
- [XblSocialSubmitReputationFeedbackAsync](/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialsubmitreputationfeedbackasync.md)
- [XblSocialSubmitBatchReputationFeedbackAsync](/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialsubmitbatchreputationfeedbackasync.md)
- [从游戏发送信誉反馈](/zh-CN/services/xbox-services/community/reputation/concepts/live-sending-reputation-feedback.md)
