Fixed handling of inventory a bit

- AssetType isn't InventoryType. Those enums contain different numbers. Use AssetType for the asset type, InventoryType for the inventory type.
- The ToString method (or ToLower) of AssetType/InventoryType doesn't necessarily return the correct LLSD string.
- Replaced several magic numbers by their corresponding enum.
- Fixed the invType for gestures and animations in the library.
This should fix Mantis #3610 and the non-terminating inventory loading
This commit is contained in:
Homer Horwitz
2009-05-09 21:11:12 +00:00
parent c534d7f614
commit 1d234ca83f
7 changed files with 57 additions and 49 deletions

View File

@@ -2045,7 +2045,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// good as having type be specified in the XML.
if (ic.Item.AssetType == (int) AssetType.Unknown ||
ic.Item.InvType == (int) AssetType.Unknown)
ic.Item.InvType == (int) InventoryType.Unknown)
{
Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId);
@@ -2078,8 +2078,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
MsgId, parts[parts.Length-1]);
if (ic.Item.AssetType == (int) AssetType.Unknown)
ic.Item.AssetType = (int) AssetType.ImageJPEG;
if (ic.Item.InvType == (int) AssetType.Unknown)
ic.Item.InvType = (int) AssetType.ImageJPEG;
if (ic.Item.InvType == (int) InventoryType.Unknown)
ic.Item.InvType = (int) InventoryType.Texture;
break;
case "jpg" :
case "jpeg" :
@@ -2087,8 +2087,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
MsgId, parts[parts.Length - 1]);
if (ic.Item.AssetType == (int) AssetType.Unknown)
ic.Item.AssetType = (int) AssetType.ImageJPEG;
if (ic.Item.InvType == (int) AssetType.Unknown)
ic.Item.InvType = (int) AssetType.ImageJPEG;
if (ic.Item.InvType == (int) InventoryType.Unknown)
ic.Item.InvType = (int) InventoryType.Texture;
break;
case "tga" :
if (parts[parts.Length - 2].IndexOf("_texture") != -1)
@@ -2096,14 +2096,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (ic.Item.AssetType == (int) AssetType.Unknown)
ic.Item.AssetType = (int) AssetType.TextureTGA;
if (ic.Item.InvType == (int) AssetType.Unknown)
ic.Item.InvType = (int) AssetType.TextureTGA;
ic.Item.InvType = (int) InventoryType.Texture;
}
else
{
if (ic.Item.AssetType == (int) AssetType.Unknown)
ic.Item.AssetType = (int) AssetType.ImageTGA;
if (ic.Item.InvType == (int) AssetType.Unknown)
ic.Item.InvType = (int) AssetType.ImageTGA;
if (ic.Item.InvType == (int) InventoryType.Unknown)
ic.Item.InvType = (int) InventoryType.Snapshot;
}
break;
default :