From f8e0653e73932bae20f483e0ce669f1623c6ff1e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 5 May 2009 16:45:21 +0000 Subject: * If an item creator id contains an iar loaded name, create a temporary profile and hashed UUID to represent the user --- .../Hypergrid/HGCommunicationsStandalone.cs | 18 ++++++++++++++++- .../Communications/Local/CommunicationsLocal.cs | 23 ++++++++++++++++++---- .../Archiver/InventoryArchiveReadRequest.cs | 6 +++--- .../Archiver/Tests/InventoryArchiverTests.cs | 9 ++++++--- 4 files changed, 45 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs index f5789b7..5c2fe33 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs @@ -25,9 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; +using OpenSim.Data; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; +using OpenSim.Framework.Communications.Osp; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Communications.Local; @@ -42,7 +45,6 @@ namespace OpenSim.Region.Communications.Hypergrid NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, - LocalInventoryService inventoryService, HGGridServices gridService, LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) @@ -52,10 +54,24 @@ namespace OpenSim.Region.Communications.Hypergrid new LocalUserServices( serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); + + HGInventoryServiceClient inventoryService + = new HGInventoryServiceClient(serversInfo.InventoryURL, null, false); + List plugins + = DataPluginFactory.LoadDataPlugins( + configSettings.StandaloneInventoryPlugin, + configSettings.StandaloneInventorySource); + + foreach (IInventoryDataPlugin plugin in plugins) + { + // Using the OSP wrapper plugin should be made configurable at some point + inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); + } AddInventoryService(inventoryService); m_defaultInventoryHost = inventoryService.Host; m_interServiceInventoryService = inventoryService; + inventoryService.UserProfileCache = UserProfileCacheService; m_assetCache = assetCache; // Let's swap to always be secure access to inventory diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index acb7496..60feee1 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -25,9 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; +using OpenSim.Data; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; +using OpenSim.Framework.Communications.Osp; using OpenSim.Framework.Servers.HttpServer; namespace OpenSim.Region.Communications.Local @@ -39,12 +42,22 @@ namespace OpenSim.Region.Communications.Local NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, - LocalInventoryService inventoryService, - IGridServices gridService, LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder) { + LocalInventoryService inventoryService = new LocalInventoryService(); + List plugins + = DataPluginFactory.LoadDataPlugins( + configSettings.StandaloneInventoryPlugin, + configSettings.StandaloneInventorySource); + + foreach (IInventoryDataPlugin plugin in plugins) + { + // Using the OSP wrapper plugin for database plugins should be made configurable at some point + inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this)); + } + AddInventoryService(inventoryService); m_defaultInventoryHost = inventoryService.Host; m_interServiceInventoryService = inventoryService; @@ -58,8 +71,10 @@ namespace OpenSim.Region.Communications.Local m_userAdminService = lus; m_avatarService = lus; m_messageService = lus; - - m_gridService = gridService; + + m_gridService = new LocalBackEndServices(); + + //LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService); } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index bf3097a..b0c1d0b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -157,9 +157,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Don't use the item ID that's in the file item.ID = UUID.Random(); - string ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); - if (null != ospResolvedId) - item.CreatorId = ospResolvedId; + UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); + if (UUID.Zero != ospResolvedId) + item.CreatorIdAsUuid = ospResolvedId; item.Owner = m_userInfo.UserProfile.ID; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 274e329..4c6045a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -253,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); - Assert.That(foundItem.CreatorId, Is.EqualTo(user2Uuid.ToString())); + Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); + Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid)); Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); @@ -321,8 +322,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); - Assert.That(foundItem.CreatorId, Is.EqualTo(user2Profile.ID.ToString())); - Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); + Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); + Assert.That( + foundItem.CreatorIdAsUuid, Is.EqualTo(OspResolver.HashName(user2FirstName + " " + user2LastName))); + Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); Console.WriteLine("### Successfully completed {0} ###", MethodBase.GetCurrentMethod()); } -- cgit v1.1