diff options
author | Melanie Thielker | 2009-03-13 23:45:02 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-03-13 23:45:02 +0000 |
commit | ddbf81fa07aac8098d9fa8d979969fffd5436f75 (patch) | |
tree | d65b3b280a53fe74253af2bfeee9bf3944dfa10b /OpenSim/Region/CoreModules/World/Estate | |
parent | * Support loading empty folders in an iar (diff) | |
download | opensim-SC_OLD-ddbf81fa07aac8098d9fa8d979969fffd5436f75.zip opensim-SC_OLD-ddbf81fa07aac8098d9fa8d979969fffd5436f75.tar.gz opensim-SC_OLD-ddbf81fa07aac8098d9fa8d979969fffd5436f75.tar.bz2 opensim-SC_OLD-ddbf81fa07aac8098d9fa8d979969fffd5436f75.tar.xz |
Thank you, mcortez, for a patch that fixes a number of long standing
issues with the sun module.
Fixes Mantis #3295
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 7a200d4..3bde967 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
201 | m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; | 201 | m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; |
202 | m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; | 202 | m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; |
203 | 203 | ||
204 | m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseEstateSun, SunHour); | 204 | TriggerEstateToolsSunUpdate(); |
205 | 205 | ||
206 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); | 206 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); |
207 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); | 207 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); |
@@ -819,19 +819,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
819 | 819 | ||
820 | m_scene.RegionInfo.EstateSettings.Save(); | 820 | m_scene.RegionInfo.EstateSettings.Save(); |
821 | 821 | ||
822 | float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition; | 822 | TriggerEstateToolsSunUpdate(); |
823 | if (m_scene.RegionInfo.RegionSettings.UseEstateSun) | ||
824 | { | ||
825 | sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition; | ||
826 | if (m_scene.RegionInfo.EstateSettings.UseGlobalTime) | ||
827 | sun = m_scene.EventManager.GetSunLindenHour(); | ||
828 | } | ||
829 | |||
830 | m_scene.EventManager.TriggerEstateToolsTimeUpdate( | ||
831 | m_scene.RegionInfo.RegionHandle, | ||
832 | m_scene.RegionInfo.EstateSettings.FixedSun || | ||
833 | m_scene.RegionInfo.RegionSettings.FixedSun, | ||
834 | m_scene.RegionInfo.RegionSettings.UseEstateSun, sun); | ||
835 | 823 | ||
836 | sendDetailedEstateData(remoteClient, invoice); | 824 | sendDetailedEstateData(remoteClient, invoice); |
837 | } | 825 | } |
@@ -851,6 +839,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
851 | 839 | ||
852 | public void PostInitialise() | 840 | public void PostInitialise() |
853 | { | 841 | { |
842 | // Sets up the sun module based no the saved Estate and Region Settings | ||
843 | // DO NOT REMOVE or the sun will stop working | ||
844 | TriggerEstateToolsSunUpdate(); | ||
854 | } | 845 | } |
855 | 846 | ||
856 | public void Close() | 847 | public void Close() |
@@ -871,6 +862,40 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
871 | 862 | ||
872 | #region Other Functions | 863 | #region Other Functions |
873 | 864 | ||
865 | private void TriggerEstateToolsSunUpdate() | ||
866 | { | ||
867 | float sun; | ||
868 | if (m_scene.RegionInfo.RegionSettings.UseEstateSun) | ||
869 | { | ||
870 | sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition; | ||
871 | if (m_scene.RegionInfo.EstateSettings.UseGlobalTime) | ||
872 | { | ||
873 | sun = m_scene.EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f; | ||
874 | } | ||
875 | |||
876 | // | ||
877 | m_scene.EventManager.TriggerEstateToolsSunUpdate( | ||
878 | m_scene.RegionInfo.RegionHandle, | ||
879 | m_scene.RegionInfo.EstateSettings.FixedSun, | ||
880 | m_scene.RegionInfo.RegionSettings.UseEstateSun, | ||
881 | sun); | ||
882 | } | ||
883 | else | ||
884 | { | ||
885 | // Use the Sun Position from the Region Settings | ||
886 | sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition - 6.0f; | ||
887 | |||
888 | m_scene.EventManager.TriggerEstateToolsSunUpdate( | ||
889 | m_scene.RegionInfo.RegionHandle, | ||
890 | m_scene.RegionInfo.RegionSettings.FixedSun, | ||
891 | m_scene.RegionInfo.RegionSettings.UseEstateSun, | ||
892 | sun); | ||
893 | } | ||
894 | |||
895 | |||
896 | } | ||
897 | |||
898 | |||
874 | public void changeWaterHeight(float height) | 899 | public void changeWaterHeight(float height) |
875 | { | 900 | { |
876 | setRegionTerrainSettings(height, | 901 | setRegionTerrainSettings(height, |