ObjectsAvatars and ObjectsPrimitives are now ConcurrentDictionary to avoid a rather nasty locking bottleneck.

This commit is contained in:
cinder
2025-05-27 14:16:03 -05:00
parent b25e647e9f
commit 5ee53b32ac
25 changed files with 747 additions and 759 deletions

View File

@@ -43,18 +43,14 @@ namespace OpenMetaverse.TestClient
{
lock (Client.Network.Simulators)
{
foreach (var sim in Client.Network.Simulators)
foreach (var target in Client.Network.Simulators
.Select(sim => sim.ObjectsAvatars
.FirstOrDefault(avatar => avatar.Value.Name == name))
.Where(target => target.Value != null))
{
Avatar target = sim.ObjectsAvatars.Find(
avatar => avatar.Name == name
);
if (target != null)
{
targetLocalID = target.LocalID;
Active = true;
return true;
}
targetLocalID = target.Value.LocalID;
Active = true;
return true;
}
}