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

# PFMultiplayerStartProcessingMatchmakingStateChanges

> 检索自上次调用以来要处理的 PlayFab 多人游戏匹配状态变更数组，让 title 能够响应票证和匹配的更新。

检索自上次此类调用以来要处理的所有匹配状态变更数组。

## 语法

```cpp theme={null}
HRESULT PFMultiplayerStartProcessingMatchmakingStateChanges(  
    PFMultiplayerHandle handle,  
    uint32_t* stateChangeCount,  
    const PFMatchmakingStateChange* const** stateChanges  
)  
```

### 参数

**`handle`**   PFMultiplayerHandle

PFMultiplayer API 实例的句柄。

**`stateChangeCount`**   uint32\_t\*\
*output*

输出 `stateChanges` 数组中供 title 处理的 PFMatchmakingStateChange 条目数量。

**`stateChanges`**   PFMatchmakingStateChange\* const\*\*\
*大小为 `*stateChangeCount` 的库分配输出数组*

一个库分配的输出数组，包含所有 PFMatchmakingStateChange 条目，供 title 处理，然后传递给 [PFMultiplayerFinishProcessingMatchmakingStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerfinishprocessingmatchmakingstatechanges)。

### 返回值

类型：HRESULT

如果调用成功，则为 `S_OK`；否则为错误代码。可以通过 [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage) 获取错误代码的人类可读形式。

## 备注

此方法为匹配库提供与远程设备或服务同步状态的机会，并检索自上次调用此方法以来当前可供 title 使用的所有变更列表。title 应使用所提供的 0 或多个变更的数组来更新其自身状态或 UI，然后及时使用它们调用 [PFMultiplayerFinishProcessingMatchmakingStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerfinishprocessingmatchmakingstatechanges)。<br /><br /> 库公开的匹配库状态可能会在此调用期间发生变化，因此使用时必须保证线程安全。应频繁调用 PFMultiplayerStartProcessingMatchmakingStateChanges() — 至少每图形帧调用一次。它的设计目标是快速执行并返回，因此可以在主 UI 线程上调用而不会造成明显影响。为获得最佳效果，还应尽量减少在调用 PFMultiplayerFinishProcessingMatchmakingStateChanges() 之前处理状态变更所花费的时间。<br /><br /> PFMultiplayerStartProcessingMatchmakingStateChanges() 返回的每个状态变更必须恰好一次返回给 PFMultiplayerFinishProcessingMatchmakingStateChanges()，但可以乱序返回，也可以与来自其他 PFMultiplayerStartProcessingMatchmakingStateChanges() 调用的状态变更交错返回。与特定状态变更关联的任何资源都保证在该状态变更返回给 PFMultiplayerFinishProcessingMatchmakingStateChanges() 之前一直有效。

## 要求

**头文件：** PFMatchmaking.h

## 另请参阅

[PFMatchmaking 成员](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members)\
[PFMatchmakingStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingstatechange)\
[PFMultiplayerFinishProcessingMatchmakingStateChanges](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerfinishprocessingmatchmakingstatechanges)


## Related topics

- [PFMultiplayerFinishProcessingMatchmakingStateChanges](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerfinishprocessingmatchmakingstatechanges.md)
- [PFMatchmakingStateChange](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingstatechange.md)
- [异步 Lobby 和 Matchmaking C++ SDK 操作指南](/zh-CN/services/playfab/multiplayer/lobby/lobby-and-matchmaking-client-sdk-async.md)
- [Matchmaking SDK 快速入门](/zh-CN/services/playfab/multiplayer/matchmaking/quickstart-client-sdk.md)
- [从 MPSD 迁移到 PlayFab Multiplayer 和 MPA](/zh-CN/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
