ObjectsAvatars and ObjectsPrimitives are now ConcurrentDictionary to avoid a rather nasty locking bottleneck.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Security.Permissions;
|
||||
|
||||
namespace OpenMetaverse.TestClient
|
||||
{
|
||||
@@ -14,36 +15,32 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
public override string Execute(string[] args, UUID fromAgentID)
|
||||
{
|
||||
int faceIndex;
|
||||
UUID textureID;
|
||||
|
||||
if (args.Length != 2)
|
||||
return "Usage: findtexture [face-index] [texture-uuid]";
|
||||
|
||||
if (int.TryParse(args[0], out faceIndex) &&
|
||||
UUID.TryParse(args[1], out textureID))
|
||||
{
|
||||
Client.Network.CurrentSim.ObjectsPrimitives.ForEach(
|
||||
delegate(Primitive prim)
|
||||
return "Usage: findtexture [face-index] [texture-uuid]";
|
||||
}
|
||||
|
||||
if (int.TryParse(args[0], out var faceIndex) &&
|
||||
UUID.TryParse(args[1], out var textureID))
|
||||
{
|
||||
foreach (var kvp in Client.Network.CurrentSim.ObjectsPrimitives)
|
||||
{
|
||||
if (kvp.Value == null) { continue; }
|
||||
|
||||
var prim = kvp.Value;
|
||||
if (prim.Textures?.FaceTextures[faceIndex] == null) { continue; }
|
||||
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
|
||||
{
|
||||
if (prim.Textures?.FaceTextures[faceIndex] != null)
|
||||
{
|
||||
if (prim.Textures.FaceTextures[faceIndex].TextureID == textureID)
|
||||
{
|
||||
Logger.Log(
|
||||
$"Primitive {prim.ID.ToString()} ({prim.LocalID}) has face index {faceIndex} set to {textureID.ToString()}",
|
||||
Helpers.LogLevel.Info, Client);
|
||||
}
|
||||
}
|
||||
Logger.Log(
|
||||
$"Primitive {prim.ID.ToString()} ({prim.LocalID}) has face index {faceIndex} set to {textureID.ToString()}",
|
||||
Helpers.LogLevel.Info, Client);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return "Done searching";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Usage: findtexture [face-index] [texture-uuid]";
|
||||
}
|
||||
|
||||
return "Usage: findtexture [face-index] [texture-uuid]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user