From 776b1f341aea5005a94bc3e03159619b3e9ce502 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 28 Apr 2008 14:41:46 +0000 Subject: From: Dr Scofield Note: This is the first part of some changes from Dr Scofield to support console-less operation of an OpenSim region server. The changes are not yet complete. * refactors OpenSimMain into two classes: OpenSimMain and OpenSimMainConsole. OpenSimMainConsole derives from OpenSimMain and basically is the "old" OpenSimMain * drops StartConsole from RegionApplicationBase (was only called from the "old" OpenSimMain anyhow) * reverts the changes to TryGetScene(string, out scene) as that seems to work perfectly fine * adds a check to region-remove to see whether m_sceneManger.CurrentScene is non-null before comparing it against the region-to-be-removed --- OpenSim/Region/Application/Application.cs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Application/Application.cs') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index eaa4788..828490a 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -65,6 +65,12 @@ namespace OpenSim ArgvConfigSource configSource = new ArgvConfigSource(args); + configSource.Alias.AddAlias("On", true); + configSource.Alias.AddAlias("Off", false); + configSource.Alias.AddAlias("True", true); + configSource.Alias.AddAlias("False", false); + + configSource.AddSwitch("Startup", "background"); configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "gridmode"); configSource.AddSwitch("Startup", "physics"); @@ -73,13 +79,23 @@ namespace OpenSim configSource.AddConfig("StandAlone"); configSource.AddConfig("Network"); - OpenSimMain sim = new OpenSimMain(configSource); - - sim.StartUp(); + bool background = configSource.Configs["Startup"].GetBoolean("background", false); - while (true) + if (background) + { + Console.WriteLine("background mode"); + OpenSimMain sim = new OpenSimMain(configSource); + sim.StartUp(); + } + else { - MainConsole.Instance.Prompt(); + OpenSimMain sim = new OpenSimMainConsole(configSource); + sim.StartUp(); + + while (true) + { + MainConsole.Instance.Prompt(); + } } } -- cgit v1.1