From 42c5dca9896964f89dbd6c71bfa0057940eda80d Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 2 Jun 2008 10:01:02 +0000 Subject: * Fixes a bug saving the current sun phase to the estate_settings file. --- .../Modules/World/Estate/EstateManagementModule.cs | 8 +++++++- OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | 4 +++- OpenSim/Region/Environment/Scenes/EventManager.cs | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 6476a4b..147e4aa 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 713060f..bb4a568 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 c7d21c8..ea44f9a 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; + } } } -- cgit v1.1