From ddbf81fa07aac8098d9fa8d979969fffd5436f75 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 13 Mar 2009 23:45:02 +0000 Subject: Thank you, mcortez, for a patch that fixes a number of long standing issues with the sun module. Fixes Mantis #3295 --- OpenSim/Region/Framework/Scenes/EventManager.cs | 33 +++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 8a556d9..8621f70 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -202,10 +202,10 @@ namespace OpenSim.Region.Framework.Scenes public event ScriptTimerEvent OnScriptTimerEvent; - public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); + public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); - public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate; + public event EstateToolsSunUpdate OnEstateToolsSunUpdate; public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; @@ -264,7 +264,7 @@ namespace OpenSim.Region.Framework.Scenes public event ChatBroadcastEvent OnChatBroadcast; public delegate float SunLindenHour(); - public event SunLindenHour OnGetSunLindenHour; + public event SunLindenHour OnGetCurrentTimeAsLindenSunHour; /// /// Called when oar file has finished loading, although @@ -411,14 +411,14 @@ namespace OpenSim.Region.Framework.Scenes private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; private ScriptTimerEvent handlerScriptTimerEvent = null; - private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null; + private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; private ScriptColliding handlerCollidingStart = null; private ScriptColliding handlerColliding = null; private ScriptColliding handlerCollidingEnd = null; private GetScriptRunning handlerGetScriptRunning = null; - private SunLindenHour handlerSunGetLindenHour = null; + private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; private OnSetRootAgentSceneDelegate handlerSetRootAgentScene = null; private OarFileLoaded handlerOarFileLoaded = null; @@ -910,21 +910,28 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) + /// + /// Updates the system as to how the position of the sun should be handled. + /// + /// + /// True if the Sun Position is fixed + /// True if the Estate Settings should be used instead of region + /// 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 + public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) { - handlerEstateToolsTimeUpdate = OnEstateToolsTimeUpdate; - if (handlerEstateToolsTimeUpdate != null) + handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; + if (handlerEstateToolsSunUpdate != null) { - handlerEstateToolsTimeUpdate(regionHandle, FixedTime, useEstateTime, LindenHour); + handlerEstateToolsSunUpdate(regionHandle, FixedTime, useEstateTime, FixedSunHour); } } - public float GetSunLindenHour() + public float GetCurrentTimeAsSunLindenHour() { - handlerSunGetLindenHour = OnGetSunLindenHour; - if (handlerSunGetLindenHour != null) + handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; + if (handlerCurrentTimeAsLindenSunHour != null) { - return handlerSunGetLindenHour(); + return handlerCurrentTimeAsLindenSunHour(); } return 6; } -- cgit v1.1