more startup/initialisation refactoring
parent
2a249373d3
commit
079469b3f5
|
@ -21,12 +21,12 @@ namespace OpenSim.Framework
|
||||||
set { m_meshEngineName = value; }
|
set { m_meshEngineName = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool m_sandbox;
|
private bool m_standalone;
|
||||||
|
|
||||||
public bool Sandbox
|
public bool Standalone
|
||||||
{
|
{
|
||||||
get { return m_sandbox; }
|
get { return m_standalone; }
|
||||||
set { m_sandbox = value; }
|
set { m_standalone = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool m_see_into_region_from_neighbor;
|
private bool m_see_into_region_from_neighbor;
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenSim
|
||||||
m_log.Info("====================================================================");
|
m_log.Info("====================================================================");
|
||||||
m_log.Info("========================= STARTING OPENSIM =========================");
|
m_log.Info("========================= STARTING OPENSIM =========================");
|
||||||
m_log.Info("====================================================================");
|
m_log.Info("====================================================================");
|
||||||
m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (ConfigurationSettings.Sandbox ? "sandbox" : "grid"));
|
m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (ConfigurationSettings.Standalone ? "sandbox" : "grid"));
|
||||||
|
|
||||||
m_console = new ConsoleBase("Region", this);
|
m_console = new ConsoleBase("Region", this);
|
||||||
MainConsole.Instance = m_console;
|
MainConsole.Instance = m_console;
|
||||||
|
@ -642,7 +642,7 @@ namespace OpenSim
|
||||||
|
|
||||||
ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console);
|
ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console);
|
||||||
|
|
||||||
if (ConfigurationSettings.Sandbox)
|
if (ConfigurationSettings.Standalone)
|
||||||
{
|
{
|
||||||
m_console.Notice("");
|
m_console.Notice("");
|
||||||
m_console.Notice("create user - adds a new user.");
|
m_console.Notice("create user - adds a new user.");
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace OpenSim
|
||||||
m_log.Info("====================================================================");
|
m_log.Info("====================================================================");
|
||||||
m_log.Info("========================= STARTING OPENSIM =========================");
|
m_log.Info("========================= STARTING OPENSIM =========================");
|
||||||
m_log.Info("====================================================================");
|
m_log.Info("====================================================================");
|
||||||
m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", ConfigurationSettings.Sandbox ? "sandbox" : "grid");
|
m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", ConfigurationSettings.Standalone ? "sandbox" : "grid");
|
||||||
|
|
||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ namespace OpenSim
|
||||||
|
|
||||||
if (startupConfig != null)
|
if (startupConfig != null)
|
||||||
{
|
{
|
||||||
m_configSettings.Sandbox = !startupConfig.GetBoolean("gridmode");
|
m_configSettings.Standalone = !startupConfig.GetBoolean("gridmode");
|
||||||
m_configSettings.PhysicsEngine = startupConfig.GetString("physics");
|
m_configSettings.PhysicsEngine = startupConfig.GetString("physics");
|
||||||
m_configSettings.MeshEngineName = startupConfig.GetString("meshing");
|
m_configSettings.MeshEngineName = startupConfig.GetString("meshing");
|
||||||
|
|
||||||
|
@ -333,8 +333,37 @@ namespace OpenSim
|
||||||
|
|
||||||
LibraryRootFolder libraryRootFolder = new LibraryRootFolder();
|
LibraryRootFolder libraryRootFolder = new LibraryRootFolder();
|
||||||
|
|
||||||
// StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false)
|
// StandAlone mode? is determined by !startupConfig.GetBoolean("gridmode", false)
|
||||||
if (m_configSettings.Sandbox)
|
if (m_configSettings.Standalone)
|
||||||
|
{
|
||||||
|
InitialiseStandaloneServices(libraryRootFolder);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We are in grid mode
|
||||||
|
m_commsManager
|
||||||
|
= new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder);
|
||||||
|
|
||||||
|
m_httpServer.AddStreamHandler(new SimStatusHandler());
|
||||||
|
}
|
||||||
|
|
||||||
|
proxyUrl = ConfigSource.Source.Configs["Network"].GetString("proxy_url", "");
|
||||||
|
proxyOffset = Int32.Parse(ConfigSource.Source.Configs["Network"].GetString("proxy_offset", "0"));
|
||||||
|
|
||||||
|
// Create a ModuleLoader instance
|
||||||
|
m_moduleLoader = new ModuleLoader(m_config.Source);
|
||||||
|
|
||||||
|
LoadPlugins();
|
||||||
|
|
||||||
|
// Only enable logins to the regions once we have completely finished starting up (apart from scripts)
|
||||||
|
m_commsManager.GridService.RegionLoginsEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialises the backend services for standalone mode, and registers some http handlers
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="libraryRootFolder"></param>
|
||||||
|
protected void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
|
||||||
{
|
{
|
||||||
LocalInventoryService inventoryService = new LocalInventoryService();
|
LocalInventoryService inventoryService = new LocalInventoryService();
|
||||||
inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource);
|
inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource);
|
||||||
|
@ -372,26 +401,6 @@ namespace OpenSim
|
||||||
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
|
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
|
||||||
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
|
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// We are in grid mode
|
|
||||||
m_commsManager
|
|
||||||
= new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache, libraryRootFolder);
|
|
||||||
|
|
||||||
m_httpServer.AddStreamHandler(new SimStatusHandler());
|
|
||||||
}
|
|
||||||
|
|
||||||
proxyUrl = ConfigSource.Source.Configs["Network"].GetString("proxy_url", "");
|
|
||||||
proxyOffset = Int32.Parse(ConfigSource.Source.Configs["Network"].GetString("proxy_offset", "0"));
|
|
||||||
|
|
||||||
// Create a ModuleLoader instance
|
|
||||||
m_moduleLoader = new ModuleLoader(m_config.Source);
|
|
||||||
|
|
||||||
LoadPlugins();
|
|
||||||
|
|
||||||
// Only enable logins to the regions once we have completely finished starting up (apart from scripts)
|
|
||||||
m_commsManager.GridService.RegionLoginsEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
|
@ -401,6 +410,16 @@ namespace OpenSim
|
||||||
|
|
||||||
m_httpServerPort = m_networkServersInfo.HttpListenerPort;
|
m_httpServerPort = m_networkServersInfo.HttpListenerPort;
|
||||||
|
|
||||||
|
InitialiseAssetCache();
|
||||||
|
|
||||||
|
m_sceneManager.OnRestartSim += handleRestartRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialises the assetcache
|
||||||
|
/// </summary>
|
||||||
|
protected void InitialiseAssetCache()
|
||||||
|
{
|
||||||
IAssetServer assetServer;
|
IAssetServer assetServer;
|
||||||
if (m_configSettings.AssetStorage == "grid")
|
if (m_configSettings.AssetStorage == "grid")
|
||||||
{
|
{
|
||||||
|
@ -428,8 +447,6 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
m_assetCache = new AssetCache(assetServer);
|
m_assetCache = new AssetCache(assetServer);
|
||||||
|
|
||||||
m_sceneManager.OnRestartSim += handleRestartRegion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY)
|
public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY)
|
||||||
|
|
Loading…
Reference in New Issue