From b5eaea7b0c627c55544f4099b50e9ac1a504fe17 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 2 Oct 2007 00:00:12 +0000 Subject: * Moved setup of LocalInventoryService and LocalUserServices to the app layer * Killed off 'parent' relation from LocalUserServices to CommunicationsLocal * Deleted obsolete project InventoryServiceBase * Deleted superfluous createCol function --- OpenSim/Region/Application/OpenSimMain.cs | 9 +++++++-- OpenSim/Region/Communications/Local/CommunicationsLocal.cs | 8 ++------ OpenSim/Region/Communications/Local/LocalUserServices.cs | 14 +++++++------- OpenSim/Region/Examples/SimpleApp/Program.cs | 8 ++++++-- 4 files changed, 22 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index dad6afd..e0ea212 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -157,8 +157,13 @@ namespace OpenSim if (m_sandbox) { - CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin, standaloneUserPlugin); - CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings); + CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin); + + LocalInventoryService inventoryService = new LocalInventoryService(); + LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService ); + userService.AddPlugin( standaloneUserPlugin ); + + CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings, userService); m_commsManager = localComms; if (standaloneAuthenticate) { diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index a00b35f..76814cf 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -39,15 +39,13 @@ namespace OpenSim.Region.Communications.Local { public class CommunicationsLocal : CommunicationsManager { - public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) + public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings, LocalUserServices userService) : base(serversInfo, httpServer, assetCache) { LocalInventoryService inventoryService = new LocalInventoryService(); inventoryService.AddPlugin(settings.InventoryPlugin); m_inventoryService = inventoryService; - LocalUserServices userService = new LocalUserServices(this, serversInfo); - userService.AddPlugin(settings.UserDatabasePlugin); m_userService = userService; LocalBackEndServices backendService = new LocalBackEndServices(); @@ -118,14 +116,12 @@ namespace OpenSim.Region.Communications.Local public string WelcomeMessage; public bool AccountAuthentication = false; public string InventoryPlugin; - public string UserDatabasePlugin; - public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin, string userPlugin) + public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin) { WelcomeMessage = welcomeMessage; AccountAuthentication = accountsAuthenticate; InventoryPlugin = inventoryPlugin; - UserDatabasePlugin = userPlugin; } } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 3bc4301..9e81fb8 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -8,20 +8,20 @@ namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase { - private readonly CommunicationsLocal m_parent; - private readonly NetworkServersInfo m_serversInfo; private readonly uint m_defaultHomeX; private readonly uint m_defaultHomeY; + private IInventoryServices m_inventoryService; - public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) + public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, IInventoryServices inventoryService) { - m_parent = parent; m_serversInfo = serversInfo; - m_defaultHomeX = m_serversInfo.DefaultHomeLocX; - m_defaultHomeY = m_serversInfo.DefaultHomeLocY; + m_defaultHomeX = defaultHomeLocX; + m_defaultHomeY = defaultHomeLocY; + + m_inventoryService = inventoryService; } public override UserProfileData SetupMasterUser(string firstName, string lastName) @@ -48,7 +48,7 @@ namespace OpenSim.Region.Communications.Local } else { - m_parent.InventoryService.CreateNewUserInventory(profile.UUID); + m_inventoryService.CreateNewUserInventory(profile.UUID); } return profile; diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index d693cce..eafa500 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -41,8 +41,12 @@ namespace SimpleApp { base.StartUp(); - CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings("", false, "", ""); - m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings); + CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings("", false, ""); + + LocalInventoryService inventoryService = new LocalInventoryService(); + LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); + + m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings, userService ); m_log.Notice(m_log.LineInfo); -- cgit v1.1