Save the sun's position in OARs
parent
08db3c5a8e
commit
804fe2d9b0
|
@ -182,6 +182,9 @@ namespace OpenSim.Framework.Serialization.External
|
|||
case "FixedSun":
|
||||
settings.FixedSun = bool.Parse(xtr.ReadElementContentAsString());
|
||||
break;
|
||||
case "SunPosition":
|
||||
settings.SunPosition = double.Parse(xtr.ReadElementContentAsString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,8 +240,9 @@ namespace OpenSim.Framework.Serialization.External
|
|||
xtw.WriteElementString("TerrainLowerLimit", settings.TerrainLowerLimit.ToString());
|
||||
xtw.WriteElementString("UseEstateSun", settings.UseEstateSun.ToString());
|
||||
xtw.WriteElementString("FixedSun", settings.FixedSun.ToString());
|
||||
// XXX: Need to expose interface to get sun phase information from sun module
|
||||
// xtw.WriteStartElement("SunPhase",
|
||||
xtw.WriteElementString("SunPosition", settings.SunPosition.ToString());
|
||||
// Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which
|
||||
// calculates it automatically according to the date and other factors.
|
||||
xtw.WriteEndElement();
|
||||
|
||||
xtw.WriteEndElement();
|
||||
|
|
|
@ -488,6 +488,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
currentRegionSettings.Elevation2SE = loadedRegionSettings.Elevation2SE;
|
||||
currentRegionSettings.Elevation2SW = loadedRegionSettings.Elevation2SW;
|
||||
currentRegionSettings.FixedSun = loadedRegionSettings.FixedSun;
|
||||
currentRegionSettings.SunPosition = loadedRegionSettings.SunPosition;
|
||||
currentRegionSettings.ObjectBonus = loadedRegionSettings.ObjectBonus;
|
||||
currentRegionSettings.RestrictPushing = loadedRegionSettings.RestrictPushing;
|
||||
currentRegionSettings.TerrainLowerLimit = loadedRegionSettings.TerrainLowerLimit;
|
||||
|
@ -500,6 +501,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
|
||||
|
||||
currentRegionSettings.Save();
|
||||
|
||||
m_scene.TriggerEstateSunUpdate();
|
||||
|
||||
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
|
||||
|
||||
|
|
|
@ -440,6 +440,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
rs.Elevation2SE = 9.2;
|
||||
rs.Elevation2SW = 2.1;
|
||||
rs.FixedSun = true;
|
||||
rs.SunPosition = 12.0;
|
||||
rs.ObjectBonus = 1.4;
|
||||
rs.RestrictPushing = true;
|
||||
rs.TerrainLowerLimit = 0.4;
|
||||
|
@ -485,6 +486,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2));
|
||||
Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1));
|
||||
Assert.That(loadedRs.FixedSun, Is.True);
|
||||
Assert.AreEqual(12.0, loadedRs.SunPosition);
|
||||
Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4));
|
||||
Assert.That(loadedRs.RestrictPushing, Is.True);
|
||||
Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4));
|
||||
|
|
Loading…
Reference in New Issue