aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/Application.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/Application.cs33
1 files changed, 32 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index ad157c6..df80290 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -36,25 +36,47 @@ using OpenSim.Framework.Console;
36 36
37namespace OpenSim 37namespace OpenSim
38{ 38{
39 /// <summary>
40 /// Starting class for the OpenSimulator Region
41 /// </summary>
39 public class Application 42 public class Application
40 { 43 {
44 /// <summary>
45 /// Text Console Logger
46 /// </summary>
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 48
49 /// <summary>
50 /// Path to the main ini Configuration file
51 /// </summary>
43 public static string iniFilePath = ""; 52 public static string iniFilePath = "";
44 53
54 /// <summary>
55 /// Save Crashes in the bin/crashes folder. Configurable with m_crashDir
56 /// </summary>
45 public static bool m_saveCrashDumps = false; 57 public static bool m_saveCrashDumps = false;
58
59 /// <summary>
60 /// Directory to save crash reports to. Relative to bin/
61 /// </summary>
46 public static string m_crashDir = "crashes"; 62 public static string m_crashDir = "crashes";
47 63
64 /// <summary>
65 /// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration
66 /// </summary>
48 protected static OpenSimBase m_sim = null; 67 protected static OpenSimBase m_sim = null;
49 68
50 //could move our main function into OpenSimMain and kill this class 69 //could move our main function into OpenSimMain and kill this class
51 public static void Main(string[] args) 70 public static void Main(string[] args)
52 { 71 {
53 // First line 72 // First line, hook the appdomain to the crash reporter
54 AppDomain.CurrentDomain.UnhandledException += 73 AppDomain.CurrentDomain.UnhandledException +=
55 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 74 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
56 75
76 // Add the arguments supplied when running the application to the configuration
57 ArgvConfigSource configSource = new ArgvConfigSource(args); 77 ArgvConfigSource configSource = new ArgvConfigSource(args);
78
79 // Configure Log4Net
58 configSource.AddSwitch("Startup", "logconfig"); 80 configSource.AddSwitch("Startup", "logconfig");
59 string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); 81 string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty);
60 if (logConfigFile != String.Empty) 82 if (logConfigFile != String.Empty)
@@ -69,6 +91,8 @@ namespace OpenSim
69 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); 91 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
70 } 92 }
71 93
94 // Check if the system is compatible with OpenSimulator.
95 // Ensures that the minimum system requirements are met
72 m_log.Info("Performing compatibility checks... "); 96 m_log.Info("Performing compatibility checks... ");
73 string supported = String.Empty; 97 string supported = String.Empty;
74 if (Util.IsEnvironmentSupported(ref supported)) 98 if (Util.IsEnvironmentSupported(ref supported))
@@ -80,6 +104,7 @@ namespace OpenSim
80 m_log.Warn("Environment is unsupported (" + supported + ")\n"); 104 m_log.Warn("Environment is unsupported (" + supported + ")\n");
81 } 105 }
82 106
107 // Configure nIni aliases and localles
83 Culture.SetCurrentCulture(); 108 Culture.SetCurrentCulture();
84 109
85 110
@@ -99,8 +124,13 @@ namespace OpenSim
99 configSource.AddConfig("StandAlone"); 124 configSource.AddConfig("StandAlone");
100 configSource.AddConfig("Network"); 125 configSource.AddConfig("Network");
101 126
127 // Check if we're running in the background or not
102 bool background = configSource.Configs["Startup"].GetBoolean("background", false); 128 bool background = configSource.Configs["Startup"].GetBoolean("background", false);
129
130 // Check if we're saving crashes
103 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); 131 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false);
132
133 // load Crash directory config
104 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); 134 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
105 135
106 if (background) 136 if (background)
@@ -118,6 +148,7 @@ namespace OpenSim
118 { 148 {
119 try 149 try
120 { 150 {
151 // Block thread here for input
121 MainConsole.Instance.Prompt(); 152 MainConsole.Instance.Prompt();
122 } 153 }
123 catch (Exception e) 154 catch (Exception e)