From 1d234ca83f64b31b559ace3f63ebbba9f4903778 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 9 May 2009 21:11:12 +0000 Subject: 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 --- .../Rest/Inventory/RestInventoryServices.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index ae242bd..5de44b6 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -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 : -- cgit v1.1