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

@@ -1,4 +1,5 @@
using System;
using System.Linq;
namespace OpenMetaverse.TestClient
{
@@ -19,18 +20,14 @@ namespace OpenMetaverse.TestClient
lock (Client.Network.Simulators)
{
foreach (var sim in Client.Network.Simulators)
foreach (var master in Client.Network.Simulators
.Select(sim => sim.ObjectsAvatars.FirstOrDefault(
kvp => kvp.Value.ID == Client.MasterKey))
.Where(master => master.Value != null))
{
Avatar master = sim.ObjectsAvatars.Find(
avatar => avatar.ID == Client.MasterKey
);
if (master != null)
{
Client.Self.InstantMessage(master.ID,
"You are now my master. IM me with \"help\" for a command list.");
break;
}
Client.Self.InstantMessage(master.Value.ID,
"You are now my master. IM me with \"help\" for a command list.");
break;
}
}