diff options
Diffstat (limited to 'OpenSim-Source/OpenSim/Application.cs')
-rw-r--r-- | OpenSim-Source/OpenSim/Application.cs | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/OpenSim-Source/OpenSim/Application.cs b/OpenSim-Source/OpenSim/Application.cs new file mode 100644 index 0000000..3f9c0ec --- /dev/null +++ b/OpenSim-Source/OpenSim/Application.cs | |||
@@ -0,0 +1,95 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.UserServer; | ||
5 | using OpenSim.Framework.Console; | ||
6 | |||
7 | namespace OpenSim | ||
8 | { | ||
9 | public class Application | ||
10 | { | ||
11 | //could move our main function into OpenSimMain and kill this class | ||
12 | [STAThread] | ||
13 | public static void Main(string[] args) | ||
14 | { | ||
15 | Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); | ||
16 | Console.WriteLine("Starting...\n"); | ||
17 | |||
18 | bool sandBoxMode = false; | ||
19 | bool startLoginServer = false; | ||
20 | string physicsEngine = "basicphysics"; | ||
21 | bool allowFlying = false; | ||
22 | bool userAccounts = false; | ||
23 | bool gridLocalAsset = false; | ||
24 | bool useConfigFile = false; | ||
25 | bool silent = false; | ||
26 | string configFile = "simconfig.xml"; | ||
27 | |||
28 | for (int i = 0; i < args.Length; i++) | ||
29 | { | ||
30 | if (args[i] == "-sandbox") | ||
31 | { | ||
32 | sandBoxMode = true; | ||
33 | startLoginServer = true; | ||
34 | } | ||
35 | /* | ||
36 | if (args[i] == "-loginserver") | ||
37 | { | ||
38 | startLoginServer = true; | ||
39 | }*/ | ||
40 | if (args[i] == "-accounts") | ||
41 | { | ||
42 | userAccounts = true; | ||
43 | } | ||
44 | if (args[i] == "-realphysx") | ||
45 | { | ||
46 | physicsEngine = "RealPhysX"; | ||
47 | allowFlying = true; | ||
48 | } | ||
49 | if (args[i] == "-ode") | ||
50 | { | ||
51 | physicsEngine = "OpenDynamicsEngine"; | ||
52 | allowFlying = true; | ||
53 | } | ||
54 | if (args[i] == "-localasset") | ||
55 | { | ||
56 | gridLocalAsset = true; | ||
57 | } | ||
58 | if (args[i] == "-configfile") | ||
59 | { | ||
60 | useConfigFile = true; | ||
61 | } | ||
62 | if (args[i] == "-noverbose") | ||
63 | { | ||
64 | silent = true; | ||
65 | } | ||
66 | if (args[i] == "-config") | ||
67 | { | ||
68 | try | ||
69 | { | ||
70 | i++; | ||
71 | configFile = args[i]; | ||
72 | } | ||
73 | catch (Exception e) | ||
74 | { | ||
75 | Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")"); | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile); | ||
81 | // OpenSimRoot.Instance.Application = sim; | ||
82 | sim.m_sandbox = sandBoxMode; | ||
83 | sim.user_accounts = userAccounts; | ||
84 | sim.gridLocalAsset = gridLocalAsset; | ||
85 | OpenSim.world.Avatar.PhysicsEngineFlying = allowFlying; | ||
86 | |||
87 | sim.StartUp(); | ||
88 | |||
89 | while (true) | ||
90 | { | ||
91 | OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt(); | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | } | ||