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

# PFMultiplayerStartProcessingLobbyStateChanges

> 检索自上次调用以来 PlayFab Multiplayer 大厅需要处理的 PFLobbyStateChange 条目数组，使标题可以更新状态或 UI。

检索自上次调用以来所有要处理的 PFLobbyStateChanges 数组。

## 语法

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

### 参数

**`handle`**   PFMultiplayerHandle

PFMultiplayer API 实例的句柄。

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

`stateChanges` 数组中要供标题处理的 PFLobbyStateChange 条目的输出数量。

**`stateChanges`**   PFLobbyStateChange\* const\*\*\
*library-allocated output array of size `*stateChangeCount`*

一个由库分配的输出数组，包含所有要供标题处理并随后传递给 [PFMultiplayerFinishProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerfinishprocessinglobbystatechanges) 的 PFLobbyStateChange 条目。

### 返回值

类型：HRESULT

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

## 备注

此方法为大厅库提供了与远程设备或服务同步状态的机会，并检索自上次调用此方法以来当前可供标题处理的所有更改列表。标题应使用所提供的 0 个或多个更改数组来更新其自身状态或 UI，然后及时调用 [PFMultiplayerFinishProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerfinishprocessinglobbystatechanges) 传回它们。<br /><br /> 库公开的大厅库状态在此调用期间可能发生变化，因此你必须以线程安全的方式使用它。例如，在 UI 线程上调用 PFMultiplayerStartProcessingLobbyStateChanges() 的同时，另一个工作线程正在循环遍历由 [PFLobbyGetMembers()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetmembers) 返回的大厅成员列表，可能导致崩溃，因为 PFMultiplayerStartProcessingLobbyStateChanges() 可能更改与成员列表关联的内存。PFMultiplayerStartProcessingLobbyStateChanges() 应频繁调用——至少每图形帧一次。它被设计为执行和返回都很快，因此可以在主 UI 线程上调用，对性能的影响可以忽略不计。为获得最佳结果，你还应在调用 PFMultiplayerFinishProcessingLobbyStateChanges() 之前尽量减少处理状态更改所花费的时间。  <br /><br /> 由 PFMultiplayerStartProcessingLobbyStateChanges() 返回的每个状态更改必须恰好返回给 PFMultiplayerFinishProcessingLobbyStateChanges() 一次，但可以乱序返回，并可以与来自其他 PFMultiplayerStartProcessingLobbyStateChanges() 调用的状态更改交错。与特定状态更改关联的任何资源都可以保证在该状态更改归还给 PFMultiplayerFinishProcessingLobbyStateChanges() 之前保持有效。

## 要求

**头文件：** PFLobby.h

## 另请参阅

[PFLobby 成员](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)\
[PFLobbyStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbystatechange)\
[PFMultiplayerFinishProcessingLobbyStateChanges](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerfinishprocessinglobbystatechanges)


## Related topics

- [PFMultiplayerFinishProcessingLobbyStateChanges](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerfinishprocessinglobbystatechanges.md)
- [PFLobbyStateChange](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbystatechange.md)
- [PFLobbyGetLobbyId](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetlobbyid.md)
- [PFLobbyUpdatedStateChange](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange.md)
- [PFLobbyGetOwner](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetowner.md)
