Thank you, mcortez, for a patch that fixes a number of long standing

issues with the sun module.
Fixes Mantis #3295
This commit is contained in:
Melanie Thielker
2009-03-13 23:45:02 +00:00
parent c04e7cdf2b
commit ddbf81fa07
9 changed files with 376 additions and 238 deletions

View File

@@ -754,6 +754,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
/// <summary>
/// Changes the Region Sun Settings, then Triggers a Sun Update
/// </summary>
/// <param name="useEstateSun">True to use Estate Sun instead of Region Sun</param>
/// <param name="sunFixed">True to keep the sun stationary</param>
/// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param>
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

View File

@@ -95,7 +95,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetStateEvents(int events);
double osList2Double(LSL_Types.list src, int index);
void osSetRegionWaterHeight(double height);
void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
string osGetScriptEngineName();
string osGetSimulatorVersion();

View File

@@ -62,6 +62,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osSetRegionWaterHeight(height);
}
public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour)
{
m_OSSL_Functions.osSetRegionSunSettings(useEstateSun, sunFixed, sunHour);
}
public double osList2Double(LSL_Types.list src, int index)
{
return m_OSSL_Functions.osList2Double(src, index);