Update wear command to work with the new appearance maanger.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3158 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Latif Khalifa
2009-10-19 23:50:07 +00:00
parent 0c8ef17cdb
commit 38b5b37355

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using OpenMetaverse;
namespace OpenMetaverse.TestClient
@@ -9,32 +10,49 @@ namespace OpenMetaverse.TestClient
{
Client = testClient;
Name = "wear";
Description = "Wear an outfit folder from inventory. Usage: wear [outfit name] [nobake]";
Description = "Wear an outfit folder from inventory. Usage: wear [outfit name]";
Category = CommandCategory.Appearance;
}
public override string Execute(string[] args, UUID fromAgentID)
{
if (args.Length < 1)
return "Usage: wear [outfit name] eg: 'wear /My Outfit/Dance Party";
return "Usage: wear [outfit name] eg: 'wear Clothing/My Outfit";
string target = String.Empty;
bool bake = true;
for (int ct = 0; ct < args.Length; ct++)
{
if (args[ct].Equals("nobake"))
bake = false;
else
target = target + args[ct] + " ";
target += args[ct] + " ";
}
target = target.TrimEnd();
//Client.Appearance.WearOutfit(target.Split('/'), bake);
UUID folder = Client.Inventory.FindObjectByPath(Client.Inventory.Store.RootFolder.UUID, Client.Self.AgentID, target, 20 * 1000);
if (folder == UUID.Zero)
{
return "Outfit path " + target + " not found";
}
List<InventoryBase> contents = Client.Inventory.FolderContents(folder, Client.Self.AgentID, true, true, InventorySortOrder.ByName, 20 * 1000);
List<InventoryItem> items = new List<InventoryItem>();
if (contents == null)
{
return "Failed to get contents of " + target;
}
foreach (InventoryBase item in contents)
{
if (item is InventoryItem)
items.Add((InventoryItem)item);
}
Client.Appearance.ReplaceOutfit(items);
return "Starting to change outfit to " + target;
return "FIXME: Implement this";
}
}
}