diff options
author | Melanie Thielker | 2010-05-04 18:10:13 +0200 |
---|---|---|
committer | Melanie | 2010-05-04 15:52:36 +0100 |
commit | 6eea0a39316483d2e1d02374e6caf2397ed9e3b6 (patch) | |
tree | 30f16b430004efc8a67447d4f9a5184fa53cd854 | |
parent | Allow regions to get the list of the other regions in the estate (diff) | |
download | opensim-SC_OLD-6eea0a39316483d2e1d02374e6caf2397ed9e3b6.zip opensim-SC_OLD-6eea0a39316483d2e1d02374e6caf2397ed9e3b6.tar.gz opensim-SC_OLD-6eea0a39316483d2e1d02374e6caf2397ed9e3b6.tar.bz2 opensim-SC_OLD-6eea0a39316483d2e1d02374e6caf2397ed9e3b6.tar.xz |
Allow reloading of estate settings into a running region. Move sun update
helper into Scene, since that is less evil than exposing m_storageManager
to the public.
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 46 |
2 files changed, 49 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 91d40ab..77068b0 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
212 | m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; | 212 | m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; |
213 | m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; | 213 | m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; |
214 | 214 | ||
215 | TriggerEstateToolsSunUpdate(); | 215 | m_scene.TriggerEstateSunUpdate(); |
216 | 216 | ||
217 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); | 217 | //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); |
218 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); | 218 | //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); |
@@ -861,7 +861,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
861 | 861 | ||
862 | m_scene.RegionInfo.EstateSettings.Save(); | 862 | m_scene.RegionInfo.EstateSettings.Save(); |
863 | 863 | ||
864 | TriggerEstateToolsSunUpdate(); | 864 | m_scene.TriggerEstateSunUpdate(); |
865 | 865 | ||
866 | sendDetailedEstateData(remoteClient, invoice); | 866 | sendDetailedEstateData(remoteClient, invoice); |
867 | } | 867 | } |
@@ -983,7 +983,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
983 | { | 983 | { |
984 | // Sets up the sun module based no the saved Estate and Region Settings | 984 | // Sets up the sun module based no the saved Estate and Region Settings |
985 | // DO NOT REMOVE or the sun will stop working | 985 | // DO NOT REMOVE or the sun will stop working |
986 | TriggerEstateToolsSunUpdate(); | 986 | m_scene.TriggerEstateSunUpdate(); |
987 | } | 987 | } |
988 | 988 | ||
989 | public void Close() | 989 | public void Close() |
@@ -1004,40 +1004,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1004 | 1004 | ||
1005 | #region Other Functions | 1005 | #region Other Functions |
1006 | 1006 | ||
1007 | private void TriggerEstateToolsSunUpdate() | ||
1008 | { | ||
1009 | float sun; | ||
1010 | if (m_scene.RegionInfo.RegionSettings.UseEstateSun) | ||
1011 | { | ||
1012 | sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition; | ||
1013 | if (m_scene.RegionInfo.EstateSettings.UseGlobalTime) | ||
1014 | { | ||
1015 | sun = m_scene.EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f; | ||
1016 | } | ||
1017 | |||
1018 | // | ||
1019 | m_scene.EventManager.TriggerEstateToolsSunUpdate( | ||
1020 | m_scene.RegionInfo.RegionHandle, | ||
1021 | m_scene.RegionInfo.EstateSettings.FixedSun, | ||
1022 | m_scene.RegionInfo.RegionSettings.UseEstateSun, | ||
1023 | sun); | ||
1024 | } | ||
1025 | else | ||
1026 | { | ||
1027 | // Use the Sun Position from the Region Settings | ||
1028 | sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition - 6.0f; | ||
1029 | |||
1030 | m_scene.EventManager.TriggerEstateToolsSunUpdate( | ||
1031 | m_scene.RegionInfo.RegionHandle, | ||
1032 | m_scene.RegionInfo.RegionSettings.FixedSun, | ||
1033 | m_scene.RegionInfo.RegionSettings.UseEstateSun, | ||
1034 | sun); | ||
1035 | } | ||
1036 | |||
1037 | |||
1038 | } | ||
1039 | |||
1040 | |||
1041 | public void changeWaterHeight(float height) | 1007 | public void changeWaterHeight(float height) |
1042 | { | 1008 | { |
1043 | setRegionTerrainSettings(height, | 1009 | setRegionTerrainSettings(height, |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3e4694a..da18629 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5075,5 +5075,51 @@ namespace OpenSim.Region.Framework.Scenes | |||
5075 | { | 5075 | { |
5076 | return new Vector3(x, y, GetGroundHeight(x, y)); | 5076 | return new Vector3(x, y, GetGroundHeight(x, y)); |
5077 | } | 5077 | } |
5078 | |||
5079 | public List<UUID> GetEstateRegions(int estateID) | ||
5080 | { | ||
5081 | if (m_storageManager.EstateDataStore == null) | ||
5082 | return new List<UUID>(); | ||
5083 | |||
5084 | return m_storageManager.EstateDataStore.GetRegions(estateID); | ||
5085 | } | ||
5086 | |||
5087 | public void ReloadEstateData() | ||
5088 | { | ||
5089 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | ||
5090 | |||
5091 | TriggerEstateSunUpdate(); | ||
5092 | } | ||
5093 | |||
5094 | public void TriggerEstateSunUpdate() | ||
5095 | { | ||
5096 | float sun; | ||
5097 | if (RegionInfo.RegionSettings.UseEstateSun) | ||
5098 | { | ||
5099 | sun = (float)RegionInfo.EstateSettings.SunPosition; | ||
5100 | if (RegionInfo.EstateSettings.UseGlobalTime) | ||
5101 | { | ||
5102 | sun = EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f; | ||
5103 | } | ||
5104 | |||
5105 | // | ||
5106 | EventManager.TriggerEstateToolsSunUpdate( | ||
5107 | RegionInfo.RegionHandle, | ||
5108 | RegionInfo.EstateSettings.FixedSun, | ||
5109 | RegionInfo.RegionSettings.UseEstateSun, | ||
5110 | sun); | ||
5111 | } | ||
5112 | else | ||
5113 | { | ||
5114 | // Use the Sun Position from the Region Settings | ||
5115 | sun = (float)RegionInfo.RegionSettings.SunPosition - 6.0f; | ||
5116 | |||
5117 | EventManager.TriggerEstateToolsSunUpdate( | ||
5118 | RegionInfo.RegionHandle, | ||
5119 | RegionInfo.RegionSettings.FixedSun, | ||
5120 | RegionInfo.RegionSettings.UseEstateSun, | ||
5121 | sun); | ||
5122 | } | ||
5123 | } | ||
5078 | } | 5124 | } |
5079 | } | 5125 | } |