aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim-Source/OpenSim/Application.cs
blob: 3f9c0ec059ec6876cd14a8944825e1002551d273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.UserServer;
using OpenSim.Framework.Console;

namespace OpenSim
{
    public class Application
    {   
        //could move our main function into OpenSimMain and kill this class
        [STAThread]
        public static void Main(string[] args)
        {
            Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
            Console.WriteLine("Starting...\n");
            
            bool sandBoxMode = false;
            bool startLoginServer = false;
            string physicsEngine = "basicphysics";
            bool allowFlying = false;
            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] == "-sandbox")
                {
                    sandBoxMode = true;
                    startLoginServer = true;
                }
                /*
                if (args[i] == "-loginserver")
                {
                    startLoginServer = true;
                }*/
                if (args[i] == "-accounts")
                {
                    userAccounts = true;
                }
                if (args[i] == "-realphysx")
                {
                    physicsEngine = "RealPhysX";
                    allowFlying = true;
                }
                if (args[i] == "-ode")
                {
                    physicsEngine = "OpenDynamicsEngine";
                    allowFlying = true;
                }
                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);
           // OpenSimRoot.Instance.Application = sim;
            sim.m_sandbox = sandBoxMode;
            sim.user_accounts = userAccounts;
            sim.gridLocalAsset = gridLocalAsset;
            OpenSim.world.Avatar.PhysicsEngineFlying = allowFlying;

            sim.StartUp();

            while (true)
            {
                OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
            }
        }
    }
}