From e2d30a02446c8b5d1b8be090f4ccc1fc98d019f5 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 26 Feb 2009 21:30:12 +0000 Subject: Moved the Initialisation of the CommunicationsManager to a ApplicationPlugin. Also in that plugin it registers the IUserService with all the Scenes (as they are created). So now we can start changing over all uses of IUserService, that currently access it from the CommunicationsManager to accessing it from the Scene.RequestModuleInterface call. Once that is done we can move the UserService creation out to its own plugin and remove all references to it from the CommunicationsManager. Then we can take the next CommunicationsManager interface and repeat. --- OpenSim/Region/Application/HGOpenSimNode.cs | 74 ++++++++-------- OpenSim/Region/Application/OpenSimBase.cs | 125 ++++++++++++++-------------- 2 files changed, 98 insertions(+), 101 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs index 1130c70..b0be40d 100644 --- a/OpenSim/Region/Application/HGOpenSimNode.cs +++ b/OpenSim/Region/Application/HGOpenSimNode.cs @@ -73,57 +73,57 @@ namespace OpenSim } - protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) - { - // Standalone mode + //protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) + //{ + // // Standalone mode - HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false); - inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); + // HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false); + // inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); - LocalUserServices userService = - new LocalUserServices( - m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); - userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); + // LocalUserServices userService = + // new LocalUserServices( + // m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); + // userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); - //LocalBackEndServices backendService = new LocalBackEndServices(); - HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager); + // //LocalBackEndServices backendService = new LocalBackEndServices(); + // HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager); - LocalLoginService loginService = - new LocalLoginService( - userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo, - m_configSettings.StandaloneAuthenticate, libraryRootFolder); + // LocalLoginService loginService = + // new LocalLoginService( + // userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo, + // m_configSettings.StandaloneAuthenticate, libraryRootFolder); - m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache, - userService, userService, inventoryService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile); + // m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache, + // userService, userService, inventoryService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile); - inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; - HGServices = gridService; + // inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; + // HGServices = gridService; - // set up XMLRPC handler for client's initial login request message - m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); + // // set up XMLRPC handler for client's initial login request message + // m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); - // provides the web form login - m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); + // // provides the web form login + // m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); - // Provides the LLSD login - m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); + // // Provides the LLSD login + // m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); - // provide grid info - // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); - m_gridInfoService = new GridInfoService(m_config.Source); - m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); - m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); - } + // // provide grid info + // // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); + // m_gridInfoService = new GridInfoService(m_config.Source); + // m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); + // m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); + //} - protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder) - { - m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder); + //protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder) + //{ + // m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder); - HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; + // HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; - m_httpServer.AddStreamHandler(new SimStatusHandler()); - } + // m_httpServer.AddStreamHandler(new SimStatusHandler()); + //} protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 6045dc0..3f7c757 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -186,28 +186,25 @@ namespace OpenSim LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_configSettings.LibrariesXMLFile); - // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) - if (m_configSettings.Standalone) - { - InitialiseStandaloneServices(libraryRootFolder); - } - else - { - // We are in grid mode - InitialiseGridServices(libraryRootFolder); - } + //// Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) + //if (m_configSettings.Standalone) + //{ + // InitialiseStandaloneServices(libraryRootFolder); + //} + //else + //{ + // // We are in grid mode + // InitialiseGridServices(libraryRootFolder); + //} // Create a ModuleLoader instance m_moduleLoader = new ModuleLoader(m_config.Source); - LoadPlugins(); - - + LoadPlugins(); foreach (IApplicationPlugin plugin in m_plugins) { plugin.PostInitialise(); } - // Only enable logins to the regions once we have completely finished starting up (apart from scripts) if ((m_commsManager != null) && (m_commsManager.GridService != null)) @@ -272,56 +269,56 @@ namespace OpenSim m_console.Notice(moduleCommander.Help); } - /// - /// Initialises the backend services for standalone mode, and registers some http handlers - /// - /// - protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) - { - LocalInventoryService inventoryService = new LocalInventoryService(); - inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); - - LocalUserServices userService = - new LocalUserServices( - m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); - userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); - - LocalBackEndServices backendService = new LocalBackEndServices(); - - LocalLoginService loginService = - new LocalLoginService( - userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_networkServersInfo, - m_configSettings.StandaloneAuthenticate, libraryRootFolder); - - m_commsManager - = new CommunicationsLocal( - m_networkServersInfo, m_httpServer, m_assetCache, userService, userService, - inventoryService, backendService, userService, - libraryRootFolder, m_configSettings.DumpAssetsToFile); - - // set up XMLRPC handler for client's initial login request message - m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); - - // provides the web form login - m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); - - // Provides the LLSD login - m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); - - // provide grid info - // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); - m_gridInfoService = new GridInfoService(m_config.Source); - m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); - m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); - } - - protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder) - { - m_commsManager - = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder); - - m_httpServer.AddStreamHandler(new SimStatusHandler()); - } + ///// + ///// Initialises the backend services for standalone mode, and registers some http handlers + ///// + ///// + //protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) + //{ + // LocalInventoryService inventoryService = new LocalInventoryService(); + // inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); + + // LocalUserServices userService = + // new LocalUserServices( + // m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); + // userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); + + // LocalBackEndServices backendService = new LocalBackEndServices(); + + // LocalLoginService loginService = + // new LocalLoginService( + // userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_networkServersInfo, + // m_configSettings.StandaloneAuthenticate, libraryRootFolder); + + // m_commsManager + // = new CommunicationsLocal( + // m_networkServersInfo, m_httpServer, m_assetCache, userService, userService, + // inventoryService, backendService, userService, + // libraryRootFolder, m_configSettings.DumpAssetsToFile); + + // // set up XMLRPC handler for client's initial login request message + // m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); + + // // provides the web form login + // m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); + + // // Provides the LLSD login + // m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); + + // // provide grid info + // // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); + // m_gridInfoService = new GridInfoService(m_config.Source); + // m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); + // m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); + //} + + //protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder) + //{ + // m_commsManager + // = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder); + + // m_httpServer.AddStreamHandler(new SimStatusHandler()); + //} protected override void Initialize() { -- cgit v1.1