From 342126b7b9ca386f9160daecb51ecc14487a5f9f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 22 Apr 2009 22:19:43 +0000 Subject: * Resolve http://opensimulator.org/mantis/view.php?id=3509 by putting some service initialization into CommsManager * What is really needed is a plugin and interface request system as being done for region modules --- .../Hypergrid/HGCommunicationsStandalone.cs | 37 +++++++++++++++++----- .../Communications/Hypergrid/HGUserServices.cs | 8 ----- .../Communications/Local/CommunicationsLocal.cs | 24 ++++++++------ .../Communications/Local/LocalUserServices.cs | 6 ++-- .../Region/Communications/OGS1/OGS1UserServices.cs | 5 +-- 5 files changed, 48 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs index b649a91..126f42b 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsStandalone.cs @@ -25,32 +25,53 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Communications.Local; +using OpenSim.Region.Communications.OGS1; namespace OpenSim.Region.Communications.Hypergrid { - public class HGCommunicationsStandalone : CommunicationsLocal + public class HGCommunicationsStandalone : CommunicationsManager { public HGCommunicationsStandalone( + ConfigSettings configSettings, NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, - IUserService userService, - IUserAdminService userServiceAdmin, LocalInventoryService inventoryService, - HGGridServices gridService, IMessagingService messageService, LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) - : base(serversInfo, httpServer, assetCache, userService, userServiceAdmin, inventoryService, gridService, messageService, libraryRootFolder, dumpAssetsToFile) - { - gridService.UserProfileCache = m_userProfileCacheService; + HGGridServices gridService, + LibraryRootFolder libraryRootFolder, + bool dumpAssetsToFile) + : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder) + { + LocalUserServices localUserService = + new LocalUserServices( + serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); + localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); + + AddInventoryService(inventoryService); + m_defaultInventoryHost = inventoryService.Host; + m_interServiceInventoryService = inventoryService; + m_assetCache = assetCache; // Let's swap to always be secure access to inventory AddSecureInventoryService((ISecureInventoryService)inventoryService); m_inventoryServices = null; + + HGUserServices hgUserService = new HGUserServices(this, localUserService); + // This plugin arrangement could eventually be configurable rather than hardcoded here. + hgUserService.AddPlugin(new OGS1UserDataPlugin(this)); + + m_userService = hgUserService; + m_userAdminService = hgUserService; + m_avatarService = hgUserService; + m_messageService = hgUserService; + + gridService.UserProfileCache = m_userProfileCacheService; + m_gridService = gridService; } } } diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs index 25c6341..93d5434 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs @@ -47,7 +47,6 @@ namespace OpenSim.Region.Communications.Hypergrid { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - //private CommunicationsManager m_parent; //private OGS1UserServices m_remoteUserServices; private LocalUserServices m_localUserServices; @@ -64,12 +63,6 @@ namespace OpenSim.Region.Communications.Hypergrid m_localUserServices = local; } - // Called for standalone mode only, to set up the communications manager - public void SetCommunicationsManager(CommunicationsManager parent) - { - m_commsManager = parent; - } - /// /// Get a user agent from the user server /// @@ -84,7 +77,6 @@ namespace OpenSim.Region.Communications.Hypergrid return base.GetAgentByUUID(userId); } - /// /// Logs off a user on the user server /// diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 59a1293..c17f799 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -35,24 +35,30 @@ namespace OpenSim.Region.Communications.Local public class CommunicationsLocal : CommunicationsManager { public CommunicationsLocal( + ConfigSettings configSettings, NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, - IUserService userService, - IUserAdminService userServiceAdmin, LocalInventoryService inventoryService, - IGridServices gridService, IMessagingService messageService, - LibraryRootFolder libraryRootFolder, bool dumpAssetsToFile) + IGridServices gridService, + LibraryRootFolder libraryRootFolder, + bool dumpAssetsToFile) : base(serversInfo, httpServer, assetCache, dumpAssetsToFile, libraryRootFolder) { AddInventoryService(inventoryService); m_defaultInventoryHost = inventoryService.Host; m_interServiceInventoryService = inventoryService; - m_userService = userService; - m_userAdminService = userServiceAdmin; - m_avatarService = (IAvatarService)userService; - m_gridService = gridService; - m_messageService = messageService; + + LocalUserServices lus + = new LocalUserServices( + serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); + lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); + m_userService = lus; + m_userAdminService = lus; + m_avatarService = lus; + m_messageService = lus; + + m_gridService = gridService; } } } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index eb60610..7412500 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -45,10 +45,10 @@ namespace OpenSim.Region.Communications.Local /// /// /// - /// + /// public LocalUserServices( - uint defaultHomeLocX, uint defaultHomeLocY, IInterServiceInventoryServices interServiceInventoryService) - : base(interServiceInventoryService) + uint defaultHomeLocX, uint defaultHomeLocY, CommunicationsManager commsManager) + : base(commsManager) { m_defaultHomeX = defaultHomeLocX; m_defaultHomeY = defaultHomeLocY; diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 5f77107..fee17ac 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -46,12 +46,9 @@ namespace OpenSim.Region.Communications.OGS1 { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected CommunicationsManager m_commsManager; - public OGS1UserServices(CommunicationsManager commsManager) - : base(commsManager.InterServiceInventoryService) + : base(commsManager) { - m_commsManager = commsManager; } public override void ClearUserAgent(UUID avatarID) -- cgit v1.1