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,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);
}
}
/// <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));