diff options
author | Justin Clarke Casey | 2009-04-28 17:47:09 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-04-28 17:47:09 +0000 |
commit | 52d56288060caca4f92fee9549090390d7053549 (patch) | |
tree | 48836efd21fb682658e12c1bdd785669eeeff84c /OpenSim/Region | |
parent | Correctly handle group owned land in the Datasnapshot module. Will return (diff) | |
download | opensim-SC-52d56288060caca4f92fee9549090390d7053549.zip opensim-SC-52d56288060caca4f92fee9549090390d7053549.tar.gz opensim-SC-52d56288060caca4f92fee9549090390d7053549.tar.bz2 opensim-SC-52d56288060caca4f92fee9549090390d7053549.tar.xz |
* Add preliminary code for resolving iar profile names
* Not yet active
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 26 |
2 files changed, 22 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 2ecb7d4..75e39d1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
57 | /// </value> | 57 | /// </value> |
58 | private Stream m_loadStream; | 58 | private Stream m_loadStream; |
59 | 59 | ||
60 | CommunicationsManager commsManager; | 60 | protected CommunicationsManager m_commsManager; |
61 | 61 | ||
62 | public InventoryArchiveReadRequest( | 62 | public InventoryArchiveReadRequest( |
63 | CachedUserInfo userInfo, string invPath, string loadPath, CommunicationsManager commsManager) | 63 | CachedUserInfo userInfo, string invPath, string loadPath, CommunicationsManager commsManager) |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
75 | m_userInfo = userInfo; | 75 | m_userInfo = userInfo; |
76 | m_invPath = invPath; | 76 | m_invPath = invPath; |
77 | m_loadStream = loadStream; | 77 | m_loadStream = loadStream; |
78 | this.commsManager = commsManager; | 78 | m_commsManager = commsManager; |
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
101 | // | 101 | // |
102 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might | 102 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might |
103 | // use a remote inventory service, though this is vanishingly rare at the moment. | 103 | // use a remote inventory service, though this is vanishingly rare at the moment. |
104 | if (null == commsManager.UserAdminService) | 104 | if (null == m_commsManager.UserAdminService) |
105 | { | 105 | { |
106 | m_log.ErrorFormat( | 106 | m_log.ErrorFormat( |
107 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", | 107 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", |
@@ -156,7 +156,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
156 | // Don't use the item ID that's in the file | 156 | // Don't use the item ID that's in the file |
157 | item.ID = UUID.Random(); | 157 | item.ID = UUID.Random(); |
158 | 158 | ||
159 | item.CreatorId = m_userInfo.UserProfile.ID.ToString(); | 159 | string ospResolvedId = OspResolver.Resolve(item.CreatorId, m_commsManager); |
160 | if (null != ospResolvedId) | ||
161 | item.CreatorId = ospResolvedId; | ||
162 | |||
160 | item.Owner = m_userInfo.UserProfile.ID; | 163 | item.Owner = m_userInfo.UserProfile.ID; |
161 | 164 | ||
162 | // Reset folder ID to the one in which we want to load it | 165 | // Reset folder ID to the one in which we want to load it |
@@ -352,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
352 | asset.Type = assetType; | 355 | asset.Type = assetType; |
353 | asset.Data = data; | 356 | asset.Data = data; |
354 | 357 | ||
355 | commsManager.AssetCache.AddAsset(asset); | 358 | m_commsManager.AssetCache.AddAsset(asset); |
356 | 359 | ||
357 | return true; | 360 | return true; |
358 | } | 361 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 302d214..5ae1cbd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -204,9 +204,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
204 | 204 | ||
205 | string userFirstName = "Mr"; | 205 | string userFirstName = "Mr"; |
206 | string userLastName = "Tiddles"; | 206 | string userLastName = "Tiddles"; |
207 | string folderName = "a"; | 207 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); |
208 | string archiveFolderName | ||
209 | = string.Format("{0}{1}{2}", folderName, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, UUID.Random()); | ||
210 | string itemName = "b.lsl"; | 208 | string itemName = "b.lsl"; |
211 | string archiveItemName | 209 | string archiveItemName |
212 | = string.Format("{0}{1}{2}", itemName, "_", UUID.Random()); | 210 | = string.Format("{0}{1}{2}", itemName, "_", UUID.Random()); |
@@ -218,29 +216,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
218 | item1.Name = itemName; | 216 | item1.Name = itemName; |
219 | item1.AssetID = UUID.Random(); | 217 | item1.AssetID = UUID.Random(); |
220 | item1.GroupID = UUID.Random(); | 218 | item1.GroupID = UUID.Random(); |
219 | item1.CreatorId = userUuid.ToString(); | ||
220 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | ||
221 | item1.Owner = UUID.Parse(item1.CreatorId); | ||
221 | 222 | ||
222 | string item1FileName | 223 | string item1FileName |
223 | = string.Format("{0}{1}/{2}", ArchiveConstants.INVENTORY_PATH, archiveFolderName, archiveItemName); | 224 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); |
224 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 225 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
225 | tar.Close(); | 226 | tar.Close(); |
226 | 227 | ||
227 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 228 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
228 | |||
229 | SerialiserModule serialiserModule = new SerialiserModule(); | 229 | SerialiserModule serialiserModule = new SerialiserModule(); |
230 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 230 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
231 | 231 | ||
232 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 232 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
233 | Scene scene = SceneSetupHelpers.SetupScene(); | 233 | Scene scene = SceneSetupHelpers.SetupScene(); |
234 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 234 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
235 | scene.CommsManager.UserAdminService.AddUser(userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000); | 235 | scene.CommsManager.UserAdminService.AddUser( |
236 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | ||
236 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); | 237 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); |
237 | 238 | ||
238 | CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 239 | CachedUserInfo userInfo |
239 | InventoryFolderImpl foundFolder = userInfo.RootFolder.FindFolderByPath(folderName); | 240 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
240 | Assert.That(foundFolder, Is.Not.Null, string.Format("Folder {0} not found on load", folderName)); | 241 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); |
241 | 242 | ||
242 | InventoryItemBase foundItem = foundFolder.FindItemByPath(itemName); | 243 | // Currently, creator and ownership both revert to the loader |
243 | Assert.That(foundItem, Is.Not.Null, string.Format("Item {0} not found on load", itemName)); | 244 | Assert.That(foundItem.CreatorId, Is.EqualTo(userUuid.ToString())); |
245 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); | ||
244 | 246 | ||
245 | Console.WriteLine("Finished TestLoadIarV0p1()"); | 247 | Console.WriteLine("Finished TestLoadIarV0p1()"); |
246 | } | 248 | } |