From 498dda1901512c67130fbceb6324eb5d1a61631f Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 6 Mar 2009 09:57:31 +0000 Subject: Added a output message to CreateCommsManagerPlugin for when a user tries to run with both -hypergrid=true and -background=true command line arguments. As these two don't work together as they initialise different root OpenSim classes. I was going to change it back to the old behaviour where in that usecase it would just startup in the background but without hyerpgrid enabled. But think its better to give a error about this and then exit, so the user knows to change their settings. Rather than later wondering why hypergrid isn't working. --- .../CreateCommsManager/CreateCommsManagerPlugin.cs | 82 ++++++++++++---------- 1 file changed, 46 insertions(+), 36 deletions(-) (limited to 'OpenSim/ApplicationPlugins/CreateCommsManager') diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs index e6b4a89..ec14b97 100644 --- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs +++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs @@ -110,7 +110,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager } } - private void InitialiseCommsManager(OpenSimBase openSim) + protected void InitialiseCommsManager(OpenSimBase openSim) { LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile); @@ -118,48 +118,59 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager if (hgrid) { - HGOpenSimNode hgNode = null; - try - { - hgNode = (HGOpenSimNode)openSim; - } - catch (Exception e) - { - m_log.Error("[CreateComms] " + e.Message); - m_log.Error("[CreateComms] The OpenSim application class was : " + openSim.ToString()); - m_log.Error("[CreateComms] To use hypergrid mode, please make sure you are starting opensim with the command line: opensim.exe -hypergrid=true"); - Environment.Exit(1); - } - - // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) - if (m_openSim.ConfigurationSettings.Standalone) - { - InitialiseHGStandaloneServices(libraryRootFolder); - } - else - { - // We are in grid mode - InitialiseHGGridServices(libraryRootFolder); - } - hgNode.HGServices = HGServices; + InitialiseHGServices(openSim, libraryRootFolder); } else { - // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) - if (m_openSim.ConfigurationSettings.Standalone) - { - InitialiseStandaloneServices(libraryRootFolder); - } - else - { - // We are in grid mode - InitialiseGridServices(libraryRootFolder); - } + InitialiseStandardServices(libraryRootFolder); } openSim.CommunicationsManager = m_commsManager; } + protected void InitialiseHGServices(OpenSimBase openSim, LibraryRootFolder libraryRootFolder) + { + HGOpenSimNode hgNode = null; + try + { + hgNode = (HGOpenSimNode)openSim; + } + catch (Exception e) + { + m_log.Error("[CreateComms] " + e.Message); + m_log.Error("[CreateComms] The OpenSim application class was : " + openSim.ToString()); + m_log.Error("[CreateComms] To use hypergrid mode, please make sure you are starting opensim with the command line: opensim.exe -hypergrid=true"); + m_log.Error("[CreateComms] Also hypergrid mode can not be ran while using the -background=true command line argument."); + Environment.Exit(1); + } + + // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) + if (m_openSim.ConfigurationSettings.Standalone) + { + InitialiseHGStandaloneServices(libraryRootFolder); + } + else + { + // We are in grid mode + InitialiseHGGridServices(libraryRootFolder); + } + hgNode.HGServices = HGServices; + } + + protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder) + { + // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false) + if (m_openSim.ConfigurationSettings.Standalone) + { + InitialiseStandaloneServices(libraryRootFolder); + } + else + { + // We are in grid mode + InitialiseGridServices(libraryRootFolder); + } + } + /// /// Initialises the backend services for standalone mode, and registers some http handlers /// @@ -252,7 +263,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager private void CreateGridInfoService() { // 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_openSim.ConfigSource.Source); m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); -- cgit v1.1