From 959872315f67a1a33a2bae7330749f7dd74a4774 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 8 Aug 2015 12:12:50 -0700 Subject: 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! --- .../RemoteController/RemoteAdminPlugin.cs | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'OpenSim/ApplicationPlugins') 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 try { Dictionary inventoryMap = new Dictionary(); - CopyInventoryFolders(destination, source, AssetType.Clothing, inventoryMap, avatarAppearance); - CopyInventoryFolders(destination, source, AssetType.Bodypart, inventoryMap, avatarAppearance); + CopyInventoryFolders(destination, source, FolderType.Clothing, inventoryMap, avatarAppearance); + CopyInventoryFolders(destination, source, FolderType.BodyPart, inventoryMap, avatarAppearance); AvatarWearable[] wearables = avatarAppearance.Wearables; @@ -2576,20 +2576,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; // Get Clothing folder of receiver - InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing); + InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, FolderType.Clothing); if (destinationFolder == null) throw new Exception("Cannot locate folder(s)"); // Missing destination folder? This should *never* be the case - if (destinationFolder.Type != (short)AssetType.Clothing) + if (destinationFolder.Type != (short)FolderType.Clothing) { destinationFolder = new InventoryFolderBase(); destinationFolder.ID = UUID.Random(); destinationFolder.Name = "Clothing"; destinationFolder.Owner = destination; - destinationFolder.Type = (short)AssetType.Clothing; + destinationFolder.Type = (short)FolderType.Clothing; destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; destinationFolder.Version = 1; inventoryService.AddFolder(destinationFolder); // store base record @@ -2707,7 +2707,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// This method is called by establishAppearance to copy inventory folders to make /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments /// - private void CopyInventoryFolders(UUID destination, UUID source, AssetType assetType, Dictionary inventoryMap, + private void CopyInventoryFolders(UUID destination, UUID source, FolderType assetType, Dictionary inventoryMap, AvatarAppearance avatarAppearance) { IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; @@ -2723,9 +2723,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController { sourceFolder = new InventoryFolderBase(); sourceFolder.ID = UUID.Random(); - if (assetType == AssetType.Clothing) { + if (assetType == FolderType.Clothing) + { sourceFolder.Name = "Clothing"; - } else { + } + else + { sourceFolder.Name = "Body Parts"; } sourceFolder.Owner = source; @@ -2741,7 +2744,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController { destinationFolder = new InventoryFolderBase(); destinationFolder.ID = UUID.Random(); - if (assetType == AssetType.Clothing) + if (assetType == FolderType.Clothing) { destinationFolder.Name = "Clothing"; } @@ -2980,16 +2983,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", // uic.folders.Count, uic.items.Count); - InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, AssetType.Clothing); + InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, FolderType.Clothing); // This should *never* be the case - if (clothingFolder == null || clothingFolder.Type != (short)AssetType.Clothing) + if (clothingFolder == null || clothingFolder.Type != (short)FolderType.Clothing) { clothingFolder = new InventoryFolderBase(); clothingFolder.ID = UUID.Random(); clothingFolder.Name = "Clothing"; clothingFolder.Owner = ID; - clothingFolder.Type = (short)AssetType.Clothing; + clothingFolder.Type = (short)FolderType.Clothing; clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; clothingFolder.Version = 1; inventoryService.AddFolder(clothingFolder); // store base record @@ -3035,7 +3038,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController extraFolder.ID = UUID.Random(); extraFolder.Name = outfitName; extraFolder.Owner = ID; - extraFolder.Type = (short)AssetType.Clothing; + extraFolder.Type = (short)FolderType.Clothing; extraFolder.Version = 1; extraFolder.ParentID = clothingFolder.ID; inventoryService.AddFolder(extraFolder); -- cgit v1.1