Added more sophisticated path handling to Inventory. cd command path handling is now available to all TestClient commands. Resolved [TC-12]. Helpers.Implode replaced by String.Join.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2077 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
omegaworks
2008-08-12 05:55:42 +00:00
parent 1de5be5e60
commit 82250be4f1
9 changed files with 264 additions and 165 deletions

View File

@@ -31,25 +31,19 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
string nl = "\n";
for (int i = 1; i < args.Length; ++i)
{
string inventoryName = args[i];
string itemPath = args[i];
if (Client.CurrentDirectory.IsStale)
List<InventoryBase> results = Inventory.InventoryFromPath(itemPath, Client.CurrentDirectory, true);
if (results.Count == 0)
{
Client.CurrentDirectory.DownloadContents(TimeSpan.FromSeconds(30));
ret += "No inventory item at " + itemPath + " found." + nl;
}
bool found = false;
foreach (InventoryBase b in Client.CurrentDirectory) {
string name = b.Name;
if (inventoryName == name || inventoryName == b.UUID.ToString())
{
found = true;
b.Give(dest, true);
ret += "Gave " + name + nl;
}
else
{
results[0].Give(dest, true);
ret += "Gave " + results[0].Name + nl;
}
if (!found)
ret += "No inventory item named " + inventoryName + " found." + nl;
}
return ret;
}