From 0f77a334bd0eb7ae8b92991ae91cb8cdd37c794b Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 3 Oct 2008 19:52:29 +0000
Subject: * minor: slightly simplify code in setting up the default
configuration * we appear to both setup a default configuration and provude
identical defaults when we later try to read the values - this is probably
not really necessary
---
OpenSim/Region/Application/OpenSimBase.cs | 63 ++++++++++++++-----------------
1 file changed, 29 insertions(+), 34 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f845bf8..5301e96 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -197,17 +197,20 @@ namespace OpenSim
ReadConfigSettings();
}
+ ///
+ /// Setup a default config values in case they aren't present in the ini file
+ ///
+ ///
public static IConfigSource DefaultConfig()
{
IConfigSource DefaultConfig = new IniConfigSource();
- if (DefaultConfig.Configs["Startup"] == null)
+
{
- DefaultConfig.AddConfig("Startup");
- }
+ IConfig config = DefaultConfig.Configs["Startup"];
+
+ if (null == config)
+ config = DefaultConfig.AddConfig("Startup");
- IConfig config = DefaultConfig.Configs["Startup"];
- if (config != null)
- {
config.Set("gridmode", false);
config.Set("physics", "basicphysics");
config.Set("physical_prim", true);
@@ -224,15 +227,13 @@ namespace OpenSim
config.Set("asset_database", "sqlite");
config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
}
-
- if (DefaultConfig.Configs["StandAlone"] == null)
+
{
- DefaultConfig.AddConfig("StandAlone");
- }
+ IConfig config = DefaultConfig.Configs["StandAlone"];
+
+ if (null == config)
+ config = DefaultConfig.AddConfig("StandAlone");
- config = DefaultConfig.Configs["StandAlone"];
- if (config != null)
- {
config.Set("accounts_authenticate", false);
config.Set("welcome_message", "Welcome to OpenSimulator");
config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
@@ -243,15 +244,13 @@ namespace OpenSim
config.Set("asset_source", "");
config.Set("dump_assets_to_file", false);
}
-
- if (DefaultConfig.Configs["Network"] == null)
+
{
- DefaultConfig.AddConfig("Network");
- }
+ IConfig config = DefaultConfig.Configs["Network"];
+
+ if (null == config)
+ config = DefaultConfig.AddConfig("Network");
- config = DefaultConfig.Configs["Network"];
- if (config != null)
- {
config.Set("default_location_x", 1000);
config.Set("default_location_y", 1000);
config.Set("http_listener_port", NetworkServersInfo.DefaultHttpListenerPort);
@@ -266,26 +265,22 @@ namespace OpenSim
config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString());
config.Set("secure_inventory_server", "true");
}
-
- if (DefaultConfig.Configs["RemoteAdmin"] == null)
+
{
- DefaultConfig.AddConfig("RemoteAdmin");
- }
+ IConfig config = DefaultConfig.Configs["RemoteAdmin"];
+
+ if (null == config)
+ config = DefaultConfig.AddConfig("RemoteAdmin");
- config = DefaultConfig.Configs["RemoteAdmin"];
- if (config != null)
- {
config.Set("enabled", "false");
}
-
- if (DefaultConfig.Configs["Voice"] == null)
+
{
- DefaultConfig.AddConfig("Voice");
- }
+ IConfig config = DefaultConfig.Configs["Voice"];
+
+ if (null == config)
+ config = DefaultConfig.AddConfig("Voice");
- config = DefaultConfig.Configs["Voice"];
- if (config != null)
- {
config.Set("enabled", "false");
}
--
cgit v1.1