aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorOren Hurvitz2012-12-25 10:47:45 +0200
committerJustin Clark-Casey (justincc)2013-01-02 23:16:24 +0000
commit1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d (patch)
tree1f8357faff5890d6aae27277b57a6adfbbecf2db /OpenSim/Region/Framework
parentFixed: the AvatarEnteringNewParcel event wasn't triggered in some cases (diff)
downloadopensim-SC-1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d.zip
opensim-SC-1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d.tar.gz
opensim-SC-1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d.tar.bz2
opensim-SC-1a6694b26487e4b9bd33e1c6c4415fb7d36f0d1d.tar.xz
Fixed several problems with the Sun: some settings didn't work, or were inconsistently used. - The sun position is always calculated by combining the sun settings in the Region and Estate. This fixes the problem that 'UseEstateSun' didn't work. - To remove ambiguity, the EstateToolsSunUpdate event no longer accepts the sun's position as parameters. That's because the position is always calculated from the Region and Estate settings. - Use only the 'FixedSun' flag to determine whether the sun is fixed; not the 'UseGlobalTime' flag. - Don't change the region's 'SunPosition' field according to the sun's position: this field is used only to set the position when using a FixedSun. (The 'SunVector' field does get updated according to the sun's position in the sky)
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs28
2 files changed, 6 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 4c49b71..6b08e0f 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -751,7 +751,7 @@ namespace OpenSim.Region.Framework.Scenes
751 public event ScriptTimerEvent OnScriptTimerEvent; 751 public event ScriptTimerEvent OnScriptTimerEvent;
752 */ 752 */
753 753
754 public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); 754 public delegate void EstateToolsSunUpdate(ulong regionHandle);
755 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); 755 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
756 756
757 public event EstateToolsSunUpdate OnEstateToolsSunUpdate; 757 public event EstateToolsSunUpdate OnEstateToolsSunUpdate;
@@ -2507,13 +2507,10 @@ namespace OpenSim.Region.Framework.Scenes
2507 } 2507 }
2508 2508
2509 /// <summary> 2509 /// <summary>
2510 /// Updates the system as to how the position of the sun should be handled. 2510 /// Called when the sun's position parameters have changed in the Region and/or Estate
2511 /// </summary> 2511 /// </summary>
2512 /// <param name="regionHandle"></param> 2512 /// <param name="regionHandle">The region that changed</param>
2513 /// <param name="FixedTime">True if the Sun Position is fixed</param> 2513 public void TriggerEstateToolsSunUpdate(ulong regionHandle)
2514 /// <param name="useEstateTime">True if the Estate Settings should be used instead of region</param>
2515 /// <param name="FixedSunHour">The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1</param>
2516 public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour)
2517 { 2514 {
2518 EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; 2515 EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate;
2519 if (handlerEstateToolsSunUpdate != null) 2516 if (handlerEstateToolsSunUpdate != null)
@@ -2522,7 +2519,7 @@ namespace OpenSim.Region.Framework.Scenes
2522 { 2519 {
2523 try 2520 try
2524 { 2521 {
2525 d(regionHandle, FixedTime, useEstateTime, FixedSunHour); 2522 d(regionHandle);
2526 } 2523 }
2527 catch (Exception e) 2524 catch (Exception e)
2528 { 2525 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cca295c..11b63b7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5345,33 +5345,7 @@ namespace OpenSim.Region.Framework.Scenes
5345 5345
5346 public void TriggerEstateSunUpdate() 5346 public void TriggerEstateSunUpdate()
5347 { 5347 {
5348 float sun; 5348 EventManager.TriggerEstateToolsSunUpdate(RegionInfo.RegionHandle);
5349 if (RegionInfo.RegionSettings.UseEstateSun)
5350 {
5351 sun = (float)RegionInfo.EstateSettings.SunPosition;
5352 if (RegionInfo.EstateSettings.UseGlobalTime)
5353 {
5354 sun = EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f;
5355 }
5356
5357 //
5358 EventManager.TriggerEstateToolsSunUpdate(
5359 RegionInfo.RegionHandle,
5360 RegionInfo.EstateSettings.FixedSun,
5361 RegionInfo.RegionSettings.UseEstateSun,
5362 sun);
5363 }
5364 else
5365 {
5366 // Use the Sun Position from the Region Settings
5367 sun = (float)RegionInfo.RegionSettings.SunPosition - 6.0f;
5368
5369 EventManager.TriggerEstateToolsSunUpdate(
5370 RegionInfo.RegionHandle,
5371 RegionInfo.RegionSettings.FixedSun,
5372 RegionInfo.RegionSettings.UseEstateSun,
5373 sun);
5374 }
5375 } 5349 }
5376 5350
5377 private void HandleReloadEstate(string module, string[] cmd) 5351 private void HandleReloadEstate(string module, string[] cmd)