aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-25 23:04:38 +0000
committerJustin Clark-Casey (justincc)2013-02-25 23:04:38 +0000
commitd0cb4fc3262df2afe2ef34396c7960f7afee6b89 (patch)
tree2037829f95d30302b82536dc10cf5985a2b5df59 /OpenSim/Region
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-d0cb4fc3262df2afe2ef34396c7960f7afee6b89.zip
opensim-SC_OLD-d0cb4fc3262df2afe2ef34396c7960f7afee6b89.tar.gz
opensim-SC_OLD-d0cb4fc3262df2afe2ef34396c7960f7afee6b89.tar.bz2
opensim-SC_OLD-d0cb4fc3262df2afe2ef34396c7960f7afee6b89.tar.xz
Move map related settings from [Startup] to a new [Map] section in OpenSim.ini
Existing map settings in [Startup] will continue to work, and if present will override anything in [Map] However, the proper place for such settings would now be [Map] This is to reduce the use of [Startup] as a bag for non-generic settings which should really go in sections, in common with other settings. This commit also extends Diva's previous work to allow a default setting to be given when looking at multiple sections for settings.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs24
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs20
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs11
5 files changed, 35 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index e0921ad..c4255b9 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -52,8 +52,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
52 52
53 public override void Initialise(IConfigSource config) 53 public override void Initialise(IConfigSource config)
54 { 54 {
55 IConfig startupConfig = config.Configs["Startup"]; 55 if (Util.GetConfigVarFromSections<string>(
56 if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap") 56 config, "WorldMapModule", new string[] { "Map", "Startup" }, "WorldMap") == "HGWorldMap")
57 m_Enabled = true; 57 m_Enabled = true;
58 } 58 }
59 59
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index e7065dc..40638f8 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -80,17 +80,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
80 bool generateMaptiles = true; 80 bool generateMaptiles = true;
81 Bitmap mapbmp; 81 Bitmap mapbmp;
82 82
83 try 83 string[] configSections = new string[] { "Map", "Startup" };
84 { 84
85 IConfig startupConfig = m_config.Configs["Startup"]; 85 drawPrimVolume
86 drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume); 86 = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
87 textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain); 87 textureTerrain
88 generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", generateMaptiles); 88 = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
89 } 89 generateMaptiles
90 catch 90 = Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles);
91 {
92 m_log.Warn("[MAPTILE]: Failed to load StartupConfig");
93 }
94 91
95 if (generateMaptiles) 92 if (generateMaptiles)
96 { 93 {
@@ -148,9 +145,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
148 { 145 {
149 m_config = source; 146 m_config = source;
150 147
151 IConfig startupConfig = m_config.Configs["Startup"]; 148 if (Util.GetConfigVarFromSections<string>(
152 if (startupConfig.GetString("MapImageModule", "MapImageModule") != 149 m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "MapImageModule")
153 "MapImageModule")
154 return; 150 return;
155 151
156 m_Enabled = true; 152 m_Enabled = true;
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
index 5e0dfa7..ed2b06a 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
@@ -71,8 +71,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
71 { 71 {
72 m_config = source; 72 m_config = source;
73 73
74 IConfig startupConfig = m_config.Configs["Startup"]; 74 if (Util.GetConfigVarFromSections<string>(
75 if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule") 75 m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "Warp3DImageModule")
76 return; 76 return;
77 77
78 m_Enabled = true; 78 m_Enabled = true;
@@ -143,16 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
143 bool drawPrimVolume = true; 143 bool drawPrimVolume = true;
144 bool textureTerrain = true; 144 bool textureTerrain = true;
145 145
146 try 146 string[] configSections = new string[] { "Map", "Startup" };
147 { 147
148 IConfig startupConfig = m_config.Configs["Startup"]; 148 drawPrimVolume
149 drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume); 149 = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
150 textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain); 150 textureTerrain
151 } 151 = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
152 catch
153 {
154 m_log.Warn("[WARP 3D IMAGE MODULE]: Failed to load StartupConfig");
155 }
156 152
157 m_colors.Clear(); 153 m_colors.Clear();
158 154
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index e2f525c..912d50a 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -86,11 +86,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
86 #region INonSharedRegionModule Members 86 #region INonSharedRegionModule Members
87 public virtual void Initialise (IConfigSource config) 87 public virtual void Initialise (IConfigSource config)
88 { 88 {
89 IConfig startupConfig = config.Configs["Startup"]; 89 string[] configSections = new string[] { "Map", "Startup" };
90 if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap") 90
91 if (Util.GetConfigVarFromSections<string>(
92 config, "WorldMapModule", configSections, "WorldMap") == "WorldMap")
91 m_Enabled = true; 93 m_Enabled = true;
92 94
93 blacklistTimeout = startupConfig.GetInt("BlacklistTimeout", 10*60) * 1000; 95 blacklistTimeout
96 = Util.GetConfigVarFromSections<int>(config, "BlacklistTimeout", configSections, 10 * 60) * 1000;
94 } 97 }
95 98
96 public virtual void AddRegion (Scene scene) 99 public virtual void AddRegion (Scene scene)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9b17b7f..5b61538 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -897,7 +897,11 @@ namespace OpenSim.Region.Framework.Scenes
897 897
898 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); 898 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
899 899
900 m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); 900 string[] possibleMapConfigSections = new string[] { "Map", "Startup" };
901
902 m_generateMaptiles
903 = Util.GetConfigVarFromSections<bool>(config, "GenerateMaptiles", possibleMapConfigSections, true);
904
901 if (m_generateMaptiles) 905 if (m_generateMaptiles)
902 { 906 {
903 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); 907 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
@@ -911,7 +915,10 @@ namespace OpenSim.Region.Framework.Scenes
911 } 915 }
912 else 916 else
913 { 917 {
914 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); 918 string tile
919 = Util.GetConfigVarFromSections<string>(
920 config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString());
921
915 UUID tileID; 922 UUID tileID;
916 923
917 if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID)) 924 if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID))