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.cs122
1 files changed, 122 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
new file mode 100644
index 0000000..1dcd99b
--- /dev/null
+++ b/OpenSim/Region/Application/Application.cs
@@ -0,0 +1,122 @@
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 System.Collections.Generic;
30using System.Text;
31using OpenSim.Framework.Console;
32using OpenSim.Region.ClientStack;
33
34namespace OpenSim
35{
36 public class Application
37 {
38 //could move our main function into OpenSimMain and kill this class
39 [STAThread]
40 public static void Main(string[] args)
41 {
42 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
43 Console.WriteLine("Starting...\n");
44
45 bool sandBoxMode = false;
46 bool startLoginServer = false;
47 string physicsEngine = "basicphysics";
48 bool allowFlying = false;
49 bool userAccounts = false;
50 bool gridLocalAsset = false;
51 bool useConfigFile = false;
52 bool silent = false;
53 string configFile = "simconfig.xml";
54
55 for (int i = 0; i < args.Length; i++)
56 {
57 if (args[i] == "-sandbox")
58 {
59 sandBoxMode = true;
60 startLoginServer = true;
61 }
62 /*
63 if (args[i] == "-loginserver")
64 {
65 startLoginServer = true;
66 }*/
67 if (args[i] == "-accounts")
68 {
69 userAccounts = true;
70 }
71 if (args[i] == "-realphysx")
72 {
73 physicsEngine = "RealPhysX";
74 allowFlying = true;
75 }
76 if (args[i] == "-ode")
77 {
78 physicsEngine = "OpenDynamicsEngine";
79 allowFlying = true;
80 }
81 if (args[i] == "-localasset")
82 {
83 gridLocalAsset = true;
84 }
85 if (args[i] == "-configfile")
86 {
87 useConfigFile = true;
88 }
89 if (args[i] == "-noverbose")
90 {
91 silent = true;
92 }
93 if (args[i] == "-config")
94 {
95 try
96 {
97 i++;
98 configFile = args[i];
99 }
100 catch (Exception e)
101 {
102 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
103 }
104 }
105 }
106
107 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile);
108 // OpenSimRoot.Instance.Application = sim;
109 sim.m_sandbox = sandBoxMode;
110 sim.user_accounts = userAccounts;
111 sim.gridLocalAsset = gridLocalAsset;
112 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = allowFlying;
113
114 sim.StartUp();
115
116 while (true)
117 {
118 OpenSim.Framework.Console.MainLog.Instance.MainLogPrompt();
119 }
120 }
121 }
122}