Files
libremetaverse/Programs/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs
John Hurliman 07754f7016 OpenMetaverse:
* LLObject is gone, it is now merged into Primitive
* Avatar inherits from Primitive
Simian:
* Added SimulationObject to track prims
* Added IMeshingProvider and a connector to OpenMetaverse.Rendering plugins

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2161 52acb1d6-8a22-11de-b505-999d5b087335
2008-08-24 05:06:51 +00:00

37 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using OpenMetaverse;
namespace OpenMetaverse.TestClient
{
public class AttachmentsCommand : Command
{
public AttachmentsCommand(TestClient testClient)
{
Client = testClient;
Name = "attachments";
Description = "Prints a list of the currently known agent attachments";
Category = CommandCategory.Appearance;
}
public override string Execute(string[] args, UUID fromAgentID)
{
List<Primitive> attachments = Client.Network.CurrentSim.ObjectsPrimitives.FindAll(
delegate(Primitive prim) { return prim.ParentID == Client.Self.LocalID; }
);
for (int i = 0; i < attachments.Count; i++)
{
Primitive prim = attachments[i];
AttachmentPoint point = Helpers.StateToAttachmentPoint(prim.PrimData.State);
// TODO: Fetch properties for the objects with missing property sets so we can show names
Logger.Log(String.Format("[Attachment @ {0}] LocalID: {1} UUID: {2} Offset: {3}",
point, prim.LocalID, prim.ID, prim.Position), Helpers.LogLevel.Info, Client);
}
return "Found " + attachments.Count + " attachments";
}
}
}