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

# PlayFabMultiplayer.ProcessMatchmakingStateChanges

> PlayFabMultiplayer.ProcessMatchmakingStateChanges

# PlayFabMultiplayer.ProcessMatchmakingStateChanges 方法

触发自上次此类调用以来所有与大厅相关的 PlayFabMultiplayer.OnMatchmaking\* 事件。

```csharp theme={null}
public static void ProcessMatchmakingStateChanges()
```

## 备注

此方法为 Lobby 库提供了与远程设备或服务同步状态的机会。

Lobby 库通过库暴露的状态可能在此调用期间发生变化,因此你必须以线程安全的方式使用它。例如,在你的 UI 线程上调用 ProcessLobbyStateChanges(),同时另一个工作线程正在遍历 [`GetMembers`](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/GetMembers) 返回的终结点列表,可能会导致崩溃,因为 ProcessLobbyStateChanges() 可能会修改与成员列表关联的内存。应频繁调用 ProcessLobbyStateChanges()——至少每帧一次。它的设计使其能够快速执行并返回,以便可以在主 UI 线程上调用而对性能影响可忽略不计。为获得最佳效果,你还应尽量减少处理状态事件所花费的时间。

## 另请参阅

* class [PlayFabMultiplayer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/overview)
* namespace [PlayFab.Multiplayer](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference)


## Related topics

- [PlayFabMultiplayer.ProcessLobbyStateChanges](/zh-CN/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/ProcessLobbyStateChanges.md)
- [PlayFabMultiplayer.OnMatchmakingTicketStatusChanged](/zh-CN/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnMatchmakingTicketStatusChanged.md)
- [PFMultiplayerStartProcessingMatchmakingStateChanges](/zh-CN/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerstartprocessingmatchmakingstatechanges.md)
- [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)
