aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/Application.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/Application.cs')
-rw-r--r--OpenSim/Region/Application/Application.cs120
1 files changed, 120 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
new file mode 100644
index 0000000..0428f5a
--- /dev/null
+++ b/OpenSim/Region/Application/Application.cs
@@ -0,0 +1,120 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using OpenSim.Framework.Console;
30using OpenSim.Region.Environment.Scenes;
31
32namespace OpenSim
33{
34 public class Application
35 {
36 //could move our main function into OpenSimMain and kill this class
37 [STAThread]
38 public static void Main(string[] args)
39 {
40 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
41 Console.WriteLine("Starting...\n");
42
43 bool sandBoxMode = false;
44 bool startLoginServer = false;
45 string physicsEngine = "basicphysics";
46 bool allowFlying = false;
47 bool userAccounts = false;
48 bool gridLocalAsset = false;
49 bool useConfigFile = false;
50 bool silent = false;
51 string configFile = "simconfig.xml";
52
53 for (int i = 0; i < args.Length; i++)
54 {
55 if (args[i] == "-sandbox")
56 {
57 sandBoxMode = true;
58 startLoginServer = true;
59 }
60 /*
61 if (args[i] == "-loginserver")
62 {
63 startLoginServer = true;
64 }*/
65 if (args[i] == "-accounts")
66 {
67 userAccounts = true;
68 }
69 if (args[i] == "-realphysx")
70 {
71 physicsEngine = "RealPhysX";
72 allowFlying = true;
73 }
74 if (args[i] == "-ode")
75 {
76 physicsEngine = "OpenDynamicsEngine";
77 allowFlying = true;
78 }
79 if (args[i] == "-localasset")
80 {
81 gridLocalAsset = true;
82 }
83 if (args[i] == "-configfile")
84 {
85 useConfigFile = true;
86 }
87 if (args[i] == "-noverbose")
88 {
89 silent = true;
90 }
91 if (args[i] == "-config")
92 {
93 try
94 {
95 i++;
96 configFile = args[i];
97 }
98 catch (Exception e)
99 {
100 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
101 }
102 }
103 }
104
105 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile);
106 // OpenSimRoot.Instance.Application = sim;
107 sim.m_sandbox = sandBoxMode;
108 sim.user_accounts = userAccounts;
109 sim.gridLocalAsset = gridLocalAsset;
110 ScenePresence.PhysicsEngineFlying = allowFlying;
111
112 sim.StartUp();
113
114 while (true)
115 {
116 MainLog.Instance.MainLogPrompt();
117 }
118 }
119 }
120}