diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 6476a4b5fd..147e4aa9d5 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -302,13 +302,19 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY; args.regionFlags = (uint)(m_scene.RegionInfo.EstateSettings.regionFlags); args.simAccess = (byte)m_scene.RegionInfo.EstateSettings.simAccess; - args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour; + + if (m_scene.RegionInfo.EstateSettings.useFixedSun) + args.sunHour = m_scene.RegionInfo.EstateSettings.sunHour; + else + args.sunHour = m_scene.EventManager.GetSunLindenHour(); + args.terrainLowerLimit = m_scene.RegionInfo.EstateSettings.terrainLowerLimit; args.terrainRaiseLimit = m_scene.RegionInfo.EstateSettings.terrainRaiseLimit; args.useEstateSun = !m_scene.RegionInfo.EstateSettings.useFixedSun; args.waterHeight = m_scene.RegionInfo.EstateSettings.waterHeight; args.simName = m_scene.RegionInfo.RegionName; + remote_client.sendRegionInfoToEstateMenu(args); } diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 713060f12b..bb4a5689c4 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -230,6 +230,7 @@ namespace OpenSim.Region.Environment.Modules scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnEstateToolsTimeUpdate += EstateToolsTimeUpdate; + scene.EventManager.OnGetSunLindenHour += GetLindenEstateHourFromCurrentTime; ready = true; @@ -256,6 +257,7 @@ namespace OpenSim.Region.Environment.Modules m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; m_scene.EventManager.OnClientClosed -= ClientLoggedOut; m_scene.EventManager.OnEstateToolsTimeUpdate -= EstateToolsTimeUpdate; + m_scene.EventManager.OnGetSunLindenHour -= GetLindenEstateHourFromCurrentTime; } public string Name @@ -300,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules // set estate settings for region access to sun position m_scene.RegionInfo.EstateSettings.sunPosition = Position; - m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime(); + //m_scene.RegionInfo.EstateSettings.sunHour = GetLindenEstateHourFromCurrentTime(); } public void ForceSunUpdateToAllClients() { diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index c7d21c8d0d..ea44f9a3e3 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -228,6 +228,9 @@ namespace OpenSim.Region.Environment.Scenes public delegate void ChatBroadcastEvent(Object sender, ChatFromViewerArgs chat); public event ChatBroadcastEvent OnChatBroadcast; + public delegate float SunLindenHour(); + public event SunLindenHour OnGetSunLindenHour; + public class MoneyTransferArgs : EventArgs { public LLUUID sender; @@ -350,6 +353,8 @@ namespace OpenSim.Region.Environment.Scenes private ScriptTimerEvent handlerScriptTimerEvent = null; private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null; + private SunLindenHour handlerSunGetLindenHour = null; + public void TriggerOnScriptChangedEvent(uint localID, uint change) { handlerScriptChangedEvent = OnScriptChangedEvent; @@ -810,5 +815,15 @@ namespace OpenSim.Region.Environment.Scenes handlerEstateToolsTimeUpdate(regionHandle, FixedTime, useEstateTime, LindenHour); } } + + public float GetSunLindenHour() + { + handlerSunGetLindenHour = OnGetSunLindenHour; + if (handlerSunGetLindenHour != null) + { + return handlerSunGetLindenHour(); + } + return 6; + } } }