From f1e10e555d1cc7bee40b4fd05caf2507c5808816 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 4 Aug 2007 18:15:48 +0000 Subject: clean up of startup config settings (command line args etc), Now using the Nini configuration library (suggest we look into using this for the rest of our config handling, as it provides a standard interface for command line args, INI files, Xml files, .NET config files, and windows registry). One IMPORTANT change is that to TO START GRIDMODE , you need to now use -gridmode=true . Also need someone to test it under mono. (there is a dll that has been compiled under mono available, just hoping that we don't have to deal with separate dlls for windows and linux. --- OpenSim/Region/Application/Application.cs | 71 ++++--------------------------- 1 file changed, 9 insertions(+), 62 deletions(-) (limited to 'OpenSim/Region/Application/Application.cs') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index a8c40ec..b07a4d6 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -28,6 +28,7 @@ using System; using OpenSim.Framework.Console; using OpenSim.Region.Environment.Scenes; +using Nini.Config; namespace OpenSim { @@ -52,70 +53,16 @@ namespace OpenSim Console.WriteLine("Starting...\n"); - bool sandBoxMode = true; - bool startLoginServer = true; - string physicsEngine = "basicphysics"; + ArgvConfigSource source = new ArgvConfigSource(args); - bool userAccounts = false; - bool gridLocalAsset = false; - bool useConfigFile = false; - bool silent = false; - string configFile = "simconfig.xml"; - - for (int i = 0; i < args.Length; i++) - { - if (args[i] == "-gridmode") - { - sandBoxMode = false; - startLoginServer = false; - } - - if (args[i] == "-accounts") - { - userAccounts = true; - } - if (args[i] == "-realphysx") - { - physicsEngine = "RealPhysX"; - } - if (args[i] == "-bulletX") - { - physicsEngine = "BulletXEngine"; - } - if (args[i] == "-ode") - { - physicsEngine = "OpenDynamicsEngine"; - } - if (args[i] == "-localasset") - { - gridLocalAsset = true; - } - if (args[i] == "-configfile") - { - useConfigFile = true; - } - if (args[i] == "-noverbose") - { - silent = true; - } - if (args[i] == "-config") - { - try - { - i++; - configFile = args[i]; - } - catch (Exception e) - { - Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")"); - } - } - } - - OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); + source.AddSwitch("Startup", "inifile"); + source.AddSwitch("Startup", "configfile"); + source.AddSwitch("Startup", "gridmode"); + source.AddSwitch("Startup", "physics"); + source.AddSwitch("Startup", "config"); + source.AddSwitch("Startup", "noverbose"); - sim.user_accounts = userAccounts; - sim.m_gridLocalAsset = gridLocalAsset; + OpenSimMain sim = new OpenSimMain(source); sim.StartUp(); -- cgit v1.1