private void GetAttachmentsReport(ScenePresence sp, StringBuilder sb)
        {
            sb.AppendFormat("Attachments for {0}\n", sp.Name);

            ConsoleDisplayTable ct = new ConsoleDisplayTable()
            {
                Indent = 2
            };

            ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 36));
            ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10));
            ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36));
            ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14));
            ct.Columns.Add(new ConsoleDisplayTableColumn("Position", 15));

//            sb.AppendFormat(
//                "  {0,-36}  {1,-10}  {2,-36}  {3,-14}  {4,-15}\n",
//                "Attachment Name", "Local ID", "Item ID", "Attach Point", "Position");

            List <SceneObjectGroup> attachmentObjects = sp.GetAttachments();

            foreach (SceneObjectGroup attachmentObject in attachmentObjects)
            {
//                InventoryItemBase attachmentItem
//                    = m_scenes[0].InventoryService.GetItem(new InventoryItemBase(attachmentObject.FromItemID));

//                if (attachmentItem == null)
//                {
//                    sb.AppendFormat(
//                        "WARNING: Couldn't find attachment for item {0} at point {1}\n",
//                        attachmentData.ItemID, (AttachmentPoint)attachmentData.AttachPoint);
//                        continue;
//                }
//                else
//                {
//                    sb.AppendFormat(
//                        "  {0,-36}  {1,-10}  {2,-36}  {3,-14}  {4,-15}\n",
//                        attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID,
//                        (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos);
                ct.Rows.Add(
                    new ConsoleDisplayTableRow(
                        new List <string>()
                {
                    attachmentObject.Name,
                    attachmentObject.LocalId.ToString(),
                    attachmentObject.FromItemID.ToString(),
                    ((AttachmentPoint)attachmentObject.AttachmentPoint).ToString(),
                    attachmentObject.RootPart.AttachedPos.ToString()
                }));
//                }
            }

            ct.AddToStringBuilder(sb);
            sb.Append("\n");
        }
        private void HandleShowBordersCommand(string module, string[] args)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Borders for {0}:\n", m_scene.Name);

            ConsoleDisplayTable cdt = new ConsoleDisplayTable();

            cdt.AddColumn("Cross Direction", 15);
            cdt.AddColumn("Line", 34);
            cdt.AddColumn("Trigger Region", 14);

            foreach (Border b in m_scene.NorthBorders)
            {
                cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY));
            }

            foreach (Border b in m_scene.EastBorders)
            {
                cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY));
            }

            foreach (Border b in m_scene.SouthBorders)
            {
                cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY));
            }

            foreach (Border b in m_scene.WestBorders)
            {
                cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY));
            }

            cdt.AddToStringBuilder(sb);

            MainConsole.Instance.Output(sb.ToString());
        }
        private void GetAttachmentsReport(ScenePresence sp, StringBuilder sb)
        {
            sb.AppendFormat("Animations for {0}\n", sp.Name);

            ConsoleDisplayList cdl = new ConsoleDisplayList()
            {
                Indent = 2
            };
            ScenePresenceAnimator spa   = sp.Animator;
            AnimationSet          anims = sp.Animator.Animations;

            string cma = spa.CurrentMovementAnimation;

            cdl.AddRow(
                "Current movement anim",
                string.Format("{0}, {1}", DefaultAvatarAnimations.GetDefaultAnimation(cma), cma));

            UUID defaultAnimId = anims.DefaultAnimation.AnimID;

            cdl.AddRow(
                "Default anim",
                string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId)));

            UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID;

            cdl.AddRow(
                "Implicit default anim",
                string.Format("{0}, {1}",
                              implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId)));

            cdl.AddToStringBuilder(sb);

            ConsoleDisplayTable cdt = new ConsoleDisplayTable()
            {
                Indent = 2
            };

            cdt.AddColumn("Animation ID", 36);
            cdt.AddColumn("Name", 20);
            cdt.AddColumn("Seq", 3);
            cdt.AddColumn("Object ID", 36);

            UUID[] animIds;
            int[]  sequenceNumbers;
            UUID[] objectIds;

            sp.Animator.Animations.GetArrays(out animIds, out sequenceNumbers, out objectIds);

            for (int i = 0; i < animIds.Length; i++)
            {
                UUID   animId   = animIds[i];
                string animName = sp.Animator.GetAnimName(animId);
                int    seq      = sequenceNumbers[i];
                UUID   objectId = objectIds[i];

                cdt.AddRow(animId, animName, seq, objectId);
            }

            cdt.AddToStringBuilder(sb);
            sb.Append("\n");
        }