From d66ef8f428b763fca3610869c85adb55aef5d9e5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 28 Mar 2007 05:27:20 +0000 Subject: * worked a little bit more on straigthening the startup procedure out --- OpenSim/RegionServer.cs | 55 ++++++++++++++++--------------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) (limited to 'OpenSim/RegionServer.cs') diff --git a/OpenSim/RegionServer.cs b/OpenSim/RegionServer.cs index a0037b1..cebea82 100644 --- a/OpenSim/RegionServer.cs +++ b/OpenSim/RegionServer.cs @@ -8,69 +8,50 @@ namespace OpenSim { public class RegionServer : OpenSimMain { + public RegionServer( ) : base( false, false, String.Empty ) + { + } + [STAThread] public static void Main(string[] args) { Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); Console.WriteLine("Starting...\n"); - //OpenSimRoot.instance = new OpenSimRoot(); - OpenSimMain sim = new OpenSimMain(); - OpenSimRoot.Instance.Application = sim; + bool sandBoxMode = false; + bool startLoginServer = false; + string physicsEngine = "basicphysics"; + bool allowFlying = false; - sim.sandbox = false; - sim.loginserver = false; - sim._physicsEngine = "basicphysics"; - for (int i = 0; i < args.Length; i++) { if (args[i] == "-sandbox") { - sim.sandbox = true; - OpenSimRoot.Instance.Sandbox = true; + sandBoxMode = true; } if (args[i] == "-loginserver") { - sim.loginserver = true; + startLoginServer = true; } if (args[i] == "-realphysx") { - sim._physicsEngine = "RealPhysX"; - OpenSim.world.Avatar.PhysicsEngineFlying = true; + physicsEngine = "RealPhysX"; } if (args[i] == "-ode") { - sim._physicsEngine = "OpenDynamicsEngine"; - OpenSim.world.Avatar.PhysicsEngineFlying = true; + physicsEngine = "OpenDynamicsEngine"; + allowFlying = true; } } + OpenSimMain sim = new OpenSimMain( sandBoxMode, startLoginServer, physicsEngine ); + OpenSimRoot.Instance.Application = sim; + OpenSimRoot.Instance.Sandbox = sandBoxMode; + OpenSim.world.Avatar.PhysicsEngineFlying = allowFlying; - OpenSimRoot.Instance.GridServers = new Grid(); - if (sim.sandbox) - { - OpenSimRoot.Instance.GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; - OpenSimRoot.Instance.GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; - OpenSimRoot.Instance.GridServers.Initialise(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Starting in Sandbox mode"); - } - else - { - OpenSimRoot.Instance.GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll"; - OpenSimRoot.Instance.GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; - OpenSimRoot.Instance.GridServers.Initialise(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Starting in Grid mode"); - } - - OpenSimRoot.Instance.StartUp(); + sim.StartUp(); - if (sim.loginserver && sim.sandbox) - { - LoginServer loginServer = new LoginServer(OpenSimRoot.Instance.GridServers.GridServer, OpenSimRoot.Instance.Cfg.IPListenAddr, OpenSimRoot.Instance.Cfg.IPListenPort); - loginServer.Startup(); - } - while (true) { OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt(); -- cgit v1.1