From b47e405420b316a2f68b3e6f4c5ed35dc713260e Mon Sep 17 00:00:00 2001
From: Teravus Ovares (Dan Olivares)
Date: Wed, 12 Aug 2009 22:54:57 -0400
Subject: * minor: Comments
---
OpenSim/Region/Application/Application.cs | 33 ++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Application/Application.cs')
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;
namespace OpenSim
{
+ ///
+ /// Starting class for the OpenSimulator Region
+ ///
public class Application
{
+ ///
+ /// Text Console Logger
+ ///
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// Path to the main ini Configuration file
+ ///
public static string iniFilePath = "";
+ ///
+ /// Save Crashes in the bin/crashes folder. Configurable with m_crashDir
+ ///
public static bool m_saveCrashDumps = false;
+
+ ///
+ /// Directory to save crash reports to. Relative to bin/
+ ///
public static string m_crashDir = "crashes";
+ ///
+ /// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration
+ ///
protected static OpenSimBase m_sim = null;
//could move our main function into OpenSimMain and kill this class
public static void Main(string[] args)
{
- // First line
+ // First line, hook the appdomain to the crash reporter
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+ // Add the arguments supplied when running the application to the configuration
ArgvConfigSource configSource = new ArgvConfigSource(args);
+
+ // Configure Log4Net
configSource.AddSwitch("Startup", "logconfig");
string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty);
if (logConfigFile != String.Empty)
@@ -69,6 +91,8 @@ namespace OpenSim
m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
}
+ // Check if the system is compatible with OpenSimulator.
+ // Ensures that the minimum system requirements are met
m_log.Info("Performing compatibility checks... ");
string supported = String.Empty;
if (Util.IsEnvironmentSupported(ref supported))
@@ -80,6 +104,7 @@ namespace OpenSim
m_log.Warn("Environment is unsupported (" + supported + ")\n");
}
+ // Configure nIni aliases and localles
Culture.SetCurrentCulture();
@@ -99,8 +124,13 @@ namespace OpenSim
configSource.AddConfig("StandAlone");
configSource.AddConfig("Network");
+ // Check if we're running in the background or not
bool background = configSource.Configs["Startup"].GetBoolean("background", false);
+
+ // Check if we're saving crashes
m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false);
+
+ // load Crash directory config
m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
if (background)
@@ -118,6 +148,7 @@ namespace OpenSim
{
try
{
+ // Block thread here for input
MainConsole.Instance.Prompt();
}
catch (Exception e)
--
cgit v1.1