1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Merge pull request #15974 from peppy/fix-participant-list-state-desync

Fix multiplayer user panels potentially getting out of sync with player's state
This commit is contained in:
Dan Balasescu 2021-12-07 18:01:11 +09:00 committed by GitHub
commit 08dac3fcda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
else
{
// Remove panels for users no longer in the room.
panels.RemoveAll(p => !Room.Users.Contains(p.User));
foreach (var p in panels)
{
// Note that we *must* use reference equality here, as this call is scheduled and a user may have left and joined since it was last run.
if (Room.Users.All(u => !ReferenceEquals(p.User, u)))
p.Expire();
}
// Add panels for all users new to the room.
foreach (var user in Room.Users.Except(panels.Select(p => p.User)))