From 45342067f5f5d5f6ca86f9ed179f275ed6131fea Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Jun 2009 15:41:53 +0000 Subject: [PATCH] * Move standalone login setup in LLStandaloneLoginmodule to RegionLoaded() from AddRegion() * This is necessary to avoid a dependency problem where LLStandaloneLoginModule references IInventoryService before the LocalInventoryServiceConnector is registered * Correct some copypasta log messages in LocalInventoryServiceConnector --- .../Client/Linden/LLStandaloneLoginModule.cs | 61 ++++++++++--------- .../LocalInventoryServiceConnector.cs | 11 ++-- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index bfafdc35da..cc5f5ff498 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs @@ -98,35 +98,6 @@ namespace OpenSim.Client.Linden public void AddRegion(Scene scene) { - if (m_firstScene == null) - { - m_firstScene = scene; - - if (m_enabled) - { - //TODO: fix casting. - LibraryRootFolder rootFolder - = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - - IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; - - //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference - m_loginService = new LLStandaloneLoginService((UserManagerBase)m_firstScene.CommsManager.UserAdminService, welcomeMessage, m_firstScene.InventoryService, m_firstScene.CommsManager.NetworkServersInfo, authenticate, rootFolder, this); - - httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); - - // provides the web form login - httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); - - // Provides the LLSD login - httpServer.SetDefaultLLSDHandler(m_loginService.LLSDLoginMethod); - } - } - - if (m_enabled) - { - AddScene(scene); - } } public void RemoveRegion(Scene scene) @@ -149,7 +120,39 @@ namespace OpenSim.Client.Linden public void RegionLoaded(Scene scene) { + if (m_firstScene == null) + { + m_firstScene = scene; + if (m_enabled) + { + //TODO: fix casting. + LibraryRootFolder rootFolder + = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; + + IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; + + //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference + m_loginService + = new LLStandaloneLoginService( + (UserManagerBase)m_firstScene.CommsManager.UserAdminService, welcomeMessage, + m_firstScene.InventoryService, m_firstScene.CommsManager.NetworkServersInfo, authenticate, + rootFolder, this); + + httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); + + // provides the web form login + httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); + + // Provides the LLSD login + httpServer.SetDefaultLLSDHandler(m_loginService.LLSDLoginMethod); + } + } + + if (m_enabled) + { + AddScene(scene); + } } public string Name diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs index 69a37a9cd3..bc833c3257 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs @@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory //} m_Enabled = true; - m_log.Info("[INVENTORY CONNECTOR]: Local asset connector enabled"); + m_log.Info("[INVENTORY CONNECTOR]: Local inventory connector enabled"); } } } @@ -120,6 +120,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory public void AddRegion(Scene scene) { + m_log.DebugFormat("HEEEERE"); if (!m_Enabled) return; @@ -131,8 +132,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory m_Initialized = true; } + m_log.DebugFormat( + "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); + scene.RegisterModuleInterface(this); - } public void RemoveRegion(Scene scene) @@ -144,8 +147,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory if (!m_Enabled) return; - m_log.InfoFormat("[INVENTORY CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName); - + m_log.InfoFormat( + "[INVENTORY CONNECTOR]: Enabled local invnetory for region {0}", scene.RegionInfo.RegionName); } #region IInventoryService