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.user_profiles
parent
66c5934d90
commit
d0cb4fc326
|
@ -917,7 +917,25 @@ namespace OpenSim.Framework
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static T GetConfigVarFromSections<T>(IConfigSource config, string varname, string[] sections)
|
public static T GetConfigVarFromSections<T>(IConfigSource config, string varname, string[] sections)
|
||||||
{
|
{
|
||||||
object val = default(T);
|
return GetConfigVarFromSections<T>(config, varname, sections, default(T));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the value of a configuration variable by looking into
|
||||||
|
/// multiple sections in order. The latter sections overwrite
|
||||||
|
/// any values previously found.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If no value is found then the given default value is returned
|
||||||
|
/// </remarks>
|
||||||
|
/// <typeparam name="T">Type of the variable</typeparam>
|
||||||
|
/// <param name="config">The configuration object</param>
|
||||||
|
/// <param name="varname">The configuration variable</param>
|
||||||
|
/// <param name="sections">Ordered sequence of sections to look at</param>
|
||||||
|
/// <param name="val">Default value</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static T GetConfigVarFromSections<T>(IConfigSource config, string varname, string[] sections, object val)
|
||||||
|
{
|
||||||
foreach (string section in sections)
|
foreach (string section in sections)
|
||||||
{
|
{
|
||||||
IConfig cnf = config.Configs[section];
|
IConfig cnf = config.Configs[section];
|
||||||
|
@ -925,11 +943,7 @@ namespace OpenSim.Framework
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (typeof(T) == typeof(String))
|
if (typeof(T) == typeof(String))
|
||||||
{
|
|
||||||
if (val == null) // no null strings, please
|
|
||||||
val = string.Empty;
|
|
||||||
val = cnf.GetString(varname, (string)val);
|
val = cnf.GetString(varname, (string)val);
|
||||||
}
|
|
||||||
else if (typeof(T) == typeof(Boolean))
|
else if (typeof(T) == typeof(Boolean))
|
||||||
val = cnf.GetBoolean(varname, (bool)val);
|
val = cnf.GetBoolean(varname, (bool)val);
|
||||||
else if (typeof(T) == typeof(Int32))
|
else if (typeof(T) == typeof(Int32))
|
||||||
|
@ -937,8 +951,9 @@ namespace OpenSim.Framework
|
||||||
else if (typeof(T) == typeof(float))
|
else if (typeof(T) == typeof(float))
|
||||||
val = cnf.GetFloat(varname, (int)val);
|
val = cnf.GetFloat(varname, (int)val);
|
||||||
else
|
else
|
||||||
m_log.WarnFormat("[UTIL]: Unhandled type {0}", typeof(T));
|
m_log.ErrorFormat("[UTIL]: Unhandled type {0}", typeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (T)val;
|
return (T)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
|
||||||
|
|
||||||
public override void Initialise(IConfigSource config)
|
public override void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
IConfig startupConfig = config.Configs["Startup"];
|
if (Util.GetConfigVarFromSections<string>(
|
||||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap")
|
config, "WorldMapModule", new string[] { "Map", "Startup" }, "WorldMap") == "HGWorldMap")
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,17 +80,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
bool generateMaptiles = true;
|
bool generateMaptiles = true;
|
||||||
Bitmap mapbmp;
|
Bitmap mapbmp;
|
||||||
|
|
||||||
try
|
string[] configSections = new string[] { "Map", "Startup" };
|
||||||
{
|
|
||||||
IConfig startupConfig = m_config.Configs["Startup"];
|
drawPrimVolume
|
||||||
drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume);
|
= Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
|
||||||
textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain);
|
textureTerrain
|
||||||
generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", generateMaptiles);
|
= Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
|
||||||
}
|
generateMaptiles
|
||||||
catch
|
= Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles);
|
||||||
{
|
|
||||||
m_log.Warn("[MAPTILE]: Failed to load StartupConfig");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (generateMaptiles)
|
if (generateMaptiles)
|
||||||
{
|
{
|
||||||
|
@ -148,9 +145,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
{
|
{
|
||||||
m_config = source;
|
m_config = source;
|
||||||
|
|
||||||
IConfig startupConfig = m_config.Configs["Startup"];
|
if (Util.GetConfigVarFromSections<string>(
|
||||||
if (startupConfig.GetString("MapImageModule", "MapImageModule") !=
|
m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "MapImageModule")
|
||||||
"MapImageModule")
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
|
|
|
@ -71,8 +71,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||||
{
|
{
|
||||||
m_config = source;
|
m_config = source;
|
||||||
|
|
||||||
IConfig startupConfig = m_config.Configs["Startup"];
|
if (Util.GetConfigVarFromSections<string>(
|
||||||
if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule")
|
m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "Warp3DImageModule")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
|
@ -143,16 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||||
bool drawPrimVolume = true;
|
bool drawPrimVolume = true;
|
||||||
bool textureTerrain = true;
|
bool textureTerrain = true;
|
||||||
|
|
||||||
try
|
string[] configSections = new string[] { "Map", "Startup" };
|
||||||
{
|
|
||||||
IConfig startupConfig = m_config.Configs["Startup"];
|
drawPrimVolume
|
||||||
drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume);
|
= Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume);
|
||||||
textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain);
|
textureTerrain
|
||||||
}
|
= Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain);
|
||||||
catch
|
|
||||||
{
|
|
||||||
m_log.Warn("[WARP 3D IMAGE MODULE]: Failed to load StartupConfig");
|
|
||||||
}
|
|
||||||
|
|
||||||
m_colors.Clear();
|
m_colors.Clear();
|
||||||
|
|
||||||
|
|
|
@ -86,11 +86,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
#region INonSharedRegionModule Members
|
#region INonSharedRegionModule Members
|
||||||
public virtual void Initialise (IConfigSource config)
|
public virtual void Initialise (IConfigSource config)
|
||||||
{
|
{
|
||||||
IConfig startupConfig = config.Configs["Startup"];
|
string[] configSections = new string[] { "Map", "Startup" };
|
||||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
|
||||||
|
if (Util.GetConfigVarFromSections<string>(
|
||||||
|
config, "WorldMapModule", configSections, "WorldMap") == "WorldMap")
|
||||||
m_Enabled = true;
|
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)
|
public virtual void AddRegion (Scene scene)
|
||||||
|
|
|
@ -897,7 +897,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
|
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
|
||||||
|
|
||||||
m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
|
string[] possibleMapConfigSections = new string[] { "Map", "Startup" };
|
||||||
|
|
||||||
|
m_generateMaptiles
|
||||||
|
= Util.GetConfigVarFromSections<bool>(config, "GenerateMaptiles", possibleMapConfigSections, true);
|
||||||
|
|
||||||
if (m_generateMaptiles)
|
if (m_generateMaptiles)
|
||||||
{
|
{
|
||||||
int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
|
int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
|
||||||
|
@ -911,7 +915,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
|
string tile
|
||||||
|
= Util.GetConfigVarFromSections<string>(
|
||||||
|
config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString());
|
||||||
|
|
||||||
UUID tileID;
|
UUID tileID;
|
||||||
|
|
||||||
if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID))
|
if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID))
|
||||||
|
|
|
@ -268,32 +268,6 @@
|
||||||
;; Default script engine to use. Currently, we only have XEngine
|
;; Default script engine to use. Currently, we only have XEngine
|
||||||
; DefaultScriptEngine = "XEngine"
|
; DefaultScriptEngine = "XEngine"
|
||||||
|
|
||||||
;# {GenerateMaptiles} {} {Generate map tiles?} {true false} true
|
|
||||||
;; Map tile options. You can choose to generate normal maptiles or nominate an uploaded texture to
|
|
||||||
;; be the map tile using the MaptileStaticUUID parameter in this section or for individual regions in
|
|
||||||
;; the regions config file(s). If you do not want to upload map tiles at all, then you will need
|
|
||||||
;; to disable the MapImageServiceModule entirely.
|
|
||||||
; GenerateMaptiles = true
|
|
||||||
|
|
||||||
;# {MaptileRefresh} {GenerateMaptiles} {Maptile refresh period?} {} 0
|
|
||||||
;; If desired, a running region can update the map tiles periodically
|
|
||||||
;; to reflect building activity. This names no sense of you don't have
|
|
||||||
;; prims on maptiles. Value is in seconds.
|
|
||||||
; MaptileRefresh = 0
|
|
||||||
|
|
||||||
;# {MaptileStaticUUID} {} {Asset ID for static map texture} {} 00000000-0000-0000-0000-000000000000
|
|
||||||
;; If not generating maptiles, use this static texture asset ID
|
|
||||||
; MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
|
|
||||||
|
|
||||||
;# {TextureOnMapTile} {} {Use terrain textures for map tiles?} {true false} true
|
|
||||||
;; Use terrain texture for maptiles if true, use shaded green if false
|
|
||||||
; TextureOnMapTile = true
|
|
||||||
|
|
||||||
;# {DrawPrimOnMapTile} {} {Draw prim shapes on map tiles?} {true false} false
|
|
||||||
;; Draw objects on maptile. This step might take a long time if you've
|
|
||||||
;; got a large number of objects, so you can turn it off here if you'd like.
|
|
||||||
; DrawPrimOnMapTile = true
|
|
||||||
|
|
||||||
;# {HttpProxy} {} {Proxy URL for llHTTPRequest and dynamic texture loading} {} http://proxy.com:8080
|
;# {HttpProxy} {} {Proxy URL for llHTTPRequest and dynamic texture loading} {} http://proxy.com:8080
|
||||||
;; Http proxy setting for llHTTPRequest and dynamic texture loading, if
|
;; Http proxy setting for llHTTPRequest and dynamic texture loading, if
|
||||||
;; required
|
;; required
|
||||||
|
@ -362,6 +336,35 @@
|
||||||
;; This is a default that can be overwritten in some sections.
|
;; This is a default that can be overwritten in some sections.
|
||||||
; GatekeeperURI = "http://127.0.0.1:9000"
|
; GatekeeperURI = "http://127.0.0.1:9000"
|
||||||
|
|
||||||
|
|
||||||
|
[Map]
|
||||||
|
;# {GenerateMaptiles} {} {Generate map tiles?} {true false} true
|
||||||
|
;; Map tile options. You can choose to generate normal maptiles or nominate an uploaded texture to
|
||||||
|
;; be the map tile using the MaptileStaticUUID parameter in this section or for individual regions in
|
||||||
|
;; the regions config file(s). If you do not want to upload map tiles at all, then you will need
|
||||||
|
;; to disable the MapImageServiceModule entirely.
|
||||||
|
; GenerateMaptiles = true
|
||||||
|
|
||||||
|
;# {MaptileRefresh} {GenerateMaptiles} {Maptile refresh period?} {} 0
|
||||||
|
;; If desired, a running region can update the map tiles periodically
|
||||||
|
;; to reflect building activity. This names no sense of you don't have
|
||||||
|
;; prims on maptiles. Value is in seconds.
|
||||||
|
; MaptileRefresh = 0
|
||||||
|
|
||||||
|
;# {MaptileStaticUUID} {} {Asset ID for static map texture} {} 00000000-0000-0000-0000-000000000000
|
||||||
|
;; If not generating maptiles, use this static texture asset ID
|
||||||
|
; MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
|
||||||
|
|
||||||
|
;# {TextureOnMapTile} {} {Use terrain textures for map tiles?} {true false} true
|
||||||
|
;; Use terrain texture for maptiles if true, use shaded green if false
|
||||||
|
; TextureOnMapTile = true
|
||||||
|
|
||||||
|
;# {DrawPrimOnMapTile} {} {Draw prim shapes on map tiles?} {true false} false
|
||||||
|
;; Draw objects on maptile. This step might take a long time if you've
|
||||||
|
;; got a large number of objects, so you can turn it off here if you'd like.
|
||||||
|
; DrawPrimOnMapTile = true
|
||||||
|
|
||||||
|
|
||||||
[Estates]
|
[Estates]
|
||||||
; If these values are commented out then the user will be asked for estate details when required (this is the normal case).
|
; If these values are commented out then the user will be asked for estate details when required (this is the normal case).
|
||||||
; If these values are uncommented then they will be used to create a default estate as necessary.
|
; If these values are uncommented then they will be used to create a default estate as necessary.
|
||||||
|
|
|
@ -284,32 +284,6 @@
|
||||||
|
|
||||||
DefaultScriptEngine = "XEngine"
|
DefaultScriptEngine = "XEngine"
|
||||||
|
|
||||||
; ##
|
|
||||||
; ## WORLD MAP
|
|
||||||
; ##
|
|
||||||
|
|
||||||
;WorldMapModule = "WorldMap"
|
|
||||||
;MapImageModule = "MapImageModule"
|
|
||||||
|
|
||||||
; World map blacklist timeout in seconds
|
|
||||||
;BlacklistTimeout = 600
|
|
||||||
|
|
||||||
; Set to false to not generate any maptiles
|
|
||||||
;GenerateMaptiles = true
|
|
||||||
|
|
||||||
; Refresh (in seconds) the map tile periodically
|
|
||||||
;MaptileRefresh = 0
|
|
||||||
|
|
||||||
; If not generating maptiles, use this static texture asset ID
|
|
||||||
;MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
|
|
||||||
|
|
||||||
; Draw objects on maptile. This step might take a long time if you've got a large number of
|
|
||||||
; objects, so you can turn it off here if you'd like.
|
|
||||||
DrawPrimOnMapTile = true
|
|
||||||
|
|
||||||
; Use terrain texture for maptiles if true, use shaded green if false
|
|
||||||
TextureOnMapTile = true
|
|
||||||
|
|
||||||
; ##
|
; ##
|
||||||
; ## EMAIL MODULE
|
; ## EMAIL MODULE
|
||||||
; ##
|
; ##
|
||||||
|
@ -347,6 +321,30 @@
|
||||||
UseTrashOnDelete = True
|
UseTrashOnDelete = True
|
||||||
|
|
||||||
|
|
||||||
|
[Map]
|
||||||
|
;WorldMapModule = "WorldMap"
|
||||||
|
;MapImageModule = "MapImageModule"
|
||||||
|
|
||||||
|
; World map blacklist timeout in seconds
|
||||||
|
;BlacklistTimeout = 600
|
||||||
|
|
||||||
|
; Set to false to not generate any maptiles
|
||||||
|
;GenerateMaptiles = true
|
||||||
|
|
||||||
|
; Refresh (in seconds) the map tile periodically
|
||||||
|
;MaptileRefresh = 0
|
||||||
|
|
||||||
|
; If not generating maptiles, use this static texture asset ID
|
||||||
|
;MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
|
||||||
|
|
||||||
|
; Draw objects on maptile. This step might take a long time if you've got a large number of
|
||||||
|
; objects, so you can turn it off here if you'd like.
|
||||||
|
DrawPrimOnMapTile = true
|
||||||
|
|
||||||
|
; Use terrain texture for maptiles if true, use shaded green if false
|
||||||
|
TextureOnMapTile = true
|
||||||
|
|
||||||
|
|
||||||
[RegionReady]
|
[RegionReady]
|
||||||
; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled
|
; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
Loading…
Reference in New Issue