From e6dea73d1f7bdc954b250b8cb03370264e11f635 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 16 Jul 2007 18:37:31 +0000 Subject: * Removed some superfluous assigns * Moved physics plugin scene creation into local scope --- OpenSim/Region/Application/Application.cs | 13 ++----------- OpenSim/Region/Application/OpenSimMain.cs | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 666be33..a47ba48 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -57,11 +57,7 @@ namespace OpenSim sandBoxMode = true; startLoginServer = true; } - /* - if (args[i] == "-loginserver") - { - startLoginServer = true; - }*/ + if (args[i] == "-accounts") { userAccounts = true; @@ -69,17 +65,14 @@ namespace OpenSim if (args[i] == "-realphysx") { physicsEngine = "RealPhysX"; - allowFlying = true; } if (args[i] == "-bulletX") { physicsEngine = "BulletXEngine"; - allowFlying = true; } if (args[i] == "-ode") { physicsEngine = "OpenDynamicsEngine"; - allowFlying = true; } if (args[i] == "-localasset") { @@ -108,11 +101,9 @@ namespace OpenSim } OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); - // OpenSimRoot.Instance.Application = sim; - sim.m_sandbox = sandBoxMode; + sim.user_accounts = userAccounts; sim.gridLocalAsset = gridLocalAsset; - ScenePresence.PhysicsEngineFlying = allowFlying; sim.StartUp(); diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index d7bed31..5409fea 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -119,9 +119,6 @@ namespace OpenSim startuptime = DateTime.Now; - this.m_physicsManager = new PhysicsPluginManager(); - this.m_physicsManager.LoadPlugins(); - this.SetupScene(); m_log.Verbose("Main.cs:Startup() - Initialising HTTP server"); @@ -231,7 +228,9 @@ namespace OpenSim scene.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. scene.LoadWorldMap(); - scene.PhysScene = this.m_physicsManager.GetPhysicsScene( this.m_physicsEngine ); + PhysicsScene physicsScene = GetPhysicsScene( m_physicsEngine ); + + scene.PhysScene = physicsScene; scene.PhysScene.SetTerrain(scene.Terrain.getHeights1D()); scene.LoadPrimsFromStorage(); @@ -254,6 +253,14 @@ namespace OpenSim } } + private static PhysicsScene GetPhysicsScene(string physicsEngine) + { + PhysicsPluginManager physicsPluginManager; + physicsPluginManager = new PhysicsPluginManager(); + physicsPluginManager.LoadPlugins(); + return physicsPluginManager.GetPhysicsScene( physicsEngine ); + } + private class SimStatusHandler : IStreamHandler { public byte[] Handle(string path, Stream request) @@ -359,7 +366,7 @@ namespace OpenSim this.gridLocalAsset = Convert.ToBoolean(attri); } - + attri = ""; attri = configData.GetAttribute("PhysicsEngine"); switch (attri) -- cgit v1.1