Finally putting estate_settings.xml to rest. There will be no more attempts

to read or write this file.
0.7.0.2-release
Melanie 2010-08-21 17:38:47 +01:00
parent dad6ba2448
commit a3eeac45a7
1 changed files with 0 additions and 198 deletions

View File

@ -33,8 +33,6 @@ namespace OpenSim.Framework
{ {
public class RegionSettings public class RegionSettings
{ {
private ConfigurationMember configMember;
public delegate void SaveDelegate(RegionSettings rs); public delegate void SaveDelegate(RegionSettings rs);
public event SaveDelegate OnSave; public event SaveDelegate OnSave;
@ -47,202 +45,6 @@ namespace OpenSim.Framework
public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
public RegionSettings()
{
if (configMember == null)
{
try
{
configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true);
configMember.performConfigurationRetrieve();
}
catch (Exception)
{
}
}
}
public void LoadConfigurationOptions()
{
configMember.addConfigurationOption("region_flags",
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
String.Empty, "336723974", true);
configMember.addConfigurationOption("max_agents",
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
String.Empty, "40", true);
configMember.addConfigurationOption("object_bonus_factor",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "1.0", true);
configMember.addConfigurationOption("sim_access",
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
String.Empty, "21", true);
configMember.addConfigurationOption("terrain_base_0",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, DEFAULT_TERRAIN_TEXTURE_1.ToString(), true);
configMember.addConfigurationOption("terrain_base_1",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, DEFAULT_TERRAIN_TEXTURE_2.ToString(), true);
configMember.addConfigurationOption("terrain_base_2",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, DEFAULT_TERRAIN_TEXTURE_3.ToString(), true);
configMember.addConfigurationOption("terrain_base_3",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, DEFAULT_TERRAIN_TEXTURE_4.ToString(), true);
configMember.addConfigurationOption("terrain_start_height_0",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "10.0", true);
configMember.addConfigurationOption("terrain_start_height_1",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "10.0", true);
configMember.addConfigurationOption("terrain_start_height_2",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "10.0", true);
configMember.addConfigurationOption("terrain_start_height_3",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "10.0", true);
configMember.addConfigurationOption("terrain_height_range_0",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "60.0", true);
configMember.addConfigurationOption("terrain_height_range_1",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "60.0", true);
configMember.addConfigurationOption("terrain_height_range_2",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "60.0", true);
configMember.addConfigurationOption("terrain_height_range_3",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "60.0", true);
configMember.addConfigurationOption("region_water_height",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "20.0", true);
configMember.addConfigurationOption("terrain_raise_limit",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "100.0", true);
configMember.addConfigurationOption("terrain_lower_limit",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "-100.0", true);
configMember.addConfigurationOption("sun_hour",
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
String.Empty, "0.0", true);
}
public bool HandleIncomingConfiguration(string key, object value)
{
switch (key)
{
case "region_flags":
RegionFlags flags = (RegionFlags)(uint)value;
m_BlockTerraform =
(flags & RegionFlags.BlockTerraform) != 0;
m_BlockFly =
(flags & RegionFlags.NoFly) != 0;
m_AllowDamage =
(flags & RegionFlags.AllowDamage) != 0;
m_RestrictPushing =
(flags & RegionFlags.RestrictPushObject) != 0;
m_AllowLandResell =
(flags & RegionFlags.BlockLandResell) == 0;
m_AllowLandJoinDivide =
(flags & RegionFlags.AllowParcelChanges) != 0;
m_BlockShowInSearch =
((uint)flags & (1 << 29)) != 0;
m_DisableScripts =
(flags & RegionFlags.SkipScripts) != 0;
m_DisableCollisions =
(flags & RegionFlags.SkipCollisions) != 0;
m_DisablePhysics =
(flags & RegionFlags.SkipPhysics) != 0;
m_FixedSun =
(flags & RegionFlags.SunFixed) != 0;
m_Sandbox =
(flags & RegionFlags.Sandbox) != 0;
break;
case "max_agents":
m_AgentLimit = (int)value;
break;
case "object_bonus_factor":
m_ObjectBonus = (double)value;
break;
case "sim_access":
int access = (int)value;
if (access <= 13)
m_Maturity = 0;
else
m_Maturity = 1;
break;
case "terrain_base_0":
m_TerrainTexture1 = (UUID)value;
break;
case "terrain_base_1":
m_TerrainTexture2 = (UUID)value;
break;
case "terrain_base_2":
m_TerrainTexture3 = (UUID)value;
break;
case "terrain_base_3":
m_TerrainTexture4 = (UUID)value;
break;
case "terrain_start_height_0":
m_Elevation1SW = (double)value;
break;
case "terrain_start_height_1":
m_Elevation1NW = (double)value;
break;
case "terrain_start_height_2":
m_Elevation1SE = (double)value;
break;
case "terrain_start_height_3":
m_Elevation1NE = (double)value;
break;
case "terrain_height_range_0":
m_Elevation2SW = (double)value;
break;
case "terrain_height_range_1":
m_Elevation2NW = (double)value;
break;
case "terrain_height_range_2":
m_Elevation2SE = (double)value;
break;
case "terrain_height_range_3":
m_Elevation2NE = (double)value;
break;
case "region_water_height":
m_WaterHeight = (double)value;
break;
case "terrain_raise_limit":
m_TerrainRaiseLimit = (double)value;
break;
case "terrain_lower_limit":
m_TerrainLowerLimit = (double)value;
break;
case "sun_hour":
m_SunPosition = (double)value;
break;
}
return true;
}
public void Save() public void Save()
{ {
if (OnSave != null) if (OnSave != null)