mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09: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:
commit
08dac3fcda
@ -77,7 +77,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Remove panels for users no longer in the room.
|
// 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.
|
// Add panels for all users new to the room.
|
||||||
foreach (var user in Room.Users.Except(panels.Select(p => p.User)))
|
foreach (var user in Room.Users.Except(panels.Select(p => p.User)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user