aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/Inventory/InventoryCommand.cs
blob: 7b01bb1ba0a3313a7b654f40265b36fb76c6a10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;

using libsecondlife;
using libsecondlife.Packets;
using libsecondlife.InventorySystem;

namespace libsecondlife.TestClient
{
    public class InventoryCommand : Command
    {
		public InventoryCommand(TestClient testClient)
        {
            Name = "i";
            Description = "Prints out inventory.";
        }

        public override string Execute(string[] args, LLUUID fromAgentID)
        {
            return "Broken until someone fixes me";

            //Client.Inventory.DownloadInventory();
            //StringBuilder result = new StringBuilder();
            //PrintFolder(Client.Inventory.GetRootFolder(), result, 0);
            //return result.ToString();
        }

        //void PrintFolder(InventoryFolder folder, StringBuilder output, int indenting)
        //{
        //    Indent(output, indenting);
        //    output.Append(folder.Name);
        //    output.Append("\n");
        //    foreach (InventoryBase b in folder.GetContents())
        //    {
        //        InventoryItem item = b as InventoryItem;
        //        if (item != null)
        //        {
        //            Indent(output, indenting + 1);
        //            output.Append(item.Name);
        //            output.Append("\n");
        //            continue;
        //        }
        //        InventoryFolder subFolder = b as InventoryFolder;
        //        if (subFolder != null)
        //            PrintFolder(subFolder, output, indenting + 1);
        //    }
        //}

        //void Indent(StringBuilder output, int indenting)
        //{
        //    for (int count = 0; count < indenting; count++)
        //    {
        //        output.Append("  ");
        //    }
        //}
	}
}