diff options
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2899774..df49fd7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1186,12 +1186,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1186 | CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); | 1186 | CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); |
1187 | 1187 | ||
1188 | m_host.AddScriptLPS(1); | 1188 | m_host.AddScriptLPS(1); |
1189 | //Check to make sure that the script's owner is the estate manager/master | 1189 | |
1190 | //World.Permissions.GenericEstatePermission( | 1190 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); |
1191 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1192 | { | ||
1193 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); | ||
1194 | } | ||
1195 | } | 1191 | } |
1196 | 1192 | ||
1197 | /// <summary> | 1193 | /// <summary> |
@@ -1202,27 +1198,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1202 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1198 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1203 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) | 1199 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) |
1204 | { | 1200 | { |
1205 | CheckThreatLevel(ThreatLevel.Nuisance, "osSetRegionSunSettings"); | 1201 | CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings"); |
1206 | 1202 | ||
1207 | m_host.AddScriptLPS(1); | 1203 | m_host.AddScriptLPS(1); |
1208 | //Check to make sure that the script's owner is the estate manager/master | ||
1209 | //World.Permissions.GenericEstatePermission( | ||
1210 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1211 | { | ||
1212 | while (sunHour > 24.0) | ||
1213 | sunHour -= 24.0; | ||
1214 | 1204 | ||
1215 | while (sunHour < 0) | 1205 | while (sunHour > 24.0) |
1216 | sunHour += 24.0; | 1206 | sunHour -= 24.0; |
1217 | 1207 | ||
1208 | while (sunHour < 0) | ||
1209 | sunHour += 24.0; | ||
1218 | 1210 | ||
1219 | World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; | 1211 | World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun; |
1220 | World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 | 1212 | World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30 |
1221 | World.RegionInfo.RegionSettings.FixedSun = sunFixed; | 1213 | World.RegionInfo.RegionSettings.FixedSun = sunFixed; |
1222 | World.RegionInfo.RegionSettings.Save(); | 1214 | World.RegionInfo.RegionSettings.Save(); |
1223 | 1215 | ||
1224 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); | 1216 | World.EventManager.TriggerEstateToolsSunUpdate( |
1225 | } | 1217 | World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour); |
1226 | } | 1218 | } |
1227 | 1219 | ||
1228 | /// <summary> | 1220 | /// <summary> |
@@ -1232,26 +1224,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1232 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1224 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1233 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) | 1225 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) |
1234 | { | 1226 | { |
1235 | CheckThreatLevel(ThreatLevel.Nuisance, "osSetEstateSunSettings"); | 1227 | CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); |
1236 | 1228 | ||
1237 | m_host.AddScriptLPS(1); | 1229 | m_host.AddScriptLPS(1); |
1238 | //Check to make sure that the script's owner is the estate manager/master | ||
1239 | //World.Permissions.GenericEstatePermission( | ||
1240 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
1241 | { | ||
1242 | while (sunHour > 24.0) | ||
1243 | sunHour -= 24.0; | ||
1244 | 1230 | ||
1245 | while (sunHour < 0) | 1231 | while (sunHour > 24.0) |
1246 | sunHour += 24.0; | 1232 | sunHour -= 24.0; |
1247 | 1233 | ||
1248 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; | 1234 | while (sunHour < 0) |
1249 | World.RegionInfo.EstateSettings.SunPosition = sunHour; | 1235 | sunHour += 24.0; |
1250 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; | ||
1251 | World.RegionInfo.EstateSettings.Save(); | ||
1252 | 1236 | ||
1253 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); | 1237 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; |
1254 | } | 1238 | World.RegionInfo.EstateSettings.SunPosition = sunHour; |
1239 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; | ||
1240 | World.RegionInfo.EstateSettings.Save(); | ||
1241 | |||
1242 | World.EventManager.TriggerEstateToolsSunUpdate( | ||
1243 | World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour); | ||
1255 | } | 1244 | } |
1256 | 1245 | ||
1257 | /// <summary> | 1246 | /// <summary> |
@@ -2555,7 +2544,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2555 | 2544 | ||
2556 | public void osNpcStopMoveToTarget(LSL_Key npc) | 2545 | public void osNpcStopMoveToTarget(LSL_Key npc) |
2557 | { | 2546 | { |
2558 | CheckThreatLevel(ThreatLevel.VeryLow, "osNpcStopMoveTo"); | 2547 | CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); |
2559 | m_host.AddScriptLPS(1); | 2548 | m_host.AddScriptLPS(1); |
2560 | 2549 | ||
2561 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2550 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |