From ddbf81fa07aac8098d9fa8d979969fffd5436f75 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 13 Mar 2009 23:45:02 +0000 Subject: Thank you, mcortez, for a patch that fixes a number of long standing issues with the sun module. Fixes Mantis #3295 --- .../Shared/Api/Implementation/OSSL_Api.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs') 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 } } + /// + /// Changes the Region Sun Settings, then Triggers a Sun Update + /// + /// True to use Estate Sun instead of Region Sun + /// True to keep the sun stationary + /// The "Sun Hour" that is desired, 0...24, with 0 just after SunRise + public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) + { + CheckThreatLevel(ThreatLevel.Nuisance, "osSetRegionSunSettings"); + + m_host.AddScriptLPS(1); + //Check to make sure that the script's owner is the estate manager/master + //World.Permissions.GenericEstatePermission( + if (World.Permissions.IsGod(m_host.OwnerID)) + { + World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; + World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 + World.RegionInfo.RegionSettings.FixedSun = sunFixed; + World.RegionInfo.RegionSettings.Save(); + + World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); + } + } + + + + public double osList2Double(LSL_Types.list src, int index) { // There is really no double type in OSSL. C# and other -- cgit v1.1