From ab7c0e75472b354e34325fdf6280b77edb0567fe Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Apr 2012 22:32:33 +0100 Subject: Remove hardcoded god requirement from osSetRegionWaterHeight, osSetRegionSunSettings and, osSetEstateSunSettings no matter the threat level. Change threat level on osSetRegionSunSettings and osSetEstateSunSettings from nuisance to high to match similar functions. If you had enabled these functions but had relied on the hardcoded god check in the code, then please adjust your OSSL permissions config. Thanks to Oren Hurvitz for pointing this out. --- .../Shared/Api/Implementation/OSSL_Api.cs | 61 +++++++++------------- 1 file changed, 25 insertions(+), 36 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a5dcba4..2c0de93 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1179,12 +1179,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); 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.EventManager.TriggerRequestChangeWaterHeight((float)height); - } + + World.EventManager.TriggerRequestChangeWaterHeight((float)height); } /// @@ -1195,27 +1191,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// 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"); + CheckThreatLevel(ThreatLevel.High, "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)) - { - while (sunHour > 24.0) - sunHour -= 24.0; - while (sunHour < 0) - sunHour += 24.0; + while (sunHour > 24.0) + sunHour -= 24.0; + while (sunHour < 0) + sunHour += 24.0; - 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.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); - } + World.EventManager.TriggerEstateToolsSunUpdate( + World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); } /// @@ -1225,26 +1217,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// The "Sun Hour" that is desired, 0...24, with 0 just after SunRise public void osSetEstateSunSettings(bool sunFixed, double sunHour) { - CheckThreatLevel(ThreatLevel.Nuisance, "osSetEstateSunSettings"); + CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); 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)) - { - while (sunHour > 24.0) - sunHour -= 24.0; - while (sunHour < 0) - sunHour += 24.0; + while (sunHour > 24.0) + sunHour -= 24.0; - World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; - World.RegionInfo.EstateSettings.SunPosition = sunHour; - World.RegionInfo.EstateSettings.FixedSun = sunFixed; - World.RegionInfo.EstateSettings.Save(); + while (sunHour < 0) + sunHour += 24.0; - World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); - } + World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; + World.RegionInfo.EstateSettings.SunPosition = sunHour; + World.RegionInfo.EstateSettings.FixedSun = sunFixed; + World.RegionInfo.EstateSettings.Save(); + + World.EventManager.TriggerEstateToolsSunUpdate( + World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); } /// -- cgit v1.1 From eced0916894709e20c16ffc260599772913d7ff3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Apr 2012 22:52:24 +0100 Subject: Change threat level of osNpcStopMoveToTarget from Low to High to match other NPC functions, and change OSSL permissions name to osNpcStopMoveToTarget instead of osNpcStopMoveTo Thanks to Oren Hurvitz for pointing out these mistakes. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 72c1bf6..2680ad0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2514,7 +2514,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStopMoveToTarget(LSL_Key npc) { - CheckThreatLevel(ThreatLevel.VeryLow, "osNpcStopMoveTo"); + CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1