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/Region/CoreModules/Avatar | |
parent | Have osAvatarName2Key check the cache first, even for foreign users (diff) | |
download | opensim-SC-959872315f67a1a33a2bae7330749f7dd74a4774.zip opensim-SC-959872315f67a1a33a2bae7330749f7dd74a4774.tar.gz opensim-SC-959872315f67a1a33a2bae7330749f7dd74a4774.tar.bz2 opensim-SC-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/Region/CoreModules/Avatar')
7 files changed, 22 insertions, 26 deletions
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)); |