LIBOMV-576 Start of Abstracting library into two separate libraries. For now this means: There will be a new dependency for OpenMetaverse.dll named OpenMetaverseCore.dll, the new will be required for OpenMetaverse to operate properly, the inverse is not true. OpenMetaverseCore will eventually contain all packet and message related code. * Need to create a singleton logger instance (or move the current logger to Core. * Currently only Packets, Helpers and some common types have been moved to Core. * Helpers will need to be split and non-core required helpers moved back to OpenMetaverse. * Lots more work to be done here, but these changes should not break anything (yet) git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3021 52acb1d6-8a22-11de-b505-999d5b087335
44 lines
1.6 KiB
C#
44 lines
1.6 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 = 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";
|
|
}
|
|
|
|
public static AttachmentPoint StateToAttachmentPoint(uint state)
|
|
{
|
|
const uint ATTACHMENT_MASK = 0xF0;
|
|
uint fixedState = (((byte)state & ATTACHMENT_MASK) >> 4) | (((byte)state & ~ATTACHMENT_MASK) << 4);
|
|
return (AttachmentPoint)fixedState;
|
|
}
|
|
}
|
|
}
|