Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Appearance/AttachmentsCommand.cs
Latif Khalifa fb3c459016 * Added Helpers.StateToAttachmentPoint() that converts a prim.Data.State to the AttachmentPoint enum
* Created an Appearance folder for TestClient commands, put the new AttachmentsCommand in it which shows all of the current agent attachments
* Moved the ObjectManager enums out to the libsecondlife namespace
* Change LLObject.ObjectData.State from a uint to a byte (as it should be)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1505 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-30 00:25:08 +00:00

36 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using libsecondlife;
namespace libsecondlife.TestClient
{
public class AttachmentsCommand : Command
{
public AttachmentsCommand(TestClient testClient)
{
Client = testClient;
Name = "attachments";
Description = "Prints a list of the currently known agent attachments";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
List<Primitive> attachments = Client.Network.CurrentSim.Objects.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.Data.State);
// TODO: Fetch properties for the objects with missing property sets so we can show names
Client.Log(String.Format("[Attachment @ {0}] LocalID: {1} UUID: {2} Offset: {3}",
point, prim.LocalID, prim.ID, prim.Position), Helpers.LogLevel.Info);
}
return "Found " + attachments.Count + " attachments";
}
}
}