diff options
author | Justin Clark-Casey (justincc) | 2012-04-13 22:32:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-13 22:32:33 +0100 |
commit | ab7c0e75472b354e34325fdf6280b77edb0567fe (patch) | |
tree | 929494086201cd4514b0ae763fc0c282b65fb6f6 | |
parent | Add uri to various log messages when region registration fails. Upgrade some... (diff) | |
download | opensim-SC-ab7c0e75472b354e34325fdf6280b77edb0567fe.zip opensim-SC-ab7c0e75472b354e34325fdf6280b77edb0567fe.tar.gz opensim-SC-ab7c0e75472b354e34325fdf6280b77edb0567fe.tar.bz2 opensim-SC-ab7c0e75472b354e34325fdf6280b77edb0567fe.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 61 |
1 files changed, 25 insertions, 36 deletions
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 | |||
1179 | CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); | 1179 | CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); |
1180 | 1180 | ||
1181 | m_host.AddScriptLPS(1); | 1181 | m_host.AddScriptLPS(1); |
1182 | //Check to make sure that the script's owner is the estate manager/master | 1182 | |
1183 | //World.Permissions.GenericEstatePermission( | 1183 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); |
1184 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1185 | { | ||
1186 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); | ||
1187 | } | ||
1188 | } | 1184 | } |
1189 | 1185 | ||
1190 | /// <summary> | 1186 | /// <summary> |
@@ -1195,27 +1191,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1195 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1191 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1196 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) | 1192 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) |
1197 | { | 1193 | { |
1198 | CheckThreatLevel(ThreatLevel.Nuisance, "osSetRegionSunSettings"); | 1194 | CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings"); |
1199 | 1195 | ||
1200 | m_host.AddScriptLPS(1); | 1196 | m_host.AddScriptLPS(1); |
1201 | //Check to make sure that the script's owner is the estate manager/master | ||
1202 | //World.Permissions.GenericEstatePermission( | ||
1203 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1204 | { | ||
1205 | while (sunHour > 24.0) | ||
1206 | sunHour -= 24.0; | ||
1207 | 1197 | ||
1208 | while (sunHour < 0) | 1198 | while (sunHour > 24.0) |
1209 | sunHour += 24.0; | 1199 | sunHour -= 24.0; |
1210 | 1200 | ||
1201 | while (sunHour < 0) | ||
1202 | sunHour += 24.0; | ||
1211 | 1203 | ||
1212 | World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; | 1204 | World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; |
1213 | World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 | 1205 | World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 |
1214 | World.RegionInfo.RegionSettings.FixedSun = sunFixed; | 1206 | World.RegionInfo.RegionSettings.FixedSun = sunFixed; |
1215 | World.RegionInfo.RegionSettings.Save(); | 1207 | World.RegionInfo.RegionSettings.Save(); |
1216 | 1208 | ||
1217 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); | 1209 | World.EventManager.TriggerEstateToolsSunUpdate( |
1218 | } | 1210 | World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); |
1219 | } | 1211 | } |
1220 | 1212 | ||
1221 | /// <summary> | 1213 | /// <summary> |
@@ -1225,26 +1217,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1225 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1217 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1226 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) | 1218 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) |
1227 | { | 1219 | { |
1228 | CheckThreatLevel(ThreatLevel.Nuisance, "osSetEstateSunSettings"); | 1220 | CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); |
1229 | 1221 | ||
1230 | m_host.AddScriptLPS(1); | 1222 | m_host.AddScriptLPS(1); |
1231 | //Check to make sure that the script's owner is the estate manager/master | ||
1232 | //World.Permissions.GenericEstatePermission( | ||
1233 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1234 | { | ||
1235 | while (sunHour > 24.0) | ||
1236 | sunHour -= 24.0; | ||
1237 | 1223 | ||
1238 | while (sunHour < 0) | 1224 | while (sunHour > 24.0) |
1239 | sunHour += 24.0; | 1225 | sunHour -= 24.0; |
1240 | 1226 | ||
1241 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; | 1227 | while (sunHour < 0) |
1242 | World.RegionInfo.EstateSettings.SunPosition = sunHour; | 1228 | sunHour += 24.0; |
1243 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; | ||
1244 | World.RegionInfo.EstateSettings.Save(); | ||
1245 | 1229 | ||
1246 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); | 1230 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; |
1247 | } | 1231 | World.RegionInfo.EstateSettings.SunPosition = sunHour; |
1232 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; | ||
1233 | World.RegionInfo.EstateSettings.Save(); | ||
1234 | |||
1235 | World.EventManager.TriggerEstateToolsSunUpdate( | ||
1236 | World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); | ||
1248 | } | 1237 | } |
1249 | 1238 | ||
1250 | /// <summary> | 1239 | /// <summary> |