diff options
author | MW | 2007-08-04 18:15:48 +0000 |
---|---|---|
committer | MW | 2007-08-04 18:15:48 +0000 |
commit | f1e10e555d1cc7bee40b4fd05caf2507c5808816 (patch) | |
tree | 26b17b33db5726efb0f5a4983a607401fa58d04a /OpenSim/Region/Application/Application.cs | |
parent | OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs (diff) | |
download | opensim-SC-f1e10e555d1cc7bee40b4fd05caf2507c5808816.zip opensim-SC-f1e10e555d1cc7bee40b4fd05caf2507c5808816.tar.gz opensim-SC-f1e10e555d1cc7bee40b4fd05caf2507c5808816.tar.bz2 opensim-SC-f1e10e555d1cc7bee40b4fd05caf2507c5808816.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Application/Application.cs')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 71 |
1 files changed, 9 insertions, 62 deletions
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenSim.Framework.Console; | 29 | using OpenSim.Framework.Console; |
30 | using OpenSim.Region.Environment.Scenes; | 30 | using OpenSim.Region.Environment.Scenes; |
31 | using Nini.Config; | ||
31 | 32 | ||
32 | namespace OpenSim | 33 | namespace OpenSim |
33 | { | 34 | { |
@@ -52,70 +53,16 @@ namespace OpenSim | |||
52 | 53 | ||
53 | Console.WriteLine("Starting...\n"); | 54 | Console.WriteLine("Starting...\n"); |
54 | 55 | ||
55 | bool sandBoxMode = true; | 56 | ArgvConfigSource source = new ArgvConfigSource(args); |
56 | bool startLoginServer = true; | ||
57 | string physicsEngine = "basicphysics"; | ||
58 | 57 | ||
59 | bool userAccounts = false; | 58 | source.AddSwitch("Startup", "inifile"); |
60 | bool gridLocalAsset = false; | 59 | source.AddSwitch("Startup", "configfile"); |
61 | bool useConfigFile = false; | 60 | source.AddSwitch("Startup", "gridmode"); |
62 | bool silent = false; | 61 | source.AddSwitch("Startup", "physics"); |
63 | string configFile = "simconfig.xml"; | 62 | source.AddSwitch("Startup", "config"); |
64 | 63 | source.AddSwitch("Startup", "noverbose"); | |
65 | for (int i = 0; i < args.Length; i++) | ||
66 | { | ||
67 | if (args[i] == "-gridmode") | ||
68 | { | ||
69 | sandBoxMode = false; | ||
70 | startLoginServer = false; | ||
71 | } | ||
72 | |||
73 | if (args[i] == "-accounts") | ||
74 | { | ||
75 | userAccounts = true; | ||
76 | } | ||
77 | if (args[i] == "-realphysx") | ||
78 | { | ||
79 | physicsEngine = "RealPhysX"; | ||
80 | } | ||
81 | if (args[i] == "-bulletX") | ||
82 | { | ||
83 | physicsEngine = "BulletXEngine"; | ||
84 | } | ||
85 | if (args[i] == "-ode") | ||
86 | { | ||
87 | physicsEngine = "OpenDynamicsEngine"; | ||
88 | } | ||
89 | if (args[i] == "-localasset") | ||
90 | { | ||
91 | gridLocalAsset = true; | ||
92 | } | ||
93 | if (args[i] == "-configfile") | ||
94 | { | ||
95 | useConfigFile = true; | ||
96 | } | ||
97 | if (args[i] == "-noverbose") | ||
98 | { | ||
99 | silent = true; | ||
100 | } | ||
101 | if (args[i] == "-config") | ||
102 | { | ||
103 | try | ||
104 | { | ||
105 | i++; | ||
106 | configFile = args[i]; | ||
107 | } | ||
108 | catch (Exception e) | ||
109 | { | ||
110 | Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")"); | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | |||
115 | OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); | ||
116 | 64 | ||
117 | sim.user_accounts = userAccounts; | 65 | OpenSimMain sim = new OpenSimMain(source); |
118 | sim.m_gridLocalAsset = gridLocalAsset; | ||
119 | 66 | ||
120 | sim.StartUp(); | 67 | sim.StartUp(); |
121 | 68 | ||