From 0f367bd7bbc5d22d4834e1eb0f1671381485143e Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 10 Jun 2009 13:18:32 +0000 Subject: Heart surgery no.2: the inventory service hooks. Several improvements in the connectors themselves. Several improvements in configurations. Needed to add a hack in IUserService and UserManagerBase, to be removed when that service is refactored. --- .../Framework/Communications/UserManagerBase.cs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications/UserManagerBase.cs') diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index c3aaa4b..898239d 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -37,6 +37,7 @@ using OpenMetaverse.StructuredData; using OpenSim.Data; using OpenSim.Framework.Communications; using OpenSim.Framework.Statistics; +using OpenSim.Services.Interfaces; namespace OpenSim.Framework.Communications { @@ -54,6 +55,7 @@ namespace OpenSim.Framework.Communications private List m_plugins = new List(); protected CommunicationsManager m_commsManager; + protected IInventoryService m_InventoryService; /// /// Constructor @@ -64,6 +66,11 @@ namespace OpenSim.Framework.Communications m_commsManager = commsManager; } + public virtual void SetInventoryService(IInventoryService invService) + { + m_InventoryService = invService; + } + /// /// Add a new user data plugin - plugins will be requested in the order they were added. /// @@ -676,7 +683,24 @@ namespace OpenSim.Framework.Communications } else { - m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID); + // + // WARNING: This is a horrible hack + // The purpose here is to avoid touching the user server at this point. + // There are dragons there that I can't deal with right now. + // diva 06/09/09 + // + if (m_InventoryService != null) + { + // local service (standalone) + m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory"); + m_InventoryService.CreateUserInventory(userProf.ID); + } + else + { + // used by the user server + m_log.Debug("[USERSTORAGE]: using m_commsManager.InterServiceInventoryService to create user's inventory"); + m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID); + } return userProf.ID; } -- cgit v1.1