mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
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.
This commit is contained in:
@@ -52,8 +52,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
|
||||
|
||||
public override void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap")
|
||||
if (Util.GetConfigVarFromSections<string>(
|
||||
config, "WorldMapModule", new string[] { "Map", "Startup" }, "WorldMap") == "HGWorldMap")
|
||||
m_Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,17 +80,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||
bool generateMaptiles = true;
|
||||
Bitmap mapbmp;
|
||||
|
||||
try
|
||||
{
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume);
|
||||
textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain);
|
||||
generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", generateMaptiles);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.Warn("[MAPTILE]: Failed to load StartupConfig");
|
||||
}
|
||||
string[] configSections = new string[] { "Map", "Startup" };
|
||||
|
||||
drawPrimVolume
|
||||
= Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
|
||||
textureTerrain
|
||||
= Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
|
||||
generateMaptiles
|
||||
= Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles);
|
||||
|
||||
if (generateMaptiles)
|
||||
{
|
||||
@@ -148,9 +145,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||
{
|
||||
m_config = source;
|
||||
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
if (startupConfig.GetString("MapImageModule", "MapImageModule") !=
|
||||
"MapImageModule")
|
||||
if (Util.GetConfigVarFromSections<string>(
|
||||
m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "MapImageModule")
|
||||
return;
|
||||
|
||||
m_Enabled = true;
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||
{
|
||||
m_config = source;
|
||||
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule")
|
||||
if (Util.GetConfigVarFromSections<string>(
|
||||
m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "Warp3DImageModule")
|
||||
return;
|
||||
|
||||
m_Enabled = true;
|
||||
@@ -143,16 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||
bool drawPrimVolume = true;
|
||||
bool textureTerrain = true;
|
||||
|
||||
try
|
||||
{
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume);
|
||||
textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.Warn("[WARP 3D IMAGE MODULE]: Failed to load StartupConfig");
|
||||
}
|
||||
string[] configSections = new string[] { "Map", "Startup" };
|
||||
|
||||
drawPrimVolume
|
||||
= Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
|
||||
textureTerrain
|
||||
= Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
|
||||
|
||||
m_colors.Clear();
|
||||
|
||||
|
||||
@@ -86,11 +86,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
#region INonSharedRegionModule Members
|
||||
public virtual void Initialise (IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
||||
string[] configSections = new string[] { "Map", "Startup" };
|
||||
|
||||
if (Util.GetConfigVarFromSections<string>(
|
||||
config, "WorldMapModule", configSections, "WorldMap") == "WorldMap")
|
||||
m_Enabled = true;
|
||||
|
||||
blacklistTimeout = startupConfig.GetInt("BlacklistTimeout", 10*60) * 1000;
|
||||
blacklistTimeout
|
||||
= Util.GetConfigVarFromSections<int>(config, "BlacklistTimeout", configSections, 10 * 60) * 1000;
|
||||
}
|
||||
|
||||
public virtual void AddRegion (Scene scene)
|
||||
|
||||
Reference in New Issue
Block a user