* Better error message fetching from failed notecard uploads

* createnotecard command will now add a link to the embedded item at the end of the note (still broken with "Invalid asset type.")

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2966 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-07-10 20:20:49 +00:00
parent 46fe89d0a9
commit 268ab32fef
2 changed files with 16 additions and 1 deletions

View File

@@ -59,13 +59,27 @@ namespace OpenMetaverse.TestClient
// Try to fetch the inventory item
InventoryItem item = FetchItem(embedItemID);
if (item != null)
{
notecard.EmbeddedItems = new List<InventoryItem> { item };
notecard.BodyText += "xxxx";
}
else
{
return "Failed to fetch inventory item " + embedItemID;
}
}
notecard.Encode();
if (notecard.EmbeddedItems != null && notecard.EmbeddedItems.Count > 0)
{
// Replace xxxx in the notecard text with a link to the embedded item
notecard.AssetData[notecard.AssetData.Length - 7] = 0xF4;
notecard.AssetData[notecard.AssetData.Length - 6] = 0x80;
notecard.AssetData[notecard.AssetData.Length - 5] = 0x80;
notecard.AssetData[notecard.AssetData.Length - 4] = 0x80;
}
Client.Inventory.RequestCreateItem(Client.Inventory.FindFolderForType(AssetType.Notecard),
filename, filename + " created by OpenMetaverse TestClient " + DateTime.Now, AssetType.Notecard,
UUID.Random(), InventoryType.Notecard, PermissionMask.All,