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.

0.6.4-rc1
MW 2009-03-06 09:57:31 +00:00
parent 16b6a00005
commit 498dda1901
1 changed files with 46 additions and 36 deletions

View File

@ -110,13 +110,25 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
}
}
private void InitialiseCommsManager(OpenSimBase openSim)
protected void InitialiseCommsManager(OpenSimBase openSim)
{
LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile);
bool hgrid = m_openSim.ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false);
if (hgrid)
{
InitialiseHGServices(openSim, libraryRootFolder);
}
else
{
InitialiseStandardServices(libraryRootFolder);
}
openSim.CommunicationsManager = m_commsManager;
}
protected void InitialiseHGServices(OpenSimBase openSim, LibraryRootFolder libraryRootFolder)
{
HGOpenSimNode hgNode = null;
try
@ -128,6 +140,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
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);
}
@ -143,7 +156,8 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
}
hgNode.HGServices = HGServices;
}
else
protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder)
{
// Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false)
if (m_openSim.ConfigurationSettings.Standalone)
@ -157,9 +171,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
}
}
openSim.CommunicationsManager = m_commsManager;
}
/// <summary>
/// Initialises the backend services for standalone mode, and registers some http handlers
/// </summary>
@ -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));