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/ScriptEngine/Shared | |
parent | * Support loading empty folders in an iar (diff) | |
download | opensim-SC-ddbf81fa07aac8098d9fa8d979969fffd5436f75.zip opensim-SC-ddbf81fa07aac8098d9fa8d979969fffd5436f75.tar.gz opensim-SC-ddbf81fa07aac8098d9fa8d979969fffd5436f75.tar.bz2 opensim-SC-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/ScriptEngine/Shared')
3 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e96dd26..6b3afe0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -754,6 +754,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
754 | } | 754 | } |
755 | } | 755 | } |
756 | 756 | ||
757 | /// <summary> | ||
758 | /// Changes the Region Sun Settings, then Triggers a Sun Update | ||
759 | /// </summary> | ||
760 | /// <param name="useEstateSun">True to use Estate Sun instead of Region Sun</param> | ||
761 | /// <param name="sunFixed">True to keep the sun stationary</param> | ||
762 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | ||
763 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) | ||
764 | { | ||
765 | CheckThreatLevel(ThreatLevel.Nuisance, "osSetRegionSunSettings"); | ||
766 | |||
767 | m_host.AddScriptLPS(1); | ||
768 | //Check to make sure that the script's owner is the estate manager/master | ||
769 | //World.Permissions.GenericEstatePermission( | ||
770 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
771 | { | ||
772 | World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; | ||
773 | World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 | ||
774 | World.RegionInfo.RegionSettings.FixedSun = sunFixed; | ||
775 | World.RegionInfo.RegionSettings.Save(); | ||
776 | |||
777 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); | ||
778 | } | ||
779 | } | ||
780 | |||
781 | |||
782 | |||
783 | |||
757 | public double osList2Double(LSL_Types.list src, int index) | 784 | public double osList2Double(LSL_Types.list src, int index) |
758 | { | 785 | { |
759 | // There is really no double type in OSSL. C# and other | 786 | // There is really no double type in OSSL. C# and other |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6eccf51..3656f92 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -95,7 +95,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
95 | void osSetStateEvents(int events); | 95 | void osSetStateEvents(int events); |
96 | 96 | ||
97 | double osList2Double(LSL_Types.list src, int index); | 97 | double osList2Double(LSL_Types.list src, int index); |
98 | |||
98 | void osSetRegionWaterHeight(double height); | 99 | void osSetRegionWaterHeight(double height); |
100 | void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour); | ||
99 | 101 | ||
100 | string osGetScriptEngineName(); | 102 | string osGetScriptEngineName(); |
101 | string osGetSimulatorVersion(); | 103 | string osGetSimulatorVersion(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 318ec2f..d316ac9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -62,6 +62,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
62 | m_OSSL_Functions.osSetRegionWaterHeight(height); | 62 | m_OSSL_Functions.osSetRegionWaterHeight(height); |
63 | } | 63 | } |
64 | 64 | ||
65 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) | ||
66 | { | ||
67 | m_OSSL_Functions.osSetRegionSunSettings(useEstateSun, sunFixed, sunHour); | ||
68 | } | ||
69 | |||
65 | public double osList2Double(LSL_Types.list src, int index) | 70 | public double osList2Double(LSL_Types.list src, int index) |
66 | { | 71 | { |
67 | return m_OSSL_Functions.osList2Double(src, index); | 72 | return m_OSSL_Functions.osList2Double(src, index); |