diff options
author | Diva Canto | 2015-08-08 12:12:50 -0700 |
---|---|---|
committer | Diva Canto | 2015-08-08 12:12:50 -0700 |
commit | 959872315f67a1a33a2bae7330749f7dd74a4774 (patch) | |
tree | e31f6900453e77815859767cb2331d0412ec5b57 /OpenSim | |
parent | Have osAvatarName2Key check the cache first, even for foreign users (diff) | |
download | opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.zip opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.gz opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.bz2 opensim-SC_OLD-959872315f67a1a33a2bae7330749f7dd74a4774.tar.xz |
WARNING: massive refactor to follow libomv's latest changes regarding inventory folders. The newest version of libomv itself is committed here. Basically, everything that was using the AssetType enum has been combed through; many of those uses were changed to the new FolderType enum.
This means that from now on, [new] root folders have code 8 (FolderType.Root), as the viewers expect, as opposed to 9, which was what we had been doing. Normal folders are as they were, -1. Also now sending folder code 100 for Suitcase folders to viewers, with no filter.
All tests pass, but fingers crossed!
Diffstat (limited to 'OpenSim')
37 files changed, 238 insertions, 225 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 3096323..0228c3c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -2539,8 +2539,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2539 | try | 2539 | try |
2540 | { | 2540 | { |
2541 | Dictionary<UUID,UUID> inventoryMap = new Dictionary<UUID,UUID>(); | 2541 | Dictionary<UUID,UUID> inventoryMap = new Dictionary<UUID,UUID>(); |
2542 | CopyInventoryFolders(destination, source, AssetType.Clothing, inventoryMap, avatarAppearance); | 2542 | CopyInventoryFolders(destination, source, FolderType.Clothing, inventoryMap, avatarAppearance); |
2543 | CopyInventoryFolders(destination, source, AssetType.Bodypart, inventoryMap, avatarAppearance); | 2543 | CopyInventoryFolders(destination, source, FolderType.BodyPart, inventoryMap, avatarAppearance); |
2544 | 2544 | ||
2545 | AvatarWearable[] wearables = avatarAppearance.Wearables; | 2545 | AvatarWearable[] wearables = avatarAppearance.Wearables; |
2546 | 2546 | ||
@@ -2576,20 +2576,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2576 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; | 2576 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; |
2577 | 2577 | ||
2578 | // Get Clothing folder of receiver | 2578 | // Get Clothing folder of receiver |
2579 | InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing); | 2579 | InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, FolderType.Clothing); |
2580 | 2580 | ||
2581 | if (destinationFolder == null) | 2581 | if (destinationFolder == null) |
2582 | throw new Exception("Cannot locate folder(s)"); | 2582 | throw new Exception("Cannot locate folder(s)"); |
2583 | 2583 | ||
2584 | // Missing destination folder? This should *never* be the case | 2584 | // Missing destination folder? This should *never* be the case |
2585 | if (destinationFolder.Type != (short)AssetType.Clothing) | 2585 | if (destinationFolder.Type != (short)FolderType.Clothing) |
2586 | { | 2586 | { |
2587 | destinationFolder = new InventoryFolderBase(); | 2587 | destinationFolder = new InventoryFolderBase(); |
2588 | 2588 | ||
2589 | destinationFolder.ID = UUID.Random(); | 2589 | destinationFolder.ID = UUID.Random(); |
2590 | destinationFolder.Name = "Clothing"; | 2590 | destinationFolder.Name = "Clothing"; |
2591 | destinationFolder.Owner = destination; | 2591 | destinationFolder.Owner = destination; |
2592 | destinationFolder.Type = (short)AssetType.Clothing; | 2592 | destinationFolder.Type = (short)FolderType.Clothing; |
2593 | destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; | 2593 | destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; |
2594 | destinationFolder.Version = 1; | 2594 | destinationFolder.Version = 1; |
2595 | inventoryService.AddFolder(destinationFolder); // store base record | 2595 | inventoryService.AddFolder(destinationFolder); // store base record |
@@ -2707,7 +2707,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2707 | /// This method is called by establishAppearance to copy inventory folders to make | 2707 | /// This method is called by establishAppearance to copy inventory folders to make |
2708 | /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments | 2708 | /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments |
2709 | /// </summary> | 2709 | /// </summary> |
2710 | private void CopyInventoryFolders(UUID destination, UUID source, AssetType assetType, Dictionary<UUID,UUID> inventoryMap, | 2710 | private void CopyInventoryFolders(UUID destination, UUID source, FolderType assetType, Dictionary<UUID, UUID> inventoryMap, |
2711 | AvatarAppearance avatarAppearance) | 2711 | AvatarAppearance avatarAppearance) |
2712 | { | 2712 | { |
2713 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; | 2713 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; |
@@ -2723,9 +2723,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2723 | { | 2723 | { |
2724 | sourceFolder = new InventoryFolderBase(); | 2724 | sourceFolder = new InventoryFolderBase(); |
2725 | sourceFolder.ID = UUID.Random(); | 2725 | sourceFolder.ID = UUID.Random(); |
2726 | if (assetType == AssetType.Clothing) { | 2726 | if (assetType == FolderType.Clothing) |
2727 | { | ||
2727 | sourceFolder.Name = "Clothing"; | 2728 | sourceFolder.Name = "Clothing"; |
2728 | } else { | 2729 | } |
2730 | else | ||
2731 | { | ||
2729 | sourceFolder.Name = "Body Parts"; | 2732 | sourceFolder.Name = "Body Parts"; |
2730 | } | 2733 | } |
2731 | sourceFolder.Owner = source; | 2734 | sourceFolder.Owner = source; |
@@ -2741,7 +2744,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2741 | { | 2744 | { |
2742 | destinationFolder = new InventoryFolderBase(); | 2745 | destinationFolder = new InventoryFolderBase(); |
2743 | destinationFolder.ID = UUID.Random(); | 2746 | destinationFolder.ID = UUID.Random(); |
2744 | if (assetType == AssetType.Clothing) | 2747 | if (assetType == FolderType.Clothing) |
2745 | { | 2748 | { |
2746 | destinationFolder.Name = "Clothing"; | 2749 | destinationFolder.Name = "Clothing"; |
2747 | } | 2750 | } |
@@ -2980,16 +2983,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2980 | // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", | 2983 | // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", |
2981 | // uic.folders.Count, uic.items.Count); | 2984 | // uic.folders.Count, uic.items.Count); |
2982 | 2985 | ||
2983 | InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, AssetType.Clothing); | 2986 | InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, FolderType.Clothing); |
2984 | 2987 | ||
2985 | // This should *never* be the case | 2988 | // This should *never* be the case |
2986 | if (clothingFolder == null || clothingFolder.Type != (short)AssetType.Clothing) | 2989 | if (clothingFolder == null || clothingFolder.Type != (short)FolderType.Clothing) |
2987 | { | 2990 | { |
2988 | clothingFolder = new InventoryFolderBase(); | 2991 | clothingFolder = new InventoryFolderBase(); |
2989 | clothingFolder.ID = UUID.Random(); | 2992 | clothingFolder.ID = UUID.Random(); |
2990 | clothingFolder.Name = "Clothing"; | 2993 | clothingFolder.Name = "Clothing"; |
2991 | clothingFolder.Owner = ID; | 2994 | clothingFolder.Owner = ID; |
2992 | clothingFolder.Type = (short)AssetType.Clothing; | 2995 | clothingFolder.Type = (short)FolderType.Clothing; |
2993 | clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; | 2996 | clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; |
2994 | clothingFolder.Version = 1; | 2997 | clothingFolder.Version = 1; |
2995 | inventoryService.AddFolder(clothingFolder); // store base record | 2998 | inventoryService.AddFolder(clothingFolder); // store base record |
@@ -3035,7 +3038,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
3035 | extraFolder.ID = UUID.Random(); | 3038 | extraFolder.ID = UUID.Random(); |
3036 | extraFolder.Name = outfitName; | 3039 | extraFolder.Name = outfitName; |
3037 | extraFolder.Owner = ID; | 3040 | extraFolder.Owner = ID; |
3038 | extraFolder.Type = (short)AssetType.Clothing; | 3041 | extraFolder.Type = (short)FolderType.Clothing; |
3039 | extraFolder.Version = 1; | 3042 | extraFolder.Version = 1; |
3040 | extraFolder.ParentID = clothingFolder.ID; | 3043 | extraFolder.ParentID = clothingFolder.ID; |
3041 | inventoryService.AddFolder(extraFolder); | 3044 | inventoryService.AddFolder(extraFolder); |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs index 653e791..8af3c64 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventory2HandlerTests.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
75 | 75 | ||
76 | m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; | 76 | m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; |
77 | 77 | ||
78 | InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object); | 78 | InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object); |
79 | m_objectsFolder = of.ID; | 79 | m_objectsFolder = of.ID; |
80 | 80 | ||
81 | // Add 3 objects | 81 | // Add 3 objects |
@@ -90,7 +90,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
90 | m_scene.InventoryService.AddItem(item); | 90 | m_scene.InventoryService.AddItem(item); |
91 | } | 91 | } |
92 | 92 | ||
93 | InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Notecard); | 93 | InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Notecard); |
94 | m_notecardsFolder = ncf.ID; | 94 | m_notecardsFolder = ncf.ID; |
95 | 95 | ||
96 | // Add 5 notecards | 96 | // Add 5 notecards |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 0b66835..2d5531a 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
74 | 74 | ||
75 | m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; | 75 | m_rootFolderID = m_scene.InventoryService.GetRootFolder(m_userID).ID; |
76 | 76 | ||
77 | InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object); | 77 | InventoryFolderBase of = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object); |
78 | m_objectsFolder = of.ID; | 78 | m_objectsFolder = of.ID; |
79 | 79 | ||
80 | // Add an object | 80 | // Add an object |
@@ -85,7 +85,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
85 | item.Name = "Some Object"; | 85 | item.Name = "Some Object"; |
86 | m_scene.InventoryService.AddItem(item); | 86 | m_scene.InventoryService.AddItem(item); |
87 | 87 | ||
88 | InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Notecard); | 88 | InventoryFolderBase ncf = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Notecard); |
89 | m_notecardsFolder = ncf.ID; | 89 | m_notecardsFolder = ncf.ID; |
90 | 90 | ||
91 | // Add a notecard | 91 | // Add a notecard |
@@ -114,7 +114,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
114 | m_scene.InventoryService.AddItem(item); | 114 | m_scene.InventoryService.AddItem(item); |
115 | 115 | ||
116 | // Add a link to the Objects folder in Test Folder | 116 | // Add a link to the Objects folder in Test Folder |
117 | item.AssetID = m_scene.InventoryService.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder | 117 | item.AssetID = m_scene.InventoryService.GetFolderForType(m_userID, FolderType.Object).ID; // use item ID of Objects folder |
118 | item.ID = new UUID("50000000-0000-0000-0000-000000000005"); | 118 | item.ID = new UUID("50000000-0000-0000-0000-000000000005"); |
119 | item.AssetType = (int)AssetType.LinkFolder; | 119 | item.AssetType = (int)AssetType.LinkFolder; |
120 | item.Folder = folder.ID; | 120 | item.Folder = folder.ID; |
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 153a1d0..2f04d2e 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -136,7 +136,7 @@ namespace OpenSim.Framework | |||
136 | get | 136 | get |
137 | { | 137 | { |
138 | return | 138 | return |
139 | (Type == (sbyte) AssetType.Animation || | 139 | (Type == (sbyte)AssetType.Animation || |
140 | Type == (sbyte)AssetType.Gesture || | 140 | Type == (sbyte)AssetType.Gesture || |
141 | Type == (sbyte)AssetType.Simstate || | 141 | Type == (sbyte)AssetType.Simstate || |
142 | Type == (sbyte)AssetType.Unknown || | 142 | Type == (sbyte)AssetType.Unknown || |
@@ -146,13 +146,9 @@ namespace OpenSim.Framework | |||
146 | Type == (sbyte)AssetType.Texture || | 146 | Type == (sbyte)AssetType.Texture || |
147 | Type == (sbyte)AssetType.TextureTGA || | 147 | Type == (sbyte)AssetType.TextureTGA || |
148 | Type == (sbyte)AssetType.Folder || | 148 | Type == (sbyte)AssetType.Folder || |
149 | Type == (sbyte)AssetType.RootFolder || | ||
150 | Type == (sbyte)AssetType.LostAndFoundFolder || | ||
151 | Type == (sbyte)AssetType.SnapshotFolder || | ||
152 | Type == (sbyte)AssetType.TrashFolder || | ||
153 | Type == (sbyte)AssetType.ImageJPEG || | 149 | Type == (sbyte)AssetType.ImageJPEG || |
154 | Type == (sbyte) AssetType.ImageTGA || | 150 | Type == (sbyte)AssetType.ImageTGA || |
155 | Type == (sbyte) AssetType.LSLBytecode); | 151 | Type == (sbyte)AssetType.LSLBytecode); |
156 | } | 152 | } |
157 | } | 153 | } |
158 | 154 | ||
diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index b3457a6..fb66056 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs | |||
@@ -34,6 +34,9 @@ namespace OpenSim.Framework | |||
34 | /// </summary> | 34 | /// </summary> |
35 | public class InventoryFolderBase : InventoryNodeBase | 35 | public class InventoryFolderBase : InventoryNodeBase |
36 | { | 36 | { |
37 | public static readonly string ROOT_FOLDER_NAME = "My Inventory"; | ||
38 | public static readonly string SUITCASE_FOLDER_NAME = "My Suitcase"; | ||
39 | |||
37 | /// <summary> | 40 | /// <summary> |
38 | /// The folder this folder is contained in | 41 | /// The folder this folder is contained in |
39 | /// </summary> | 42 | /// </summary> |
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index ce63ee0..f9fd752 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs | |||
@@ -34,11 +34,7 @@ namespace OpenSim.Framework | |||
34 | /// Inventory Item - contains all the properties associated with an individual inventory piece. | 34 | /// Inventory Item - contains all the properties associated with an individual inventory piece. |
35 | /// </summary> | 35 | /// </summary> |
36 | public class InventoryItemBase : InventoryNodeBase, ICloneable | 36 | public class InventoryItemBase : InventoryNodeBase, ICloneable |
37 | { | 37 | { |
38 | public static readonly string SUITCASE_FOLDER_NAME = "My Suitcase"; | ||
39 | public static readonly sbyte SUITCASE_FOLDER_TYPE = 100; | ||
40 | public static readonly sbyte SUITCASE_FOLDER_FAKE_TYPE = 8; | ||
41 | |||
42 | /// <value> | 38 | /// <value> |
43 | /// The inventory type of the item. This is slightly different from the asset type in some situations. | 39 | /// The inventory type of the item. This is slightly different from the asset type in some situations. |
44 | /// </value> | 40 | /// </value> |
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index 027fc0e..e66d5be 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Framework | |||
64 | private class TypeMapping | 64 | private class TypeMapping |
65 | { | 65 | { |
66 | private sbyte assetType; | 66 | private sbyte assetType; |
67 | private InventoryType inventoryType; | 67 | private sbyte inventoryType; |
68 | private string contentType; | 68 | private string contentType; |
69 | private string contentType2; | 69 | private string contentType2; |
70 | private string extension; | 70 | private string extension; |
@@ -79,7 +79,7 @@ namespace OpenSim.Framework | |||
79 | get { return AssetTypeFromCode(assetType); } | 79 | get { return AssetTypeFromCode(assetType); } |
80 | } | 80 | } |
81 | 81 | ||
82 | public InventoryType InventoryType | 82 | public sbyte InventoryType |
83 | { | 83 | { |
84 | get { return inventoryType; } | 84 | get { return inventoryType; } |
85 | } | 85 | } |
@@ -99,7 +99,7 @@ namespace OpenSim.Framework | |||
99 | get { return extension; } | 99 | get { return extension; } |
100 | } | 100 | } |
101 | 101 | ||
102 | private TypeMapping(sbyte assetType, InventoryType inventoryType, string contentType, string contentType2, string extension) | 102 | private TypeMapping(sbyte assetType, sbyte inventoryType, string contentType, string contentType2, string extension) |
103 | { | 103 | { |
104 | this.assetType = assetType; | 104 | this.assetType = assetType; |
105 | this.inventoryType = inventoryType; | 105 | this.inventoryType = inventoryType; |
@@ -108,18 +108,28 @@ namespace OpenSim.Framework | |||
108 | this.extension = extension; | 108 | this.extension = extension; |
109 | } | 109 | } |
110 | 110 | ||
111 | public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension) | 111 | public TypeMapping(AssetType assetType, sbyte inventoryType, string contentType, string contentType2, string extension) |
112 | : this((sbyte)assetType, inventoryType, contentType, contentType2, extension) | 112 | : this((sbyte)assetType, inventoryType, contentType, contentType2, extension) |
113 | { | 113 | { |
114 | } | 114 | } |
115 | 115 | ||
116 | public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension) | ||
117 | : this((sbyte)assetType, (sbyte)inventoryType, contentType, contentType2, extension) | ||
118 | { | ||
119 | } | ||
120 | |||
116 | public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension) | 121 | public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension) |
117 | : this((sbyte)assetType, inventoryType, contentType, null, extension) | 122 | : this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension) |
123 | { | ||
124 | } | ||
125 | |||
126 | public TypeMapping(AssetType assetType, FolderType inventoryType, string contentType, string extension) | ||
127 | : this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension) | ||
118 | { | 128 | { |
119 | } | 129 | } |
120 | 130 | ||
121 | public TypeMapping(OpenSimAssetType assetType, InventoryType inventoryType, string contentType, string extension) | 131 | public TypeMapping(OpenSimAssetType assetType, InventoryType inventoryType, string contentType, string extension) |
122 | : this((sbyte)assetType, inventoryType, contentType, null, extension) | 132 | : this((sbyte)assetType, (sbyte)inventoryType, contentType, null, extension) |
123 | { | 133 | { |
124 | } | 134 | } |
125 | } | 135 | } |
@@ -145,53 +155,65 @@ namespace OpenSim.Framework | |||
145 | new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), | 155 | new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), |
146 | new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), | 156 | new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"), |
147 | new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"), | 157 | new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"), |
148 | new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"), | ||
149 | new TypeMapping(AssetType.RootFolder, InventoryType.RootCategory, "application/vnd.ll.rootfolder", "rootfolder"), | ||
150 | new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"), | 158 | new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"), |
151 | new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"), | 159 | new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"), |
152 | new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"), | 160 | new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"), |
153 | new TypeMapping(AssetType.TrashFolder, InventoryType.Folder, "application/vnd.ll.trashfolder", "trashfolder"), | ||
154 | new TypeMapping(AssetType.SnapshotFolder, InventoryType.Folder, "application/vnd.ll.snapshotfolder", "snapshotfolder"), | ||
155 | new TypeMapping(AssetType.LostAndFoundFolder, InventoryType.Folder, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"), | ||
156 | new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"), | 161 | new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"), |
157 | new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"), | 162 | new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"), |
158 | new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"), | 163 | new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"), |
159 | new TypeMapping(AssetType.FavoriteFolder, InventoryType.Unknown, "application/vnd.ll.favoritefolder", "favoritefolder"), | ||
160 | new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"), | 164 | new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"), |
161 | new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"), | 165 | new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"), |
162 | new TypeMapping(AssetType.CurrentOutfitFolder, InventoryType.Unknown, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"), | ||
163 | new TypeMapping(AssetType.OutfitFolder, InventoryType.Unknown, "application/vnd.ll.outfitfolder", "outfitfolder"), | ||
164 | new TypeMapping(AssetType.MyOutfitsFolder, InventoryType.Unknown, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"), | ||
165 | new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm"), | 166 | new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm"), |
167 | |||
168 | // The next few items are about inventory folders | ||
169 | new TypeMapping(AssetType.Folder, FolderType.None, "application/vnd.ll.folder", "folder"), | ||
170 | new TypeMapping(AssetType.Folder, FolderType.Root, "application/vnd.ll.rootfolder", "rootfolder"), | ||
171 | new TypeMapping(AssetType.Folder, FolderType.Trash, "application/vnd.ll.trashfolder", "trashfolder"), | ||
172 | new TypeMapping(AssetType.Folder, FolderType.Snapshot, "application/vnd.ll.snapshotfolder", "snapshotfolder"), | ||
173 | new TypeMapping(AssetType.Folder, FolderType.LostAndFound, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"), | ||
174 | new TypeMapping(AssetType.Folder, FolderType.Favorites, "application/vnd.ll.favoritefolder", "favoritefolder"), | ||
175 | new TypeMapping(AssetType.Folder, FolderType.CurrentOutfit, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"), | ||
176 | new TypeMapping(AssetType.Folder, FolderType.Outfit, "application/vnd.ll.outfitfolder", "outfitfolder"), | ||
177 | new TypeMapping(AssetType.Folder, FolderType.MyOutfits, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"), | ||
166 | 178 | ||
179 | // This next mappping is an asset to inventory item mapping. | ||
180 | // Note: LL stores folders as assets of type Folder = 8, and it has a corresponding InventoryType = 8 | ||
181 | // OpenSim doesn't store folders as assets, so this mapping should only be used when parsing things from the viewer to the server | ||
182 | new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"), | ||
183 | |||
184 | // OpenSim specific | ||
167 | new TypeMapping(OpenSimAssetType.Material, InventoryType.Unknown, "application/llsd+xml", "material") | 185 | new TypeMapping(OpenSimAssetType.Material, InventoryType.Unknown, "application/llsd+xml", "material") |
168 | }; | 186 | }; |
169 | 187 | ||
170 | private static Dictionary<sbyte, string> asset2Content; | 188 | private static Dictionary<sbyte, string> asset2Content; |
171 | private static Dictionary<sbyte, string> asset2Extension; | 189 | private static Dictionary<sbyte, string> asset2Extension; |
172 | private static Dictionary<InventoryType, string> inventory2Content; | 190 | private static Dictionary<sbyte, string> inventory2Content; |
173 | private static Dictionary<string, sbyte> content2Asset; | 191 | private static Dictionary<string, sbyte> content2Asset; |
174 | private static Dictionary<string, InventoryType> content2Inventory; | 192 | private static Dictionary<string, sbyte> content2Inventory; |
175 | 193 | ||
176 | static SLUtil() | 194 | static SLUtil() |
177 | { | 195 | { |
178 | asset2Content = new Dictionary<sbyte, string>(); | 196 | asset2Content = new Dictionary<sbyte, string>(); |
179 | asset2Extension = new Dictionary<sbyte, string>(); | 197 | asset2Extension = new Dictionary<sbyte, string>(); |
180 | inventory2Content = new Dictionary<InventoryType, string>(); | 198 | inventory2Content = new Dictionary<sbyte, string>(); |
181 | content2Asset = new Dictionary<string, sbyte>(); | 199 | content2Asset = new Dictionary<string, sbyte>(); |
182 | content2Inventory = new Dictionary<string, InventoryType>(); | 200 | content2Inventory = new Dictionary<string, sbyte>(); |
183 | 201 | ||
184 | foreach (TypeMapping mapping in MAPPINGS) | 202 | foreach (TypeMapping mapping in MAPPINGS) |
185 | { | 203 | { |
186 | sbyte assetType = mapping.AssetTypeCode; | 204 | sbyte assetType = mapping.AssetTypeCode; |
187 | if (!asset2Content.ContainsKey(assetType)) | 205 | if (!asset2Content.ContainsKey(assetType)) |
188 | asset2Content.Add(assetType, mapping.ContentType); | 206 | asset2Content.Add(assetType, mapping.ContentType); |
207 | |||
189 | if (!asset2Extension.ContainsKey(assetType)) | 208 | if (!asset2Extension.ContainsKey(assetType)) |
190 | asset2Extension.Add(assetType, mapping.Extension); | 209 | asset2Extension.Add(assetType, mapping.Extension); |
210 | |||
191 | if (!inventory2Content.ContainsKey(mapping.InventoryType)) | 211 | if (!inventory2Content.ContainsKey(mapping.InventoryType)) |
192 | inventory2Content.Add(mapping.InventoryType, mapping.ContentType); | 212 | inventory2Content.Add(mapping.InventoryType, mapping.ContentType); |
213 | |||
193 | if (!content2Asset.ContainsKey(mapping.ContentType)) | 214 | if (!content2Asset.ContainsKey(mapping.ContentType)) |
194 | content2Asset.Add(mapping.ContentType, assetType); | 215 | content2Asset.Add(mapping.ContentType, assetType); |
216 | |||
195 | if (!content2Inventory.ContainsKey(mapping.ContentType)) | 217 | if (!content2Inventory.ContainsKey(mapping.ContentType)) |
196 | content2Inventory.Add(mapping.ContentType, mapping.InventoryType); | 218 | content2Inventory.Add(mapping.ContentType, mapping.InventoryType); |
197 | 219 | ||
@@ -216,8 +238,8 @@ namespace OpenSim.Framework | |||
216 | public static string SLInvTypeToContentType(int invType) | 238 | public static string SLInvTypeToContentType(int invType) |
217 | { | 239 | { |
218 | string contentType; | 240 | string contentType; |
219 | if (!inventory2Content.TryGetValue((InventoryType)invType, out contentType)) | 241 | if (!inventory2Content.TryGetValue((sbyte)invType, out contentType)) |
220 | contentType = inventory2Content[InventoryType.Unknown]; | 242 | contentType = inventory2Content[(sbyte)InventoryType.Unknown]; |
221 | return contentType; | 243 | return contentType; |
222 | } | 244 | } |
223 | 245 | ||
@@ -231,9 +253,9 @@ namespace OpenSim.Framework | |||
231 | 253 | ||
232 | public static sbyte ContentTypeToSLInvType(string contentType) | 254 | public static sbyte ContentTypeToSLInvType(string contentType) |
233 | { | 255 | { |
234 | InventoryType invType; | 256 | sbyte invType; |
235 | if (!content2Inventory.TryGetValue(contentType, out invType)) | 257 | if (!content2Inventory.TryGetValue(contentType, out invType)) |
236 | invType = InventoryType.Unknown; | 258 | invType = (sbyte)InventoryType.Unknown; |
237 | return (sbyte)invType; | 259 | return (sbyte)invType; |
238 | } | 260 | } |
239 | 261 | ||
diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index 73ebfae..ab3c285 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs | |||
@@ -115,20 +115,16 @@ namespace OpenSim.Framework.Serialization | |||
115 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageJPEG] = ASSET_EXTENSION_SEPARATOR + "image.jpg"; | 115 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageJPEG] = ASSET_EXTENSION_SEPARATOR + "image.jpg"; |
116 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageTGA] = ASSET_EXTENSION_SEPARATOR + "image.tga"; | 116 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.ImageTGA] = ASSET_EXTENSION_SEPARATOR + "image.tga"; |
117 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Landmark] = ASSET_EXTENSION_SEPARATOR + "landmark.txt"; | 117 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Landmark] = ASSET_EXTENSION_SEPARATOR + "landmark.txt"; |
118 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"; // Not sure if we'll ever see this | ||
119 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso"; | 118 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso"; |
120 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl"; | 119 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl"; |
121 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"; | 120 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"; |
122 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; | 121 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; |
123 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; | 122 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; |
124 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this | ||
125 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this | 123 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ASSET_EXTENSION_SEPARATOR + "simstate.bin"; // Not sure if we'll ever see this |
126 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"; // Not sure if we'll ever see this | ||
127 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; | 124 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ASSET_EXTENSION_SEPARATOR + "sound.ogg"; |
128 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = ASSET_EXTENSION_SEPARATOR + "sound.wav"; | 125 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = ASSET_EXTENSION_SEPARATOR + "sound.wav"; |
129 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = ASSET_EXTENSION_SEPARATOR + "texture.jp2"; | 126 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = ASSET_EXTENSION_SEPARATOR + "texture.jp2"; |
130 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = ASSET_EXTENSION_SEPARATOR + "texture.tga"; | 127 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = ASSET_EXTENSION_SEPARATOR + "texture.tga"; |
131 | ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"; // Not sure if we'll ever see this | ||
132 | ASSET_TYPE_TO_EXTENSION[(sbyte)OpenSimAssetType.Material] = ASSET_EXTENSION_SEPARATOR + "material.xml"; // Not sure if we'll ever see this | 128 | ASSET_TYPE_TO_EXTENSION[(sbyte)OpenSimAssetType.Material] = ASSET_EXTENSION_SEPARATOR + "material.xml"; // Not sure if we'll ever see this |
133 | 129 | ||
134 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "animation.bvh"] = (sbyte)AssetType.Animation; | 130 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "animation.bvh"] = (sbyte)AssetType.Animation; |
@@ -140,21 +136,17 @@ namespace OpenSim.Framework.Serialization | |||
140 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.jpg"] = (sbyte)AssetType.ImageJPEG; | 136 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.jpg"] = (sbyte)AssetType.ImageJPEG; |
141 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.tga"] = (sbyte)AssetType.ImageTGA; | 137 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "image.tga"] = (sbyte)AssetType.ImageTGA; |
142 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "landmark.txt"] = (sbyte)AssetType.Landmark; | 138 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "landmark.txt"] = (sbyte)AssetType.Landmark; |
143 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"] = (sbyte)AssetType.LostAndFoundFolder; | ||
144 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode; | 139 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode; |
145 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText; | 140 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText; |
146 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh; | 141 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh; |
147 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; | 142 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; |
148 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; | 143 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; |
149 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; | ||
150 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; | 144 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "simstate.bin"] = (sbyte)AssetType.Simstate; |
151 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "snapshotfolder.txt"] = (sbyte)AssetType.SnapshotFolder; | ||
152 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; | 145 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.ogg"] = (sbyte)AssetType.Sound; |
153 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.wav"] = (sbyte)AssetType.SoundWAV; | 146 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "sound.wav"] = (sbyte)AssetType.SoundWAV; |
154 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.jp2"] = (sbyte)AssetType.Texture; | 147 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.jp2"] = (sbyte)AssetType.Texture; |
155 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA; | 148 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA; |
156 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"] = (sbyte)AssetType.TrashFolder; | 149 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "material.xml"] = (sbyte)OpenSimAssetType.Material; |
157 | EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "material.xml"] = (sbyte)OpenSimAssetType.Material; | ||
158 | } | 150 | } |
159 | 151 | ||
160 | public static string CreateOarLandDataPath(LandData ld) | 152 | public static string CreateOarLandDataPath(LandData ld) |
diff --git a/OpenSim/Framework/Tests/AssetBaseTest.cs b/OpenSim/Framework/Tests/AssetBaseTest.cs index 25d2393..1975a4d 100644 --- a/OpenSim/Framework/Tests/AssetBaseTest.cs +++ b/OpenSim/Framework/Tests/AssetBaseTest.cs | |||
@@ -50,19 +50,15 @@ namespace OpenSim.Framework.Tests | |||
50 | CheckContainsReferences(AssetType.ImageJPEG , false); | 50 | CheckContainsReferences(AssetType.ImageJPEG , false); |
51 | CheckContainsReferences(AssetType.ImageTGA , false); | 51 | CheckContainsReferences(AssetType.ImageTGA , false); |
52 | CheckContainsReferences(AssetType.Landmark , false); | 52 | CheckContainsReferences(AssetType.Landmark , false); |
53 | CheckContainsReferences(AssetType.LostAndFoundFolder, false); | ||
54 | CheckContainsReferences(AssetType.LSLBytecode, false); | 53 | CheckContainsReferences(AssetType.LSLBytecode, false); |
55 | CheckContainsReferences(AssetType.LSLText, false); | 54 | CheckContainsReferences(AssetType.LSLText, false); |
56 | CheckContainsReferences(AssetType.Notecard, false); | 55 | CheckContainsReferences(AssetType.Notecard, false); |
57 | CheckContainsReferences(AssetType.Object, false); | 56 | CheckContainsReferences(AssetType.Object, false); |
58 | CheckContainsReferences(AssetType.RootFolder, false); | ||
59 | CheckContainsReferences(AssetType.Simstate, false); | 57 | CheckContainsReferences(AssetType.Simstate, false); |
60 | CheckContainsReferences(AssetType.SnapshotFolder, false); | ||
61 | CheckContainsReferences(AssetType.Sound, false); | 58 | CheckContainsReferences(AssetType.Sound, false); |
62 | CheckContainsReferences(AssetType.SoundWAV, false); | 59 | CheckContainsReferences(AssetType.SoundWAV, false); |
63 | CheckContainsReferences(AssetType.Texture, false); | 60 | CheckContainsReferences(AssetType.Texture, false); |
64 | CheckContainsReferences(AssetType.TextureTGA, false); | 61 | CheckContainsReferences(AssetType.TextureTGA, false); |
65 | CheckContainsReferences(AssetType.TrashFolder, false); | ||
66 | CheckContainsReferences(AssetType.Unknown, false); | 62 | CheckContainsReferences(AssetType.Unknown, false); |
67 | } | 63 | } |
68 | 64 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 985451c..774202e 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -554,8 +554,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
554 | 554 | ||
555 | if (core.TryGet<IClientInventory>(out clientInv)) | 555 | if (core.TryGet<IClientInventory>(out clientInv)) |
556 | { | 556 | { |
557 | var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, AssetType.Texture); | 557 | var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, FolderType.Texture); |
558 | textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)AssetType.Unknown, systemTextureFolder.ID, 1); | 558 | textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)FolderType.None, systemTextureFolder.ID, 1); |
559 | if (m_Scene.InventoryService.AddFolder(textureUploadFolder)) | 559 | if (m_Scene.InventoryService.AddFolder(textureUploadFolder)) |
560 | { | 560 | { |
561 | foldersToUpdate.Add(textureUploadFolder); | 561 | foldersToUpdate.Add(textureUploadFolder); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs index 39209ec..dd4a691 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests | |||
116 | PollServiceEventArgs pseArgs; | 116 | PollServiceEventArgs pseArgs; |
117 | userCaps.TryGetPollHandler("FetchInventoryDescendents2", out pseArgs); | 117 | userCaps.TryGetPollHandler("FetchInventoryDescendents2", out pseArgs); |
118 | req.UriPath = pseArgs.Url; | 118 | req.UriPath = pseArgs.Url; |
119 | req.Uri = new Uri(req.UriPath); | 119 | req.Uri = new Uri("file://" + req.UriPath); |
120 | 120 | ||
121 | // Retrieve root folder details directly so that we can request | 121 | // Retrieve root folder details directly so that we can request |
122 | InventoryFolderBase folder = scene.InventoryService.GetRootFolder(ua.PrincipalID); | 122 | InventoryFolderBase folder = scene.InventoryService.GetRootFolder(ua.PrincipalID); |
@@ -137,6 +137,8 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests | |||
137 | req.Body = new MemoryStream(OSDParser.SerializeLLSDXmlBytes(osdReqMap)); | 137 | req.Body = new MemoryStream(OSDParser.SerializeLLSDXmlBytes(osdReqMap)); |
138 | 138 | ||
139 | TestHttpClientContext context = new TestHttpClientContext(false); | 139 | TestHttpClientContext context = new TestHttpClientContext(false); |
140 | |||
141 | // WARNING: This results in a caught exception, because queryString is null | ||
140 | MainServer.Instance.OnRequest(context, new RequestEventArgs(req)); | 142 | MainServer.Instance.OnRequest(context, new RequestEventArgs(req)); |
141 | 143 | ||
142 | // Drive processing of the queued inventory request synchronously. | 144 | // Drive processing of the queued inventory request synchronously. |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 284c5fa..c8e5881 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -1866,8 +1866,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1866 | newBlock.Name = Util.StringToBytes256(folder.Name); | 1866 | newBlock.Name = Util.StringToBytes256(folder.Name); |
1867 | newBlock.ParentID = folder.ParentID; | 1867 | newBlock.ParentID = folder.ParentID; |
1868 | newBlock.Type = (sbyte)folder.Type; | 1868 | newBlock.Type = (sbyte)folder.Type; |
1869 | if (newBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) | 1869 | //if (newBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) |
1870 | newBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | 1870 | // newBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; |
1871 | 1871 | ||
1872 | return newBlock; | 1872 | return newBlock; |
1873 | } | 1873 | } |
@@ -2118,8 +2118,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2118 | folderBlock.FolderID = folder.ID; | 2118 | folderBlock.FolderID = folder.ID; |
2119 | folderBlock.ParentID = folder.ParentID; | 2119 | folderBlock.ParentID = folder.ParentID; |
2120 | folderBlock.Type = (sbyte)folder.Type; | 2120 | folderBlock.Type = (sbyte)folder.Type; |
2121 | if (folderBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) | 2121 | // Leaving this here for now, just in case we need to do this for a while |
2122 | folderBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | 2122 | //if (folderBlock.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) |
2123 | // folderBlock.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | ||
2123 | folderBlock.Name = Util.StringToBytes256(folder.Name); | 2124 | folderBlock.Name = Util.StringToBytes256(folder.Name); |
2124 | 2125 | ||
2125 | return folderBlock; | 2126 | return folderBlock; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 59c2179..2f67c4e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -908,7 +908,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
908 | InventoryItemBase newItem | 908 | InventoryItemBase newItem |
909 | = m_invAccessModule.CopyToInventory( | 909 | = m_invAccessModule.CopyToInventory( |
910 | DeRezAction.TakeCopy, | 910 | DeRezAction.TakeCopy, |
911 | m_scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object).ID, | 911 | m_scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object).ID, |
912 | new List<SceneObjectGroup> { grp }, | 912 | new List<SceneObjectGroup> { grp }, |
913 | sp.ControllingClient, true)[0]; | 913 | sp.ControllingClient, true)[0]; |
914 | 914 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index f0dc238..f1b002b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
224 | Assert.That(attachmentItem, Is.Not.Null); | 224 | Assert.That(attachmentItem, Is.Not.Null); |
225 | Assert.That(attachmentItem.Name, Is.EqualTo(attName)); | 225 | Assert.That(attachmentItem.Name, Is.EqualTo(attName)); |
226 | 226 | ||
227 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); | 227 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object); |
228 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); | 228 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); |
229 | 229 | ||
230 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); | 230 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); |
@@ -271,7 +271,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
271 | Assert.That(attachmentItem, Is.Not.Null); | 271 | Assert.That(attachmentItem, Is.Not.Null); |
272 | Assert.That(attachmentItem.Name, Is.EqualTo(so.Name)); | 272 | Assert.That(attachmentItem.Name, Is.EqualTo(so.Name)); |
273 | 273 | ||
274 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); | 274 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object); |
275 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); | 275 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); |
276 | 276 | ||
277 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(2)); | 277 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(2)); |
@@ -304,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
304 | Assert.That(attachmentItem, Is.Not.Null); | 304 | Assert.That(attachmentItem, Is.Not.Null); |
305 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); | 305 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); |
306 | 306 | ||
307 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); | 307 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object); |
308 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); | 308 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); |
309 | 309 | ||
310 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); | 310 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); |
@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
337 | Assert.That(attachmentItem, Is.Not.Null); | 337 | Assert.That(attachmentItem, Is.Not.Null); |
338 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); | 338 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); |
339 | 339 | ||
340 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, AssetType.Object); | 340 | InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(sp.UUID, FolderType.Object); |
341 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); | 341 | Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID)); |
342 | 342 | ||
343 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); | 343 | Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1)); |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index ea7481d..cfb082b 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -908,8 +908,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
908 | AssetType | 908 | AssetType |
909 | = | 909 | = |
910 | (int) | 910 | (int) |
911 | AssetType | 911 | FolderType |
912 | .Bodypart, | 912 | .BodyPart, |
913 | CreatorId | 913 | CreatorId |
914 | = | 914 | = |
915 | userID | 915 | userID |
@@ -924,8 +924,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
924 | invService | 924 | invService |
925 | .GetFolderForType | 925 | .GetFolderForType |
926 | (userID, | 926 | (userID, |
927 | AssetType | 927 | FolderType |
928 | .Bodypart) | 928 | .BodyPart) |
929 | .ID, | 929 | .ID, |
930 | Flags = (uint) type, | 930 | Flags = (uint) type, |
931 | Name = Enum.GetName(typeof (WearableType), type), | 931 | Name = Enum.GetName(typeof (WearableType), type), |
@@ -960,8 +960,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
960 | invService | 960 | invService |
961 | .GetFolderForType | 961 | .GetFolderForType |
962 | (userID, | 962 | (userID, |
963 | AssetType | 963 | FolderType |
964 | .CurrentOutfitFolder) | 964 | .CurrentOutfit) |
965 | .ID, | 965 | .ID, |
966 | Flags = (uint) type, | 966 | Flags = (uint) type, |
967 | Name = Enum.GetName(typeof (WearableType), type), | 967 | Name = Enum.GetName(typeof (WearableType), type), |
@@ -978,8 +978,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
978 | { | 978 | { |
979 | m_scene.SendInventoryUpdate(presence.ControllingClient, | 979 | m_scene.SendInventoryUpdate(presence.ControllingClient, |
980 | invService.GetFolderForType(userID, | 980 | invService.GetFolderForType(userID, |
981 | AssetType | 981 | FolderType |
982 | .CurrentOutfitFolder), | 982 | .CurrentOutfit), |
983 | false, true); | 983 | false, true); |
984 | } | 984 | } |
985 | } | 985 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index b44a5c9..eb23e83 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs | |||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
181 | if (folderID == UUID.Zero) | 181 | if (folderID == UUID.Zero) |
182 | { | 182 | { |
183 | InventoryFolderBase folder = inv.GetFolderForType(userID, | 183 | InventoryFolderBase folder = inv.GetFolderForType(userID, |
184 | AssetType.CallingCard); | 184 | FolderType.CallingCard); |
185 | 185 | ||
186 | if (folder == null) // Nowhere to put it | 186 | if (folder == null) // Nowhere to put it |
187 | return UUID.Zero; | 187 | return UUID.Zero; |
@@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
237 | IInventoryService invService = m_Scenes[0].InventoryService; | 237 | IInventoryService invService = m_Scenes[0].InventoryService; |
238 | 238 | ||
239 | InventoryFolderBase trashFolder = | 239 | InventoryFolderBase trashFolder = |
240 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); | 240 | invService.GetFolderForType(client.AgentId, FolderType.Trash); |
241 | 241 | ||
242 | InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId); | 242 | InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId); |
243 | item = invService.GetItem(item); | 243 | item = invService.GetItem(item); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 2ecec9e..4a06fd1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -412,14 +412,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
412 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); | 412 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); |
413 | UUID newFolderId = UUID.Random(); | 413 | UUID newFolderId = UUID.Random(); |
414 | 414 | ||
415 | // Asset type has to be Unknown here rather than Folder, otherwise the created folder can't be | ||
416 | // deleted once the client has relogged. | ||
417 | // The root folder appears to be labelled AssetType.Folder (shows up as "Category" in the client) | ||
418 | // even though there is a AssetType.RootCategory | ||
419 | destFolder | 415 | destFolder |
420 | = new InventoryFolderBase( | 416 | = new InventoryFolderBase( |
421 | newFolderId, newFolderName, m_userInfo.PrincipalID, | 417 | newFolderId, newFolderName, m_userInfo.PrincipalID, |
422 | (short)AssetType.Unknown, destFolder.ID, 1); | 418 | (short)FolderType.None, destFolder.ID, 1); |
423 | m_InventoryService.AddFolder(destFolder); | 419 | m_InventoryService.AddFolder(destFolder); |
424 | 420 | ||
425 | // Record that we have now created this folder | 421 | // Record that we have now created this folder |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index c88141c..bba48cc 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
372 | IInventoryService invService = scene.InventoryService; | 372 | IInventoryService invService = scene.InventoryService; |
373 | 373 | ||
374 | InventoryFolderBase trashFolder = | 374 | InventoryFolderBase trashFolder = |
375 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); | 375 | invService.GetFolderForType(client.AgentId, FolderType.Trash); |
376 | 376 | ||
377 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 377 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
378 | 378 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs index d615cce..7ddc396 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | |||
@@ -236,8 +236,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
236 | InventoryItemBase receivedItem | 236 | InventoryItemBase receivedItem |
237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); | 237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); |
238 | 238 | ||
239 | InventoryFolderBase trashFolder | 239 | InventoryFolderBase trashFolder |
240 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); | 240 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, FolderType.Trash); |
241 | 241 | ||
242 | Assert.That(receivedItem, Is.Not.Null); | 242 | Assert.That(receivedItem, Is.Not.Null); |
243 | Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID)); | 243 | Assert.That(receivedItem.ID, Is.Not.EqualTo(originalItem.ID)); |
@@ -429,8 +429,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
429 | InventoryFolderBase receivedFolder | 429 | InventoryFolderBase receivedFolder |
430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); | 430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); |
431 | 431 | ||
432 | InventoryFolderBase trashFolder | 432 | InventoryFolderBase trashFolder |
433 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, AssetType.TrashFolder); | 433 | = m_scene.InventoryService.GetFolderForType(receiverSp.UUID, FolderType.Trash); |
434 | 434 | ||
435 | Assert.That(receivedFolder, Is.Not.Null); | 435 | Assert.That(receivedFolder, Is.Not.Null); |
436 | Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID)); | 436 | Assert.That(receivedFolder.ID, Is.Not.EqualTo(originalFolder.ID)); |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index a77bc63..5a9efb8 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -695,18 +695,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
695 | if (remoteClient == null || | 695 | if (remoteClient == null || |
696 | so.OwnerID != remoteClient.AgentId) | 696 | so.OwnerID != remoteClient.AgentId) |
697 | { | 697 | { |
698 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); | 698 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); |
699 | } | 699 | } |
700 | else | 700 | else |
701 | { | 701 | { |
702 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); | 702 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); |
703 | } | 703 | } |
704 | } | 704 | } |
705 | else if (action == DeRezAction.Return) | 705 | else if (action == DeRezAction.Return) |
706 | { | 706 | { |
707 | // Dump to lost + found unconditionally | 707 | // Dump to lost + found unconditionally |
708 | // | 708 | // |
709 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); | 709 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); |
710 | } | 710 | } |
711 | 711 | ||
712 | if (folderID == UUID.Zero && folder == null) | 712 | if (folderID == UUID.Zero && folder == null) |
@@ -715,7 +715,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
715 | { | 715 | { |
716 | // Deletes go to trash by default | 716 | // Deletes go to trash by default |
717 | // | 717 | // |
718 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); | 718 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); |
719 | } | 719 | } |
720 | else | 720 | else |
721 | { | 721 | { |
@@ -723,14 +723,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
723 | { | 723 | { |
724 | // Taking copy of another person's item. Take to | 724 | // Taking copy of another person's item. Take to |
725 | // Objects folder. | 725 | // Objects folder. |
726 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); | 726 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); |
727 | so.FromFolderID = UUID.Zero; | 727 | so.FromFolderID = UUID.Zero; |
728 | } | 728 | } |
729 | else | 729 | else |
730 | { | 730 | { |
731 | // Catch all. Use lost & found | 731 | // Catch all. Use lost & found |
732 | // | 732 | // |
733 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); | 733 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); |
734 | } | 734 | } |
735 | } | 735 | } |
736 | } | 736 | } |
@@ -748,7 +748,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
748 | if(folder.Type == 14 || folder.Type == 16) | 748 | if(folder.Type == 14 || folder.Type == 16) |
749 | { | 749 | { |
750 | // folder.Type = 6; | 750 | // folder.Type = 6; |
751 | folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); | 751 | folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object); |
752 | } | 752 | } |
753 | } | 753 | } |
754 | } | 754 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs index e657f53..e1e1838 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
175 | /// <param name="userID"></param> | 175 | /// <param name="userID"></param> |
176 | /// <param name="type"></param> | 176 | /// <param name="type"></param> |
177 | /// <returns></returns> | 177 | /// <returns></returns> |
178 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { return null; } | 178 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) { return null; } |
179 | 179 | ||
180 | 180 | ||
181 | /// <summary> | 181 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 6a83b42..48f228a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
345 | return root; | 345 | return root; |
346 | } | 346 | } |
347 | 347 | ||
348 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 348 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) |
349 | { | 349 | { |
350 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); | 350 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); |
351 | InventoryFolderBase f = m_Cache.GetFolderForType(userID, type); | 351 | InventoryFolderBase f = m_Cache.GetFolderForType(userID, type); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 71dc337..3195e6b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
41 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour | 41 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour |
42 | 42 | ||
43 | private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); | 43 | private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); |
44 | private static ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>>(); | 44 | private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>(); |
45 | private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); | 45 | private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); |
46 | 46 | ||
47 | public void Cache(UUID userID, InventoryFolderBase root) | 47 | public void Cache(UUID userID, InventoryFolderBase root) |
@@ -58,12 +58,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
58 | return null; | 58 | return null; |
59 | } | 59 | } |
60 | 60 | ||
61 | public void Cache(UUID userID, AssetType type, InventoryFolderBase folder) | 61 | public void Cache(UUID userID, FolderType type, InventoryFolderBase folder) |
62 | { | 62 | { |
63 | Dictionary<AssetType, InventoryFolderBase> ff = null; | 63 | Dictionary<FolderType, InventoryFolderBase> ff = null; |
64 | if (!m_FolderTypes.TryGetValue(userID, out ff)) | 64 | if (!m_FolderTypes.TryGetValue(userID, out ff)) |
65 | { | 65 | { |
66 | ff = new Dictionary<AssetType, InventoryFolderBase>(); | 66 | ff = new Dictionary<FolderType, InventoryFolderBase>(); |
67 | m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS); | 67 | m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS); |
68 | } | 68 | } |
69 | 69 | ||
@@ -77,9 +77,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 80 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) |
81 | { | 81 | { |
82 | Dictionary<AssetType, InventoryFolderBase> ff = null; | 82 | Dictionary<FolderType, InventoryFolderBase> ff = null; |
83 | if (m_FolderTypes.TryGetValue(userID, out ff)) | 83 | if (m_FolderTypes.TryGetValue(userID, out ff)) |
84 | { | 84 | { |
85 | InventoryFolderBase f = null; | 85 | InventoryFolderBase f = null; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 2f29a7c..20d4e02 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -170,7 +170,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
170 | return m_InventoryService.GetRootFolder(userID); | 170 | return m_InventoryService.GetRootFolder(userID); |
171 | } | 171 | } |
172 | 172 | ||
173 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 173 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) |
174 | { | 174 | { |
175 | return m_InventoryService.GetFolderForType(userID, type); | 175 | return m_InventoryService.GetFolderForType(userID, type); |
176 | } | 176 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index e0cc1e8..978b9d9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
177 | return m_RemoteConnector.GetRootFolder(userID); | 177 | return m_RemoteConnector.GetRootFolder(userID); |
178 | } | 178 | } |
179 | 179 | ||
180 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 180 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) |
181 | { | 181 | { |
182 | return m_RemoteConnector.GetFolderForType(userID, type); | 182 | return m_RemoteConnector.GetFolderForType(userID, type); |
183 | } | 183 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index dde54d5..ac27716 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -156,7 +156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | 156 | ||
157 | // OK so either the viewer didn't send a folderID or AddItem failed | 157 | // OK so either the viewer didn't send a folderID or AddItem failed |
158 | UUID originalFolder = item.Folder; | 158 | UUID originalFolder = item.Folder; |
159 | InventoryFolderBase f = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType); | 159 | InventoryFolderBase f = null; |
160 | if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType)) | ||
161 | f = InventoryService.GetFolderForType(item.Owner, (FolderType)item.AssetType); | ||
160 | if (f != null) | 162 | if (f != null) |
161 | { | 163 | { |
162 | m_log.DebugFormat( | 164 | m_log.DebugFormat( |
@@ -743,7 +745,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
743 | 745 | ||
744 | if (itemCopy.Folder == UUID.Zero) | 746 | if (itemCopy.Folder == UUID.Zero) |
745 | { | 747 | { |
746 | InventoryFolderBase folder = InventoryService.GetFolderForType(recipient, (AssetType)itemCopy.AssetType); | 748 | InventoryFolderBase folder = null; |
749 | if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType)) | ||
750 | folder = InventoryService.GetFolderForType(recipient, (FolderType)itemCopy.AssetType); | ||
747 | 751 | ||
748 | if (folder != null) | 752 | if (folder != null) |
749 | { | 753 | { |
@@ -1155,7 +1159,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1155 | if (item == null) | 1159 | if (item == null) |
1156 | return; | 1160 | return; |
1157 | 1161 | ||
1158 | InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); | 1162 | InventoryFolderBase destFolder = InventoryService.GetFolderForType(remoteClient.AgentId, FolderType.Trash); |
1159 | 1163 | ||
1160 | // Move the item to trash. If this is a copyable item, only | 1164 | // Move the item to trash. If this is a copyable item, only |
1161 | // a copy will be moved and we will still need to delete | 1165 | // a copy will be moved and we will still need to delete |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index cf0762b..5c4e7a9 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -269,7 +269,7 @@ namespace OpenSim.Server.Handlers.Inventory | |||
269 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 269 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
270 | int type = 0; | 270 | int type = 0; |
271 | Int32.TryParse(request["TYPE"].ToString(), out type); | 271 | Int32.TryParse(request["TYPE"].ToString(), out type); |
272 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); | 272 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (FolderType)type); |
273 | if (folder != null) | 273 | if (folder != null) |
274 | result["folder"] = EncodeFolder(folder); | 274 | result["folder"] = EncodeFolder(folder); |
275 | 275 | ||
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index 597d92b..b0615b8 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | |||
@@ -189,7 +189,7 @@ namespace OpenSim.Services.Connectors | |||
189 | return BuildFolder((Dictionary<string, object>)ret["folder"]); | 189 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
190 | } | 190 | } |
191 | 191 | ||
192 | public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 192 | public InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
193 | { | 193 | { |
194 | Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE", | 194 | Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE", |
195 | new Dictionary<string,object> { | 195 | new Dictionary<string,object> { |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index a92c4fb..e793420 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -240,7 +240,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
240 | /// <param name="userID"></param> | 240 | /// <param name="userID"></param> |
241 | /// <param name="type"></param> | 241 | /// <param name="type"></param> |
242 | /// <returns></returns> | 242 | /// <returns></returns> |
243 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 243 | public InventoryFolderBase GetFolderForType(UUID userID, FolderType type) |
244 | { | 244 | { |
245 | string contentType = SLUtil.SLAssetTypeToContentType((int)type); | 245 | string contentType = SLUtil.SLAssetTypeToContentType((int)type); |
246 | 246 | ||
@@ -580,7 +580,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
580 | // A folder of UUID.Zero means we need to find the most appropriate home for this item | 580 | // A folder of UUID.Zero means we need to find the most appropriate home for this item |
581 | if (item.Folder == UUID.Zero) | 581 | if (item.Folder == UUID.Zero) |
582 | { | 582 | { |
583 | InventoryFolderBase folder = GetFolderForType(item.Owner, (AssetType)item.AssetType); | 583 | InventoryFolderBase folder = null; |
584 | if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType)) | ||
585 | folder = GetFolderForType(item.Owner, (FolderType)item.AssetType); | ||
584 | if (folder != null && folder.ID != UUID.Zero) | 586 | if (folder != null && folder.ID != UUID.Zero) |
585 | item.Folder = folder.ID; | 587 | item.Folder = folder.ID; |
586 | else | 588 | else |
diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index 5f245e4..9158b41 100644 --- a/OpenSim/Services/HypergridService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs | |||
@@ -115,7 +115,7 @@ namespace OpenSim.Services.HypergridService | |||
115 | return ConvertToOpenSim(folders[0]); | 115 | return ConvertToOpenSim(folders[0]); |
116 | 116 | ||
117 | // make one | 117 | // make one |
118 | XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase"); | 118 | XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)FolderType.Suitcase, "My Suitcase"); |
119 | return ConvertToOpenSim(suitcase); | 119 | return ConvertToOpenSim(suitcase); |
120 | } | 120 | } |
121 | 121 | ||
@@ -141,7 +141,7 @@ namespace OpenSim.Services.HypergridService | |||
141 | //} | 141 | //} |
142 | 142 | ||
143 | 143 | ||
144 | public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 144 | public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
145 | { | 145 | { |
146 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); | 146 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); |
147 | return GetRootFolder(principalID); | 147 | return GetRootFolder(principalID); |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index d158537..319c2db 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Services.HypergridService | |||
158 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID); | 158 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder. Creating it...", principalID); |
159 | // Create the My Suitcase folder under the user's root folder. | 159 | // Create the My Suitcase folder under the user's root folder. |
160 | // In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order. | 160 | // In the DB we tag it as type 100, but we use type 8 (Folder) outside, as this affects the sort order. |
161 | suitcase = CreateFolder(principalID, root.folderID, InventoryItemBase.SUITCASE_FOLDER_TYPE, InventoryItemBase.SUITCASE_FOLDER_NAME); | 161 | suitcase = CreateFolder(principalID, root.folderID, (int)FolderType.Suitcase, InventoryFolderBase.SUITCASE_FOLDER_NAME); |
162 | if (suitcase == null) | 162 | if (suitcase == null) |
163 | { | 163 | { |
164 | m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); | 164 | m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); |
@@ -178,41 +178,41 @@ namespace OpenSim.Services.HypergridService | |||
178 | m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase..."); | 178 | m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Creating System folders under Suitcase..."); |
179 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID); | 179 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootID); |
180 | 180 | ||
181 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) | 181 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Animation) return true; return false; })) |
182 | CreateFolder(principalID, rootID, (int)AssetType.Animation, "Animations"); | 182 | CreateFolder(principalID, rootID, (int)FolderType.Animation, "Animations"); |
183 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) | 183 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.BodyPart) return true; return false; })) |
184 | CreateFolder(principalID, rootID, (int)AssetType.Bodypart, "Body Parts"); | 184 | CreateFolder(principalID, rootID, (int)FolderType.BodyPart, "Body Parts"); |
185 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) | 185 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CallingCard) return true; return false; })) |
186 | CreateFolder(principalID, rootID, (int)AssetType.CallingCard, "Calling Cards"); | 186 | CreateFolder(principalID, rootID, (int)FolderType.CallingCard, "Calling Cards"); |
187 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) | 187 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Clothing) return true; return false; })) |
188 | CreateFolder(principalID, rootID, (int)AssetType.Clothing, "Clothing"); | 188 | CreateFolder(principalID, rootID, (int)FolderType.Clothing, "Clothing"); |
189 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.CurrentOutfitFolder) return true; return false; })) | 189 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CurrentOutfit) return true; return false; })) |
190 | CreateFolder(principalID, rootID, (int)AssetType.CurrentOutfitFolder, "Current Outfit"); | 190 | CreateFolder(principalID, rootID, (int)FolderType.CurrentOutfit, "Current Outfit"); |
191 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.FavoriteFolder) return true; return false; })) | 191 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Favorites) return true; return false; })) |
192 | CreateFolder(principalID, rootID, (int)AssetType.FavoriteFolder, "Favorites"); | 192 | CreateFolder(principalID, rootID, (int)FolderType.Favorites, "Favorites"); |
193 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) | 193 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Gesture) return true; return false; })) |
194 | CreateFolder(principalID, rootID, (int)AssetType.Gesture, "Gestures"); | 194 | CreateFolder(principalID, rootID, (int)FolderType.Gesture, "Gestures"); |
195 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) | 195 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Landmark) return true; return false; })) |
196 | CreateFolder(principalID, rootID, (int)AssetType.Landmark, "Landmarks"); | 196 | CreateFolder(principalID, rootID, (int)FolderType.Landmark, "Landmarks"); |
197 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) | 197 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LostAndFound) return true; return false; })) |
198 | CreateFolder(principalID, rootID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); | 198 | CreateFolder(principalID, rootID, (int)FolderType.LostAndFound, "Lost And Found"); |
199 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) | 199 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Notecard) return true; return false; })) |
200 | CreateFolder(principalID, rootID, (int)AssetType.Notecard, "Notecards"); | 200 | CreateFolder(principalID, rootID, (int)FolderType.Notecard, "Notecards"); |
201 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) | 201 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Object) return true; return false; })) |
202 | CreateFolder(principalID, rootID, (int)AssetType.Object, "Objects"); | 202 | CreateFolder(principalID, rootID, (int)FolderType.Object, "Objects"); |
203 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) | 203 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Snapshot) return true; return false; })) |
204 | CreateFolder(principalID, rootID, (int)AssetType.SnapshotFolder, "Photo Album"); | 204 | CreateFolder(principalID, rootID, (int)FolderType.Snapshot, "Photo Album"); |
205 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) | 205 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LSLText) return true; return false; })) |
206 | CreateFolder(principalID, rootID, (int)AssetType.LSLText, "Scripts"); | 206 | CreateFolder(principalID, rootID, (int)FolderType.LSLText, "Scripts"); |
207 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) | 207 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Sound) return true; return false; })) |
208 | CreateFolder(principalID, rootID, (int)AssetType.Sound, "Sounds"); | 208 | CreateFolder(principalID, rootID, (int)FolderType.Sound, "Sounds"); |
209 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) | 209 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Texture) return true; return false; })) |
210 | CreateFolder(principalID, rootID, (int)AssetType.Texture, "Textures"); | 210 | CreateFolder(principalID, rootID, (int)FolderType.Texture, "Textures"); |
211 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) | 211 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Trash) return true; return false; })) |
212 | CreateFolder(principalID, rootID, (int)AssetType.TrashFolder, "Trash"); | 212 | CreateFolder(principalID, rootID, (int)FolderType.Trash, "Trash"); |
213 | } | 213 | } |
214 | 214 | ||
215 | public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 215 | public override InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
216 | { | 216 | { |
217 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); | 217 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); |
218 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); | 218 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); |
@@ -468,7 +468,7 @@ namespace OpenSim.Services.HypergridService | |||
468 | { | 468 | { |
469 | XInventoryFolder[] folders = m_Database.GetFolders( | 469 | XInventoryFolder[] folders = m_Database.GetFolders( |
470 | new string[] { "agentID", "folderName", "type" }, | 470 | new string[] { "agentID", "folderName", "type" }, |
471 | new string[] { principalID.ToString(), "My Inventory", ((int)AssetType.RootFolder).ToString() }); | 471 | new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, ((int)FolderType.Root).ToString() }); |
472 | 472 | ||
473 | if (folders != null && folders.Length > 0) | 473 | if (folders != null && folders.Length > 0) |
474 | return folders[0]; | 474 | return folders[0]; |
@@ -476,7 +476,7 @@ namespace OpenSim.Services.HypergridService | |||
476 | // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. | 476 | // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. |
477 | folders = m_Database.GetFolders( | 477 | folders = m_Database.GetFolders( |
478 | new string[] { "agentID", "folderName", "parentFolderID" }, | 478 | new string[] { "agentID", "folderName", "parentFolderID" }, |
479 | new string[] { principalID.ToString(), "My Inventory", UUID.Zero.ToString() }); | 479 | new string[] { principalID.ToString(), InventoryFolderBase.ROOT_FOLDER_NAME, UUID.Zero.ToString() }); |
480 | 480 | ||
481 | if (folders != null && folders.Length > 0) | 481 | if (folders != null && folders.Length > 0) |
482 | return folders[0]; | 482 | return folders[0]; |
@@ -492,7 +492,7 @@ namespace OpenSim.Services.HypergridService | |||
492 | 492 | ||
493 | XInventoryFolder[] folders = m_Database.GetFolders( | 493 | XInventoryFolder[] folders = m_Database.GetFolders( |
494 | new string[] { "agentID", "type", "parentFolderID" }, | 494 | new string[] { "agentID", "type", "parentFolderID" }, |
495 | new string[] { userID.ToString(), ((int)AssetType.CurrentOutfitFolder).ToString(), root.folderID.ToString() }); | 495 | new string[] { userID.ToString(), ((int)FolderType.CurrentOutfit).ToString(), root.folderID.ToString() }); |
496 | 496 | ||
497 | if (folders.Length == 0) | 497 | if (folders.Length == 0) |
498 | return null; | 498 | return null; |
@@ -505,7 +505,7 @@ namespace OpenSim.Services.HypergridService | |||
505 | // Warp! Root folder for travelers | 505 | // Warp! Root folder for travelers |
506 | XInventoryFolder[] folders = m_Database.GetFolders( | 506 | XInventoryFolder[] folders = m_Database.GetFolders( |
507 | new string[] { "agentID", "type" }, | 507 | new string[] { "agentID", "type" }, |
508 | new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_TYPE.ToString() }); // This is a special folder type... | 508 | new string[] { principalID.ToString(), FolderType.Suitcase.ToString() }); |
509 | 509 | ||
510 | if (folders != null && folders.Length > 0) | 510 | if (folders != null && folders.Length > 0) |
511 | return folders[0]; | 511 | return folders[0]; |
@@ -513,13 +513,13 @@ namespace OpenSim.Services.HypergridService | |||
513 | // check to see if we have the old Suitcase folder | 513 | // check to see if we have the old Suitcase folder |
514 | folders = m_Database.GetFolders( | 514 | folders = m_Database.GetFolders( |
515 | new string[] { "agentID", "folderName", "parentFolderID" }, | 515 | new string[] { "agentID", "folderName", "parentFolderID" }, |
516 | new string[] { principalID.ToString(), InventoryItemBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() }); | 516 | new string[] { principalID.ToString(), InventoryFolderBase.SUITCASE_FOLDER_NAME, UUID.Zero.ToString() }); |
517 | if (folders != null && folders.Length > 0) | 517 | if (folders != null && folders.Length > 0) |
518 | { | 518 | { |
519 | // Move it to under the root folder | 519 | // Move it to under the root folder |
520 | XInventoryFolder root = GetRootXFolder(principalID); | 520 | XInventoryFolder root = GetRootXFolder(principalID); |
521 | folders[0].parentFolderID = root.folderID; | 521 | folders[0].parentFolderID = root.folderID; |
522 | folders[0].type = InventoryItemBase.SUITCASE_FOLDER_TYPE; | 522 | folders[0].type = (int)FolderType.Suitcase; |
523 | m_Database.StoreFolder(folders[0]); | 523 | m_Database.StoreFolder(folders[0]); |
524 | return folders[0]; | 524 | return folders[0]; |
525 | } | 525 | } |
@@ -529,7 +529,7 @@ namespace OpenSim.Services.HypergridService | |||
529 | 529 | ||
530 | private void SetAsNormalFolder(XInventoryFolder suitcase) | 530 | private void SetAsNormalFolder(XInventoryFolder suitcase) |
531 | { | 531 | { |
532 | suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | 532 | //suitcase.type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; |
533 | } | 533 | } |
534 | 534 | ||
535 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) | 535 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) |
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 1e8652c..4289bba 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Services.Interfaces | |||
67 | /// <param name="userID"></param> | 67 | /// <param name="userID"></param> |
68 | /// <param name="type"></param> | 68 | /// <param name="type"></param> |
69 | /// <returns></returns> | 69 | /// <returns></returns> |
70 | InventoryFolderBase GetFolderForType(UUID userID, AssetType type); | 70 | InventoryFolderBase GetFolderForType(UUID userID, FolderType type); |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Gets everything (folders and items) inside a folder | 73 | /// Gets everything (folders and items) inside a folder |
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 64f727c..b75193f 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -111,48 +111,48 @@ namespace OpenSim.Services.InventoryService | |||
111 | 111 | ||
112 | if (rootFolder == null) | 112 | if (rootFolder == null) |
113 | { | 113 | { |
114 | rootFolder = ConvertToOpenSim(CreateFolder(principalID, UUID.Zero, (int)AssetType.RootFolder, "My Inventory")); | 114 | rootFolder = ConvertToOpenSim(CreateFolder(principalID, UUID.Zero, (int)FolderType.Root, InventoryFolderBase.ROOT_FOLDER_NAME)); |
115 | result = true; | 115 | result = true; |
116 | } | 116 | } |
117 | 117 | ||
118 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootFolder.ID); | 118 | XInventoryFolder[] sysFolders = GetSystemFolders(principalID, rootFolder.ID); |
119 | 119 | ||
120 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) | 120 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Animation) return true; return false; })) |
121 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Animation, "Animations"); | 121 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Animation, "Animations"); |
122 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) | 122 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.BodyPart) return true; return false; })) |
123 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Bodypart, "Body Parts"); | 123 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.BodyPart, "Body Parts"); |
124 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) | 124 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CallingCard) return true; return false; })) |
125 | { | 125 | { |
126 | XInventoryFolder folder = CreateFolder(principalID, rootFolder.ID, (int)AssetType.CallingCard, "Calling Cards"); | 126 | XInventoryFolder folder = CreateFolder(principalID, rootFolder.ID, (int)FolderType.CallingCard, "Calling Cards"); |
127 | folder = CreateFolder(principalID, folder.folderID, (int)AssetType.CallingCard, "Friends"); | 127 | folder = CreateFolder(principalID, folder.folderID, (int)FolderType.CallingCard, "Friends"); |
128 | CreateFolder(principalID, folder.folderID, (int)AssetType.CallingCard, "All"); | 128 | CreateFolder(principalID, folder.folderID, (int)FolderType.CallingCard, "All"); |
129 | } | 129 | } |
130 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) | 130 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Clothing) return true; return false; })) |
131 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Clothing, "Clothing"); | 131 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Clothing, "Clothing"); |
132 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.CurrentOutfitFolder) return true; return false; })) | 132 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.CurrentOutfit) return true; return false; })) |
133 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.CurrentOutfitFolder, "Current Outfit"); | 133 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.CurrentOutfit, "Current Outfit"); |
134 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.FavoriteFolder) return true; return false; })) | 134 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Favorites) return true; return false; })) |
135 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.FavoriteFolder, "Favorites"); | 135 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Favorites, "Favorites"); |
136 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) | 136 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Gesture) return true; return false; })) |
137 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Gesture, "Gestures"); | 137 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Gesture, "Gestures"); |
138 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) | 138 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Landmark) return true; return false; })) |
139 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Landmark, "Landmarks"); | 139 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Landmark, "Landmarks"); |
140 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) | 140 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LostAndFound) return true; return false; })) |
141 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); | 141 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.LostAndFound, "Lost And Found"); |
142 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) | 142 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Notecard) return true; return false; })) |
143 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Notecard, "Notecards"); | 143 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Notecard, "Notecards"); |
144 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) | 144 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Object) return true; return false; })) |
145 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Object, "Objects"); | 145 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Object, "Objects"); |
146 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) | 146 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Snapshot) return true; return false; })) |
147 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.SnapshotFolder, "Photo Album"); | 147 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Snapshot, "Photo Album"); |
148 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) | 148 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.LSLText) return true; return false; })) |
149 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.LSLText, "Scripts"); | 149 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.LSLText, "Scripts"); |
150 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) | 150 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Sound) return true; return false; })) |
151 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Sound, "Sounds"); | 151 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Sound, "Sounds"); |
152 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) | 152 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Texture) return true; return false; })) |
153 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.Texture, "Textures"); | 153 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Texture, "Textures"); |
154 | if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) | 154 | if (!Array.Exists(sysFolders, delegate(XInventoryFolder f) { if (f.type == (int)FolderType.Trash) return true; return false; })) |
155 | CreateFolder(principalID, rootFolder.ID, (int)AssetType.TrashFolder, "Trash"); | 155 | CreateFolder(principalID, rootFolder.ID, (int)FolderType.Trash, "Trash"); |
156 | 156 | ||
157 | return result; | 157 | return result; |
158 | } | 158 | } |
@@ -228,7 +228,7 @@ namespace OpenSim.Services.InventoryService | |||
228 | XInventoryFolder root = null; | 228 | XInventoryFolder root = null; |
229 | foreach (XInventoryFolder folder in folders) | 229 | foreach (XInventoryFolder folder in folders) |
230 | { | 230 | { |
231 | if (folder.folderName == "My Inventory") | 231 | if (folder.folderName == InventoryFolderBase.ROOT_FOLDER_NAME) |
232 | { | 232 | { |
233 | root = folder; | 233 | root = folder; |
234 | break; | 234 | break; |
@@ -241,7 +241,7 @@ namespace OpenSim.Services.InventoryService | |||
241 | return ConvertToOpenSim(root); | 241 | return ConvertToOpenSim(root); |
242 | } | 242 | } |
243 | 243 | ||
244 | public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 244 | public virtual InventoryFolderBase GetFolderForType(UUID principalID, FolderType type) |
245 | { | 245 | { |
246 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); | 246 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); |
247 | 247 | ||
@@ -259,11 +259,11 @@ namespace OpenSim.Services.InventoryService | |||
259 | return GetSystemFolderForType(rootFolder, type); | 259 | return GetSystemFolderForType(rootFolder, type); |
260 | } | 260 | } |
261 | 261 | ||
262 | private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type) | 262 | private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, FolderType type) |
263 | { | 263 | { |
264 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0}", type); | 264 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0}", type); |
265 | 265 | ||
266 | if (type == AssetType.RootFolder) | 266 | if (type == FolderType.Root) |
267 | return rootFolder; | 267 | return rootFolder; |
268 | 268 | ||
269 | XInventoryFolder[] folders = m_Database.GetFolders( | 269 | XInventoryFolder[] folders = m_Database.GetFolders( |
@@ -363,7 +363,7 @@ namespace OpenSim.Services.InventoryService | |||
363 | if (check != null) | 363 | if (check != null) |
364 | return false; | 364 | return false; |
365 | 365 | ||
366 | if (folder.Type != (short)AssetType.Folder && folder.Type != (short)AssetType.Unknown) | 366 | if (folder.Type != (short)FolderType.None) |
367 | { | 367 | { |
368 | InventoryFolderBase rootFolder = GetRootFolder(folder.Owner); | 368 | InventoryFolderBase rootFolder = GetRootFolder(folder.Owner); |
369 | 369 | ||
@@ -380,7 +380,7 @@ namespace OpenSim.Services.InventoryService | |||
380 | if (folder.ParentID == rootFolder.ID) | 380 | if (folder.ParentID == rootFolder.ID) |
381 | { | 381 | { |
382 | InventoryFolderBase existingSystemFolder | 382 | InventoryFolderBase existingSystemFolder |
383 | = GetSystemFolderForType(rootFolder, (AssetType)folder.Type); | 383 | = GetSystemFolderForType(rootFolder, (FolderType)folder.Type); |
384 | 384 | ||
385 | if (existingSystemFolder != null) | 385 | if (existingSystemFolder != null) |
386 | { | 386 | { |
@@ -407,8 +407,8 @@ namespace OpenSim.Services.InventoryService | |||
407 | if (check == null) | 407 | if (check == null) |
408 | return AddFolder(folder); | 408 | return AddFolder(folder); |
409 | 409 | ||
410 | if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown) | 410 | if ((check.Type != (short)FolderType.None || xFolder.type != (short)FolderType.None) |
411 | && (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder)) | 411 | && (check.Type != (short)FolderType.Outfit || xFolder.type != (short)FolderType.Outfit)) |
412 | { | 412 | { |
413 | if (xFolder.version < check.Version) | 413 | if (xFolder.version < check.Version) |
414 | { | 414 | { |
@@ -672,9 +672,9 @@ namespace OpenSim.Services.InventoryService | |||
672 | 672 | ||
673 | newFolder.ParentID = folder.parentFolderID; | 673 | newFolder.ParentID = folder.parentFolderID; |
674 | newFolder.Type = (short)folder.type; | 674 | newFolder.Type = (short)folder.type; |
675 | // Viewer can't understand anything that's not in it's LLFolderType enum | 675 | //// Viewer can't understand anything that's not in it's LLFolderType enum |
676 | if (newFolder.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) | 676 | //if (newFolder.Type == InventoryItemBase.SUITCASE_FOLDER_TYPE) |
677 | newFolder.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; | 677 | // newFolder.Type = InventoryItemBase.SUITCASE_FOLDER_FAKE_TYPE; |
678 | newFolder.Version = (ushort)folder.version; | 678 | newFolder.Version = (ushort)folder.version; |
679 | newFolder.Name = folder.folderName; | 679 | newFolder.Name = folder.folderName; |
680 | newFolder.Owner = folder.agentID; | 680 | newFolder.Owner = folder.agentID; |
@@ -765,7 +765,7 @@ namespace OpenSim.Services.InventoryService | |||
765 | if (folder.Length < 1) | 765 | if (folder.Length < 1) |
766 | return false; | 766 | return false; |
767 | 767 | ||
768 | if (folder[0].type == (int)AssetType.TrashFolder) | 768 | if (folder[0].type == (int)FolderType.Trash) |
769 | return true; | 769 | return true; |
770 | 770 | ||
771 | UUID parentFolder = folder[0].parentFolderID; | 771 | UUID parentFolder = folder[0].parentFolderID; |
@@ -776,9 +776,9 @@ namespace OpenSim.Services.InventoryService | |||
776 | if (parent.Length < 1) | 776 | if (parent.Length < 1) |
777 | return false; | 777 | return false; |
778 | 778 | ||
779 | if (parent[0].type == (int)AssetType.TrashFolder) | 779 | if (parent[0].type == (int)FolderType.Trash) |
780 | return true; | 780 | return true; |
781 | if (parent[0].type == (int)AssetType.RootFolder) | 781 | if (parent[0].type == (int)FolderType.Root) |
782 | return false; | 782 | return false; |
783 | 783 | ||
784 | parentFolder = parent[0].parentFolderID; | 784 | parentFolder = parent[0].parentFolderID; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index fdf89be..c3756d0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -788,7 +788,7 @@ namespace OpenSim.Services.LLLoginService | |||
788 | Hashtable TempHash; | 788 | Hashtable TempHash; |
789 | foreach (InventoryFolderBase InvFolder in folders) | 789 | foreach (InventoryFolderBase InvFolder in folders) |
790 | { | 790 | { |
791 | if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory") | 791 | if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == InventoryFolderBase.ROOT_FOLDER_NAME) |
792 | { | 792 | { |
793 | rootID = InvFolder.ID; | 793 | rootID = InvFolder.ID; |
794 | } | 794 | } |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 4705445..2e19ece 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -595,7 +595,7 @@ namespace OpenSim.Services.UserAccountService | |||
595 | { | 595 | { |
596 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); | 596 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); |
597 | 597 | ||
598 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Bodypart); | 598 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart); |
599 | 599 | ||
600 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); | 600 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); |
601 | eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); | 601 | eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); |
@@ -657,7 +657,7 @@ namespace OpenSim.Services.UserAccountService | |||
657 | hair.Flags = (uint)WearableType.Hair; | 657 | hair.Flags = (uint)WearableType.Hair; |
658 | m_InventoryService.AddItem(hair); | 658 | m_InventoryService.AddItem(hair); |
659 | 659 | ||
660 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, AssetType.Clothing); | 660 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing); |
661 | 661 | ||
662 | InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); | 662 | InventoryItemBase shirt = new InventoryItemBase(UUID.Random(), principalID); |
663 | shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; | 663 | shirt.AssetID = AvatarWearable.DEFAULT_SHIRT_ASSET; |
diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index b3b75af..5a36332 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | |||
@@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common | |||
102 | { | 102 | { |
103 | return AddInventoryItem( | 103 | return AddInventoryItem( |
104 | scene, itemName, itemId, itemType, asset, userId, | 104 | scene, itemName, itemId, itemType, asset, userId, |
105 | scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type).Name); | 105 | scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name); |
106 | } | 106 | } |
107 | 107 | ||
108 | /// <summary> | 108 | /// <summary> |
diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 2fb0751..0280b73 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | |||
@@ -78,7 +78,7 @@ namespace Robust.Tests | |||
78 | m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID; | 78 | m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID; |
79 | Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero"); | 79 | Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero"); |
80 | 80 | ||
81 | InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, AssetType.Object); | 81 | InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, FolderType.Object); |
82 | Assert.IsNotNull(of, "Failed to retrieve Objects folder"); | 82 | Assert.IsNotNull(of, "Failed to retrieve Objects folder"); |
83 | m_objectsFolder = of.ID; | 83 | m_objectsFolder = of.ID; |
84 | Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero"); | 84 | Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero"); |
@@ -93,7 +93,7 @@ namespace Robust.Tests | |||
93 | success = m_Connector.AddItem(item); | 93 | success = m_Connector.AddItem(item); |
94 | Assert.IsTrue(success, "Failed to add object to inventory"); | 94 | Assert.IsTrue(success, "Failed to add object to inventory"); |
95 | 95 | ||
96 | InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, AssetType.Notecard); | 96 | InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, FolderType.Notecard); |
97 | Assert.IsNotNull(of, "Failed to retrieve Notecards folder"); | 97 | Assert.IsNotNull(of, "Failed to retrieve Notecards folder"); |
98 | m_notecardsFolder = ncf.ID; | 98 | m_notecardsFolder = ncf.ID; |
99 | Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero"); | 99 | Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero"); |
@@ -118,7 +118,7 @@ namespace Robust.Tests | |||
118 | 118 | ||
119 | // Add a folder | 119 | // Add a folder |
120 | InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); | 120 | InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); |
121 | folder.Type = (int)AssetType.Folder; | 121 | folder.Type = (int)FolderType.None; |
122 | success = m_Connector.AddFolder(folder); | 122 | success = m_Connector.AddFolder(folder); |
123 | Assert.IsTrue(success, "Failed to add Test Folder to inventory"); | 123 | Assert.IsTrue(success, "Failed to add Test Folder to inventory"); |
124 | 124 | ||
@@ -133,7 +133,7 @@ namespace Robust.Tests | |||
133 | Assert.IsTrue(success, "Failed to add link to notecard to inventory"); | 133 | Assert.IsTrue(success, "Failed to add link to notecard to inventory"); |
134 | 134 | ||
135 | // Add a link to the Objects folder in Test Folder | 135 | // Add a link to the Objects folder in Test Folder |
136 | item.AssetID = m_Connector.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder | 136 | item.AssetID = m_Connector.GetFolderForType(m_userID, FolderType.Object).ID; // use item ID of Objects folder |
137 | item.ID = new UUID("50000000-0000-0000-0000-000000000005"); | 137 | item.ID = new UUID("50000000-0000-0000-0000-000000000005"); |
138 | item.AssetType = (int)AssetType.LinkFolder; | 138 | item.AssetType = (int)AssetType.LinkFolder; |
139 | item.Folder = folder.ID; | 139 | item.Folder = folder.ID; |