From 0688861aa72dc162a3da7b60804ac17ff5908067 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Nov 2011 22:15:29 +0000 Subject: Use the more extensive Utils.AssetTypeToString()/InventoryTypeToString() conversion rather than the arrays in TaskInventoryItem --- .../WebFetchInvDescHandler.cs | 5 +- OpenSim/Framework/TaskInventoryItem.cs | 57 ---------------------- .../Framework/Scenes/SceneObjectPartInventory.cs | 4 +- 3 files changed, 5 insertions(+), 61 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs index 17dbcd5..52b5f2c 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs @@ -235,10 +235,11 @@ namespace OpenSim.Capabilities.Handlers llsdFolder.folder_id = invFolder.ID; llsdFolder.parent_id = invFolder.ParentID; llsdFolder.name = invFolder.Name; - if (invFolder.Type < 0 || invFolder.Type >= TaskInventoryItem.Types.Length) + + if (!Enum.IsDefined(typeof(AssetType), invFolder.Type)) llsdFolder.type = "-1"; else - llsdFolder.type = TaskInventoryItem.Types[invFolder.Type]; + llsdFolder.type = Utils.AssetTypeToString((AssetType)invFolder.Type); llsdFolder.preferred_type = "-1"; return llsdFolder; diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 30d775c..ba2a306 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -40,63 +40,6 @@ namespace OpenSim.Framework /// private const uint FULL_MASK_PERMISSIONS_GENERAL = 2147483647; - /// - /// Inventory types - /// - public static string[] InvTypes = new string[] - { - "texture", - "sound", - "calling_card", - "landmark", - String.Empty, - String.Empty, - "object", - "notecard", - String.Empty, - String.Empty, - "lsl_text", - String.Empty, - String.Empty, - "bodypart", - String.Empty, - "snapshot", - String.Empty, - String.Empty, - "wearable", - "animation", - "gesture" - }; - - /// - /// Asset types - /// - public static string[] Types = new string[] - { - "texture", - "sound", - "callcard", - "landmark", - "clothing", // Deprecated - "clothing", - "object", - "notecard", - "category", - "root", - "lsltext", - "lslbyte", - "txtr_tga", - "bodypart", - "trash", - "snapshot", - "lstndfnd", - "snd_wav", - "img_tga", - "jpeg", - "animatn", - "gesture" - }; - private UUID _assetID = UUID.Zero; private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d80944b..daddb90 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -832,8 +832,8 @@ namespace OpenSim.Region.Framework.Scenes invString.AddSectionEnd(); invString.AddNameValueLine("asset_id", item.AssetID.ToString()); - invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); - invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); + invString.AddNameValueLine("type", Utils.AssetTypeToString((AssetType)item.Type)); + invString.AddNameValueLine("inv_type", Utils.InventoryTypeToString((InventoryType)item.InvType)); invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); invString.AddSaleStart(); -- cgit v1.1