LIBOMV-686 Implements new event patterns based on the Microsoft Framework Design Guidelines in ParcelManager

* Changes some public method names to match patterns used through library, namely requests that have an event are named with Request as a prefix
* Add Key2Name TestClient command for resolving group and avatar names based on a UUID
* BREAKING CHANGE * this is a major shift in the way events are internally handled.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3151 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-17 05:50:51 +00:00
parent 7870cfb75f
commit e09e3f45b3
13 changed files with 737 additions and 328 deletions

View File

@@ -18,7 +18,7 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
{
if (args.Length < 2)
{
return "Usage: give <agent uuid> <item1> [item2] [item3] [...]";
return "Usage: give <agent uuid> itemname";
}
UUID dest;
if (!UUID.TryParse(args[0], out dest))
@@ -29,32 +29,36 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
Inventory = Manager.Store;
string ret = "";
string nl = "\n";
for (int i = 1; i < args.Length; ++i)
string target = String.Empty;
for (int ct = 0; ct < args.Length; ct++)
target = target + args[ct] + " ";
target = target.TrimEnd();
string inventoryName = target;
// WARNING: Uses local copy of inventory contents, need to download them first.
List<InventoryBase> contents = Inventory.GetContents(Client.CurrentDirectory);
bool found = false;
foreach (InventoryBase b in contents)
{
string inventoryName = args[i];
// WARNING: Uses local copy of inventory contents, need to download them first.
List<InventoryBase> contents = Inventory.GetContents(Client.CurrentDirectory);
bool found = false;
foreach (InventoryBase b in contents)
if (inventoryName == b.Name || inventoryName == b.UUID.ToString())
{
if (inventoryName == b.Name || inventoryName == b.UUID.ToString())
found = true;
if (b is InventoryItem)
{
found = true;
if (b is InventoryItem)
{
InventoryItem item = b as InventoryItem;
Manager.GiveItem(item.UUID, item.Name, item.AssetType, dest, true);
ret += "Gave " + item.Name + nl;
}
else
{
ret += "Unable to give folder " + b.Name + nl;
}
InventoryItem item = b as InventoryItem;
Manager.GiveItem(item.UUID, item.Name, item.AssetType, dest, true);
ret += "Gave " + item.Name + " (" + item.AssetType + ")" + nl;
}
else
{
ret += "Unable to give folder " + b.Name + nl;
}
}
if (!found)
ret += "No inventory item named " + inventoryName + " found." + nl;
}
if (!found)
ret += "No inventory item named " + inventoryName + " found." + nl;
return ret;
}
}