diff options
author | Oren Hurvitz | 2011-05-20 12:52:09 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-10 20:55:58 +0100 |
commit | 804fe2d9b00e7e974600f17d64375fab8676ad11 (patch) | |
tree | 7ee578681cc46312395354a24ce465938a495cf2 | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-804fe2d9b00e7e974600f17d64375fab8676ad11.zip opensim-SC-804fe2d9b00e7e974600f17d64375fab8676ad11.tar.gz opensim-SC-804fe2d9b00e7e974600f17d64375fab8676ad11.tar.bz2 opensim-SC-804fe2d9b00e7e974600f17d64375fab8676ad11.tar.xz |
Save the sun's position in OARs
3 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 6ba4c5a..931898c 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs | |||
@@ -182,6 +182,9 @@ namespace OpenSim.Framework.Serialization.External | |||
182 | case "FixedSun": | 182 | case "FixedSun": |
183 | settings.FixedSun = bool.Parse(xtr.ReadElementContentAsString()); | 183 | settings.FixedSun = bool.Parse(xtr.ReadElementContentAsString()); |
184 | break; | 184 | break; |
185 | case "SunPosition": | ||
186 | settings.SunPosition = double.Parse(xtr.ReadElementContentAsString()); | ||
187 | break; | ||
185 | } | 188 | } |
186 | } | 189 | } |
187 | 190 | ||
@@ -237,8 +240,9 @@ namespace OpenSim.Framework.Serialization.External | |||
237 | xtw.WriteElementString("TerrainLowerLimit", settings.TerrainLowerLimit.ToString()); | 240 | xtw.WriteElementString("TerrainLowerLimit", settings.TerrainLowerLimit.ToString()); |
238 | xtw.WriteElementString("UseEstateSun", settings.UseEstateSun.ToString()); | 241 | xtw.WriteElementString("UseEstateSun", settings.UseEstateSun.ToString()); |
239 | xtw.WriteElementString("FixedSun", settings.FixedSun.ToString()); | 242 | xtw.WriteElementString("FixedSun", settings.FixedSun.ToString()); |
240 | // XXX: Need to expose interface to get sun phase information from sun module | 243 | xtw.WriteElementString("SunPosition", settings.SunPosition.ToString()); |
241 | // xtw.WriteStartElement("SunPhase", | 244 | // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which |
245 | // calculates it automatically according to the date and other factors. | ||
242 | xtw.WriteEndElement(); | 246 | xtw.WriteEndElement(); |
243 | 247 | ||
244 | xtw.WriteEndElement(); | 248 | xtw.WriteEndElement(); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 6461636..48130e7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -488,6 +488,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
488 | currentRegionSettings.Elevation2SE = loadedRegionSettings.Elevation2SE; | 488 | currentRegionSettings.Elevation2SE = loadedRegionSettings.Elevation2SE; |
489 | currentRegionSettings.Elevation2SW = loadedRegionSettings.Elevation2SW; | 489 | currentRegionSettings.Elevation2SW = loadedRegionSettings.Elevation2SW; |
490 | currentRegionSettings.FixedSun = loadedRegionSettings.FixedSun; | 490 | currentRegionSettings.FixedSun = loadedRegionSettings.FixedSun; |
491 | currentRegionSettings.SunPosition = loadedRegionSettings.SunPosition; | ||
491 | currentRegionSettings.ObjectBonus = loadedRegionSettings.ObjectBonus; | 492 | currentRegionSettings.ObjectBonus = loadedRegionSettings.ObjectBonus; |
492 | currentRegionSettings.RestrictPushing = loadedRegionSettings.RestrictPushing; | 493 | currentRegionSettings.RestrictPushing = loadedRegionSettings.RestrictPushing; |
493 | currentRegionSettings.TerrainLowerLimit = loadedRegionSettings.TerrainLowerLimit; | 494 | currentRegionSettings.TerrainLowerLimit = loadedRegionSettings.TerrainLowerLimit; |
@@ -500,6 +501,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
500 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; | 501 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; |
501 | 502 | ||
502 | currentRegionSettings.Save(); | 503 | currentRegionSettings.Save(); |
504 | |||
505 | m_scene.TriggerEstateSunUpdate(); | ||
503 | 506 | ||
504 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); | 507 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); |
505 | 508 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 34e2e23..6ba3459 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -440,6 +440,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
440 | rs.Elevation2SE = 9.2; | 440 | rs.Elevation2SE = 9.2; |
441 | rs.Elevation2SW = 2.1; | 441 | rs.Elevation2SW = 2.1; |
442 | rs.FixedSun = true; | 442 | rs.FixedSun = true; |
443 | rs.SunPosition = 12.0; | ||
443 | rs.ObjectBonus = 1.4; | 444 | rs.ObjectBonus = 1.4; |
444 | rs.RestrictPushing = true; | 445 | rs.RestrictPushing = true; |
445 | rs.TerrainLowerLimit = 0.4; | 446 | rs.TerrainLowerLimit = 0.4; |
@@ -485,6 +486,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
485 | Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2)); | 486 | Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2)); |
486 | Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1)); | 487 | Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1)); |
487 | Assert.That(loadedRs.FixedSun, Is.True); | 488 | Assert.That(loadedRs.FixedSun, Is.True); |
489 | Assert.AreEqual(12.0, loadedRs.SunPosition); | ||
488 | Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4)); | 490 | Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4)); |
489 | Assert.That(loadedRs.RestrictPushing, Is.True); | 491 | Assert.That(loadedRs.RestrictPushing, Is.True); |
490 | Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4)); | 492 | Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4)); |