mirror of
https://github.com/opensim/opensim.git
synced 2026-05-27 04:16:00 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user