diff options
author | David Walter Seikel | 2016-11-22 17:01:47 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-22 17:01:47 +1000 |
commit | 273e1f0917d8ff125b3bf885f6eb80d32bf7b840 (patch) | |
tree | 64b4dc930b60021b98350039c129e4d2b4797a1e /OpenSim/Region | |
parent | Actually tell us what the problem object is with sculpties in map generation. (diff) | |
download | opensim-SC_OLD-273e1f0917d8ff125b3bf885f6eb80d32bf7b840.zip opensim-SC_OLD-273e1f0917d8ff125b3bf885f6eb80d32bf7b840.tar.gz opensim-SC_OLD-273e1f0917d8ff125b3bf885f6eb80d32bf7b840.tar.bz2 opensim-SC_OLD-273e1f0917d8ff125b3bf885f6eb80d32bf7b840.tar.xz |
Don't throw exceptions on threat level checks and a few other script function errors.
Instead, just complain quickly and return without doing the function.
Diffstat (limited to 'OpenSim/Region')
3 files changed, 105 insertions, 96 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0b60aee..1399880 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -11660,7 +11660,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11660 | break; | 11660 | break; |
11661 | case ScriptBaseClass.DATA_SIM_RELEASE: | 11661 | case ScriptBaseClass.DATA_SIM_RELEASE: |
11662 | if (ossl != null) | 11662 | if (ossl != null) |
11663 | ossl.CheckThreatLevel(ThreatLevel.High, "llRequestSimulatorData"); | 11663 | { |
11664 | //// TODO - double check this. | ||
11665 | if (!ossl.CheckThreatLevel(ThreatLevel.High, "llRequestSimulatorData")) | ||
11666 | return UUID.Zero.ToString(); // Raise no event | ||
11667 | } | ||
11664 | reply = "OpenSim"; | 11668 | reply = "OpenSim"; |
11665 | break; | 11669 | break; |
11666 | default: | 11670 | default: |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3f61aff..83aa245 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
209 | 209 | ||
210 | internal void OSSLError(string msg) | 210 | internal void OSSLError(string msg) |
211 | { | 211 | { |
212 | throw new ScriptException("OSSL Runtime Error: " + msg); | 212 | OSSLShoutError("OSSL Runtime Error: " + msg); |
213 | } | 213 | } |
214 | 214 | ||
215 | /// <summary> | 215 | /// <summary> |
@@ -245,16 +245,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
245 | } | 245 | } |
246 | 246 | ||
247 | // Returns of the function is allowed. Throws a script exception if not allowed. | 247 | // Returns of the function is allowed. Throws a script exception if not allowed. |
248 | public void CheckThreatLevel(ThreatLevel level, string function) | 248 | public bool CheckThreatLevel(ThreatLevel level, string function) |
249 | { | 249 | { |
250 | if (!m_OSFunctionsEnabled) | 250 | if (!m_OSFunctionsEnabled) |
251 | OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws | 251 | { |
252 | OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); | ||
253 | return false; | ||
254 | } | ||
252 | 255 | ||
253 | string reasonWhyNot = CheckThreatLevelTest(level, function); | 256 | string reasonWhyNot = CheckThreatLevelTest(level, function); |
254 | if (!String.IsNullOrEmpty(reasonWhyNot)) | 257 | if (!String.IsNullOrEmpty(reasonWhyNot)) |
255 | { | 258 | { |
256 | OSSLError(reasonWhyNot); | 259 | OSSLError(reasonWhyNot); |
260 | return false; | ||
257 | } | 261 | } |
262 | return true; | ||
258 | } | 263 | } |
259 | 264 | ||
260 | // Check to see if function is allowed. Returns an empty string if function permitted | 265 | // Check to see if function is allowed. Returns an empty string if function permitted |
@@ -422,14 +427,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
422 | 427 | ||
423 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) | 428 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) |
424 | { | 429 | { |
425 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); | 430 | if (!CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight")) return 0; |
426 | 431 | ||
427 | return SetTerrainHeight(x, y, val); | 432 | return SetTerrainHeight(x, y, val); |
428 | } | 433 | } |
429 | 434 | ||
430 | public LSL_Integer osTerrainSetHeight(int x, int y, double val) | 435 | public LSL_Integer osTerrainSetHeight(int x, int y, double val) |
431 | { | 436 | { |
432 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); | 437 | if (!CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight")) return 0; |
433 | OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight"); | 438 | OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight"); |
434 | 439 | ||
435 | return SetTerrainHeight(x, y, val); | 440 | return SetTerrainHeight(x, y, val); |
@@ -475,7 +480,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
475 | 480 | ||
476 | public void osTerrainFlush() | 481 | public void osTerrainFlush() |
477 | { | 482 | { |
478 | CheckThreatLevel(ThreatLevel.VeryLow, "osTerrainFlush"); | 483 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osTerrainFlush")) return; |
479 | m_host.AddScriptLPS(1); | 484 | m_host.AddScriptLPS(1); |
480 | 485 | ||
481 | ITerrainModule terrainModule = World.RequestModuleInterface<ITerrainModule>(); | 486 | ITerrainModule terrainModule = World.RequestModuleInterface<ITerrainModule>(); |
@@ -490,7 +495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
490 | // The underlying functionality is fixed, since the security | 495 | // The underlying functionality is fixed, since the security |
491 | // as such is sound | 496 | // as such is sound |
492 | // | 497 | // |
493 | CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); | 498 | if (!CheckThreatLevel(ThreatLevel.High, "osRegionRestart")) return 0; |
494 | 499 | ||
495 | IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); | 500 | IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); |
496 | m_host.AddScriptLPS(1); | 501 | m_host.AddScriptLPS(1); |
@@ -529,7 +534,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
529 | // It's high griefing potential makes this classification | 534 | // It's high griefing potential makes this classification |
530 | // necessary | 535 | // necessary |
531 | // | 536 | // |
532 | CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); | 537 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice")) return; |
533 | 538 | ||
534 | m_host.AddScriptLPS(1); | 539 | m_host.AddScriptLPS(1); |
535 | 540 | ||
@@ -544,7 +549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
544 | // This function has no security. It can be used to destroy | 549 | // This function has no security. It can be used to destroy |
545 | // arbitrary builds the user would normally have no rights to | 550 | // arbitrary builds the user would normally have no rights to |
546 | // | 551 | // |
547 | CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot"); | 552 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot")) return; |
548 | 553 | ||
549 | m_host.AddScriptLPS(1); | 554 | m_host.AddScriptLPS(1); |
550 | if (World.Entities.ContainsKey(target)) | 555 | if (World.Entities.ContainsKey(target)) |
@@ -707,7 +712,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
707 | 712 | ||
708 | public bool osConsoleCommand(string command) | 713 | public bool osConsoleCommand(string command) |
709 | { | 714 | { |
710 | CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand"); | 715 | if (!CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand")) return false; |
711 | 716 | ||
712 | m_host.AddScriptLPS(1); | 717 | m_host.AddScriptLPS(1); |
713 | 718 | ||
@@ -723,7 +728,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
723 | 728 | ||
724 | public void osSetPrimFloatOnWater(int floatYN) | 729 | public void osSetPrimFloatOnWater(int floatYN) |
725 | { | 730 | { |
726 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater"); | 731 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater")) return; |
727 | 732 | ||
728 | m_host.AddScriptLPS(1); | 733 | m_host.AddScriptLPS(1); |
729 | 734 | ||
@@ -735,7 +740,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
735 | { | 740 | { |
736 | // High because there is no security check. High griefer potential | 741 | // High because there is no security check. High griefer potential |
737 | // | 742 | // |
738 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | 743 | if (!CheckThreatLevel(ThreatLevel.High, "osTeleportAgent")) return; |
739 | 744 | ||
740 | TeleportAgent(agent, regionName, position, lookat, false); | 745 | TeleportAgent(agent, regionName, position, lookat, false); |
741 | } | 746 | } |
@@ -777,7 +782,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
777 | { | 782 | { |
778 | // High because there is no security check. High griefer potential | 783 | // High because there is no security check. High griefer potential |
779 | // | 784 | // |
780 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | 785 | if (!CheckThreatLevel(ThreatLevel.High, "osTeleportAgent")) return; |
781 | 786 | ||
782 | TeleportAgent(agent, regionX, regionY, position, lookat, false); | 787 | TeleportAgent(agent, regionX, regionY, position, lookat, false); |
783 | } | 788 | } |
@@ -822,7 +827,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
822 | { | 827 | { |
823 | // High because there is no security check. High griefer potential | 828 | // High because there is no security check. High griefer potential |
824 | // | 829 | // |
825 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | 830 | if (!CheckThreatLevel(ThreatLevel.High, "osTeleportAgent")) return; |
826 | 831 | ||
827 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); | 832 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); |
828 | } | 833 | } |
@@ -851,7 +856,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
851 | /// <param name="avatar"></param> | 856 | /// <param name="avatar"></param> |
852 | public void osForceOtherSit(string avatar) | 857 | public void osForceOtherSit(string avatar) |
853 | { | 858 | { |
854 | CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); | 859 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit")) return; |
855 | 860 | ||
856 | m_host.AddScriptLPS(1); | 861 | m_host.AddScriptLPS(1); |
857 | 862 | ||
@@ -866,7 +871,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
866 | /// <param name="target"></param> | 871 | /// <param name="target"></param> |
867 | public void osForceOtherSit(string avatar, string target) | 872 | public void osForceOtherSit(string avatar, string target) |
868 | { | 873 | { |
869 | CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); | 874 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit")) return; |
870 | 875 | ||
871 | m_host.AddScriptLPS(1); | 876 | m_host.AddScriptLPS(1); |
872 | 877 | ||
@@ -905,7 +910,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
905 | // Severe is even better coz privacy is important. | 910 | // Severe is even better coz privacy is important. |
906 | public string osGetAgentIP(string agent) | 911 | public string osGetAgentIP(string agent) |
907 | { | 912 | { |
908 | CheckThreatLevel(ThreatLevel.Severe, "osGetAgentIP"); | 913 | if (!CheckThreatLevel(ThreatLevel.Severe, "osGetAgentIP")) return ""; |
909 | 914 | ||
910 | UUID avatarID = (UUID)agent; | 915 | UUID avatarID = (UUID)agent; |
911 | 916 | ||
@@ -936,7 +941,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
936 | // Adam's super super custom animation functions | 941 | // Adam's super super custom animation functions |
937 | public void osAvatarPlayAnimation(string avatar, string animation) | 942 | public void osAvatarPlayAnimation(string avatar, string animation) |
938 | { | 943 | { |
939 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation"); | 944 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarPlayAnimation")) return; |
940 | 945 | ||
941 | AvatarPlayAnimation(avatar, animation); | 946 | AvatarPlayAnimation(avatar, animation); |
942 | } | 947 | } |
@@ -974,7 +979,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
974 | 979 | ||
975 | public void osAvatarStopAnimation(string avatar, string animation) | 980 | public void osAvatarStopAnimation(string avatar, string animation) |
976 | { | 981 | { |
977 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation"); | 982 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, "osAvatarStopAnimation")) return; |
978 | 983 | ||
979 | AvatarStopAnimation(avatar, animation); | 984 | AvatarStopAnimation(avatar, animation); |
980 | } | 985 | } |
@@ -1173,7 +1178,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1173 | // It was probably added as a crutch or debugging aid, and | 1178 | // It was probably added as a crutch or debugging aid, and |
1174 | // should be removed | 1179 | // should be removed |
1175 | // | 1180 | // |
1176 | CheckThreatLevel(ThreatLevel.High, "osSetStateEvents"); | 1181 | if (!CheckThreatLevel(ThreatLevel.High, "osSetStateEvents")) return; |
1177 | m_host.AddScriptLPS(1); | 1182 | m_host.AddScriptLPS(1); |
1178 | 1183 | ||
1179 | m_host.SetScriptEvents(m_item.ItemID, events); | 1184 | m_host.SetScriptEvents(m_item.ItemID, events); |
@@ -1181,7 +1186,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1181 | 1186 | ||
1182 | public void osSetRegionWaterHeight(double height) | 1187 | public void osSetRegionWaterHeight(double height) |
1183 | { | 1188 | { |
1184 | CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); | 1189 | if (!CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight")) return; |
1185 | 1190 | ||
1186 | m_host.AddScriptLPS(1); | 1191 | m_host.AddScriptLPS(1); |
1187 | 1192 | ||
@@ -1196,7 +1201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1196 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1201 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1197 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) | 1202 | public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour) |
1198 | { | 1203 | { |
1199 | CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings"); | 1204 | if (!CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings")) return; |
1200 | 1205 | ||
1201 | m_host.AddScriptLPS(1); | 1206 | m_host.AddScriptLPS(1); |
1202 | 1207 | ||
@@ -1221,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1221 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> | 1226 | /// <param name="sunHour">The "Sun Hour" that is desired, 0...24, with 0 just after SunRise</param> |
1222 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) | 1227 | public void osSetEstateSunSettings(bool sunFixed, double sunHour) |
1223 | { | 1228 | { |
1224 | CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); | 1229 | if (!CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings")) return; |
1225 | 1230 | ||
1226 | m_host.AddScriptLPS(1); | 1231 | m_host.AddScriptLPS(1); |
1227 | 1232 | ||
@@ -1288,14 +1293,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1288 | 1293 | ||
1289 | public void osSunSetParam(string param, double value) | 1294 | public void osSunSetParam(string param, double value) |
1290 | { | 1295 | { |
1291 | //// CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); | 1296 | //// if (!CheckThreatLevel(ThreatLevel.None, "osSunSetParam")) return; |
1292 | OSSLDeprecated("osSunSetParam", "osSetSunParam"); | 1297 | OSSLDeprecated("osSunSetParam", "osSetSunParam"); |
1293 | SetSunParam(param, value); | 1298 | SetSunParam(param, value); |
1294 | } | 1299 | } |
1295 | 1300 | ||
1296 | public void osSetSunParam(string param, double value) | 1301 | public void osSetSunParam(string param, double value) |
1297 | { | 1302 | { |
1298 | //// CheckThreatLevel(ThreatLevel.None, "osSetSunParam"); | 1303 | //// if (!CheckThreatLevel(ThreatLevel.None, "osSetSunParam")) return; |
1299 | SetSunParam(param, value); | 1304 | SetSunParam(param, value); |
1300 | } | 1305 | } |
1301 | 1306 | ||
@@ -1325,7 +1330,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1325 | 1330 | ||
1326 | public void osSetWindParam(string plugin, string param, LSL_Float value) | 1331 | public void osSetWindParam(string plugin, string param, LSL_Float value) |
1327 | { | 1332 | { |
1328 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); | 1333 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam")) return; |
1329 | m_host.AddScriptLPS(1); | 1334 | m_host.AddScriptLPS(1); |
1330 | 1335 | ||
1331 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | 1336 | IWindModule module = World.RequestModuleInterface<IWindModule>(); |
@@ -1355,7 +1360,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1355 | // Routines for creating and managing parcels programmatically | 1360 | // Routines for creating and managing parcels programmatically |
1356 | public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2) | 1361 | public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2) |
1357 | { | 1362 | { |
1358 | CheckThreatLevel(ThreatLevel.High, "osParcelJoin"); | 1363 | if (!CheckThreatLevel(ThreatLevel.High, "osParcelJoin")) return; |
1359 | m_host.AddScriptLPS(1); | 1364 | m_host.AddScriptLPS(1); |
1360 | 1365 | ||
1361 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); | 1366 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); |
@@ -1368,7 +1373,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1368 | 1373 | ||
1369 | public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) | 1374 | public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) |
1370 | { | 1375 | { |
1371 | CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide"); | 1376 | if (!CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide")) return; |
1372 | m_host.AddScriptLPS(1); | 1377 | m_host.AddScriptLPS(1); |
1373 | 1378 | ||
1374 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); | 1379 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); |
@@ -1382,7 +1387,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1382 | public void osParcelSetDetails(LSL_Vector pos, LSL_List rules) | 1387 | public void osParcelSetDetails(LSL_Vector pos, LSL_List rules) |
1383 | { | 1388 | { |
1384 | const string functionName = "osParcelSetDetails"; | 1389 | const string functionName = "osParcelSetDetails"; |
1385 | CheckThreatLevel(ThreatLevel.High, functionName); | 1390 | if (!CheckThreatLevel(ThreatLevel.High, functionName)) return; |
1386 | OSSLDeprecated(functionName, "osSetParcelDetails"); | 1391 | OSSLDeprecated(functionName, "osSetParcelDetails"); |
1387 | SetParcelDetails(pos, rules, functionName); | 1392 | SetParcelDetails(pos, rules, functionName); |
1388 | } | 1393 | } |
@@ -1390,7 +1395,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1390 | public void osSetParcelDetails(LSL_Vector pos, LSL_List rules) | 1395 | public void osSetParcelDetails(LSL_Vector pos, LSL_List rules) |
1391 | { | 1396 | { |
1392 | const string functionName = "osSetParcelDetails"; | 1397 | const string functionName = "osSetParcelDetails"; |
1393 | CheckThreatLevel(ThreatLevel.High, functionName); | 1398 | if (!CheckThreatLevel(ThreatLevel.High, functionName)) return; |
1394 | SetParcelDetails(pos, rules, functionName); | 1399 | SetParcelDetails(pos, rules, functionName); |
1395 | } | 1400 | } |
1396 | 1401 | ||
@@ -1434,19 +1439,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1434 | break; | 1439 | break; |
1435 | 1440 | ||
1436 | case ScriptBaseClass.PARCEL_DETAILS_OWNER: | 1441 | case ScriptBaseClass.PARCEL_DETAILS_OWNER: |
1437 | CheckThreatLevel(ThreatLevel.VeryHigh, functionName); | 1442 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, functionName)) return; |
1438 | if (UUID.TryParse(arg, out uuid)) | 1443 | if (UUID.TryParse(arg, out uuid)) |
1439 | newLand.OwnerID = uuid; | 1444 | newLand.OwnerID = uuid; |
1440 | break; | 1445 | break; |
1441 | 1446 | ||
1442 | case ScriptBaseClass.PARCEL_DETAILS_GROUP: | 1447 | case ScriptBaseClass.PARCEL_DETAILS_GROUP: |
1443 | CheckThreatLevel(ThreatLevel.VeryHigh, functionName); | 1448 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, functionName)) return; |
1444 | if (UUID.TryParse(arg, out uuid)) | 1449 | if (UUID.TryParse(arg, out uuid)) |
1445 | newLand.GroupID = uuid; | 1450 | newLand.GroupID = uuid; |
1446 | break; | 1451 | break; |
1447 | 1452 | ||
1448 | case ScriptBaseClass.PARCEL_DETAILS_CLAIMDATE: | 1453 | case ScriptBaseClass.PARCEL_DETAILS_CLAIMDATE: |
1449 | CheckThreatLevel(ThreatLevel.VeryHigh, functionName); | 1454 | if (!CheckThreatLevel(ThreatLevel.VeryHigh, functionName)) return; |
1450 | newLand.ClaimDate = Convert.ToInt32(arg); | 1455 | newLand.ClaimDate = Convert.ToInt32(arg); |
1451 | if (newLand.ClaimDate == 0) | 1456 | if (newLand.ClaimDate == 0) |
1452 | newLand.ClaimDate = Util.UnixTimeSinceEpoch(); | 1457 | newLand.ClaimDate = Util.UnixTimeSinceEpoch(); |
@@ -1480,7 +1485,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1480 | { | 1485 | { |
1481 | // What actually is the difference to the LL function? | 1486 | // What actually is the difference to the LL function? |
1482 | // | 1487 | // |
1483 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); | 1488 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL")) return; |
1484 | 1489 | ||
1485 | m_host.AddScriptLPS(1); | 1490 | m_host.AddScriptLPS(1); |
1486 | 1491 | ||
@@ -1496,7 +1501,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1496 | { | 1501 | { |
1497 | // What actually is the difference to the LL function? | 1502 | // What actually is the difference to the LL function? |
1498 | // | 1503 | // |
1499 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress"); | 1504 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress")) return; |
1500 | 1505 | ||
1501 | m_host.AddScriptLPS(1); | 1506 | m_host.AddScriptLPS(1); |
1502 | 1507 | ||
@@ -1643,7 +1648,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1643 | } | 1648 | } |
1644 | catch(Exception e) | 1649 | catch(Exception e) |
1645 | { | 1650 | { |
1646 | OSSLError("osParseJSONNew: Problems decoding JSON string " + JSON + " : " + e.Message) ; | 1651 | OSSLError("osParseJSONNew: Problems decoding JSON string " + JSON + " : " + e.Message); |
1647 | return null; | 1652 | return null; |
1648 | } | 1653 | } |
1649 | } | 1654 | } |
@@ -1951,7 +1956,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1951 | 1956 | ||
1952 | public string osAvatarName2Key(string firstname, string lastname) | 1957 | public string osAvatarName2Key(string firstname, string lastname) |
1953 | { | 1958 | { |
1954 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1959 | if (!CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key")) return string.Empty; |
1955 | m_host.AddScriptLPS(1); | 1960 | m_host.AddScriptLPS(1); |
1956 | 1961 | ||
1957 | IUserManagement userManager = World.RequestModuleInterface<IUserManagement>(); | 1962 | IUserManagement userManager = World.RequestModuleInterface<IUserManagement>(); |
@@ -2112,7 +2117,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2112 | /// <returns></returns> | 2117 | /// <returns></returns> |
2113 | public string osGetGridNick() | 2118 | public string osGetGridNick() |
2114 | { | 2119 | { |
2115 | //// CheckThreatLevel(ThreatLevel.None, "osGetGridNick"); | 2120 | //// if (!CheckThreatLevel(ThreatLevel.None, "osGetGridNick")) return ""; |
2116 | m_host.AddScriptLPS(1); | 2121 | m_host.AddScriptLPS(1); |
2117 | 2122 | ||
2118 | string nick = String.Empty; | 2123 | string nick = String.Empty; |
@@ -2129,7 +2134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2129 | 2134 | ||
2130 | public string osGetGridName() | 2135 | public string osGetGridName() |
2131 | { | 2136 | { |
2132 | //// CheckThreatLevel(ThreatLevel.None, "osGetGridName"); | 2137 | //// if (!CheckThreatLevel(ThreatLevel.None, "osGetGridName")) return ""; |
2133 | m_host.AddScriptLPS(1); | 2138 | m_host.AddScriptLPS(1); |
2134 | 2139 | ||
2135 | string name = String.Empty; | 2140 | string name = String.Empty; |
@@ -2146,7 +2151,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2146 | 2151 | ||
2147 | public string osGetGridLoginURI() | 2152 | public string osGetGridLoginURI() |
2148 | { | 2153 | { |
2149 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI"); | 2154 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI")) return ""; |
2150 | m_host.AddScriptLPS(1); | 2155 | m_host.AddScriptLPS(1); |
2151 | 2156 | ||
2152 | string loginURI = String.Empty; | 2157 | string loginURI = String.Empty; |
@@ -2163,7 +2168,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2163 | 2168 | ||
2164 | public string osGetGridHomeURI() | 2169 | public string osGetGridHomeURI() |
2165 | { | 2170 | { |
2166 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); | 2171 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI")) return ""; |
2167 | m_host.AddScriptLPS(1); | 2172 | m_host.AddScriptLPS(1); |
2168 | 2173 | ||
2169 | IConfigSource config = m_ScriptEngine.ConfigSource; | 2174 | IConfigSource config = m_ScriptEngine.ConfigSource; |
@@ -2185,7 +2190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2185 | 2190 | ||
2186 | public string osGetGridGatekeeperURI() | 2191 | public string osGetGridGatekeeperURI() |
2187 | { | 2192 | { |
2188 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI"); | 2193 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI")) return ""; |
2189 | m_host.AddScriptLPS(1); | 2194 | m_host.AddScriptLPS(1); |
2190 | 2195 | ||
2191 | IConfigSource config = m_ScriptEngine.ConfigSource; | 2196 | IConfigSource config = m_ScriptEngine.ConfigSource; |
@@ -2204,7 +2209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2204 | 2209 | ||
2205 | public string osGetGridCustom(string key) | 2210 | public string osGetGridCustom(string key) |
2206 | { | 2211 | { |
2207 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); | 2212 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom")) return String.Empty; |
2208 | m_host.AddScriptLPS(1); | 2213 | m_host.AddScriptLPS(1); |
2209 | 2214 | ||
2210 | string retval = String.Empty; | 2215 | string retval = String.Empty; |
@@ -2221,7 +2226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2221 | 2226 | ||
2222 | public string osGetAvatarHomeURI(string uuid) | 2227 | public string osGetAvatarHomeURI(string uuid) |
2223 | { | 2228 | { |
2224 | CheckThreatLevel(ThreatLevel.Moderate, "osGetAvatarHomeURI"); | 2229 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetAvatarHomeURI")) return ""; |
2225 | m_host.AddScriptLPS(1); | 2230 | m_host.AddScriptLPS(1); |
2226 | 2231 | ||
2227 | IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>(); | 2232 | IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>(); |
@@ -2326,7 +2331,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2326 | 2331 | ||
2327 | public string osLoadedCreationDate() | 2332 | public string osLoadedCreationDate() |
2328 | { | 2333 | { |
2329 | CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); | 2334 | if (!CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate")) return ""; |
2330 | m_host.AddScriptLPS(1); | 2335 | m_host.AddScriptLPS(1); |
2331 | 2336 | ||
2332 | return World.RegionInfo.RegionSettings.LoadedCreationDate; | 2337 | return World.RegionInfo.RegionSettings.LoadedCreationDate; |
@@ -2334,7 +2339,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2334 | 2339 | ||
2335 | public string osLoadedCreationTime() | 2340 | public string osLoadedCreationTime() |
2336 | { | 2341 | { |
2337 | CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime"); | 2342 | if (!CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime")) return ""; |
2338 | m_host.AddScriptLPS(1); | 2343 | m_host.AddScriptLPS(1); |
2339 | 2344 | ||
2340 | return World.RegionInfo.RegionSettings.LoadedCreationTime; | 2345 | return World.RegionInfo.RegionSettings.LoadedCreationTime; |
@@ -2342,7 +2347,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2342 | 2347 | ||
2343 | public string osLoadedCreationID() | 2348 | public string osLoadedCreationID() |
2344 | { | 2349 | { |
2345 | CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID"); | 2350 | if (!CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID")) return ""; |
2346 | m_host.AddScriptLPS(1); | 2351 | m_host.AddScriptLPS(1); |
2347 | 2352 | ||
2348 | return World.RegionInfo.RegionSettings.LoadedCreationID; | 2353 | return World.RegionInfo.RegionSettings.LoadedCreationID; |
@@ -2363,7 +2368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2363 | /// <returns></returns> | 2368 | /// <returns></returns> |
2364 | public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules) | 2369 | public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules) |
2365 | { | 2370 | { |
2366 | CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams"); | 2371 | if (!CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams")) return new LSL_List(); |
2367 | m_host.AddScriptLPS(1); | 2372 | m_host.AddScriptLPS(1); |
2368 | InitLSL(); | 2373 | InitLSL(); |
2369 | // One needs to cast m_LSL_Api because we're using functions not | 2374 | // One needs to cast m_LSL_Api because we're using functions not |
@@ -2391,7 +2396,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2391 | 2396 | ||
2392 | public void osForceCreateLink(string target, int parent) | 2397 | public void osForceCreateLink(string target, int parent) |
2393 | { | 2398 | { |
2394 | CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink"); | 2399 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink")) return; |
2395 | 2400 | ||
2396 | m_host.AddScriptLPS(1); | 2401 | m_host.AddScriptLPS(1); |
2397 | 2402 | ||
@@ -2401,7 +2406,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2401 | 2406 | ||
2402 | public void osForceBreakLink(int linknum) | 2407 | public void osForceBreakLink(int linknum) |
2403 | { | 2408 | { |
2404 | CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink"); | 2409 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink")) return; |
2405 | 2410 | ||
2406 | m_host.AddScriptLPS(1); | 2411 | m_host.AddScriptLPS(1); |
2407 | 2412 | ||
@@ -2411,7 +2416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2411 | 2416 | ||
2412 | public void osForceBreakAllLinks() | 2417 | public void osForceBreakAllLinks() |
2413 | { | 2418 | { |
2414 | CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks"); | 2419 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks")) return; |
2415 | 2420 | ||
2416 | m_host.AddScriptLPS(1); | 2421 | m_host.AddScriptLPS(1); |
2417 | 2422 | ||
@@ -2437,7 +2442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2437 | 2442 | ||
2438 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) | 2443 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) |
2439 | { | 2444 | { |
2440 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2445 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcCreate")) return new LSL_Key(ScriptBaseClass.NULL_KEY); |
2441 | m_host.AddScriptLPS(1); | 2446 | m_host.AddScriptLPS(1); |
2442 | 2447 | ||
2443 | return NpcCreate(firstname, lastname, position, notecard, false, false); | 2448 | return NpcCreate(firstname, lastname, position, notecard, false, false); |
@@ -2445,7 +2450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2445 | 2450 | ||
2446 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) | 2451 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) |
2447 | { | 2452 | { |
2448 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2453 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcCreate")) return new LSL_Key(ScriptBaseClass.NULL_KEY); |
2449 | m_host.AddScriptLPS(1); | 2454 | m_host.AddScriptLPS(1); |
2450 | 2455 | ||
2451 | return NpcCreate( | 2456 | return NpcCreate( |
@@ -2511,7 +2516,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2511 | /// <returns>The asset ID of the notecard saved.</returns> | 2516 | /// <returns>The asset ID of the notecard saved.</returns> |
2512 | public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) | 2517 | public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) |
2513 | { | 2518 | { |
2514 | CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); | 2519 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance")) return new LSL_Key(ScriptBaseClass.NULL_KEY); |
2515 | m_host.AddScriptLPS(1); | 2520 | m_host.AddScriptLPS(1); |
2516 | 2521 | ||
2517 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2522 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2533,7 +2538,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2533 | 2538 | ||
2534 | public void osNpcLoadAppearance(LSL_Key npc, string notecard) | 2539 | public void osNpcLoadAppearance(LSL_Key npc, string notecard) |
2535 | { | 2540 | { |
2536 | CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); | 2541 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance")) return; |
2537 | m_host.AddScriptLPS(1); | 2542 | m_host.AddScriptLPS(1); |
2538 | 2543 | ||
2539 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2544 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2609,7 +2614,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2609 | 2614 | ||
2610 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) | 2615 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) |
2611 | { | 2616 | { |
2612 | CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); | 2617 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo")) return; |
2613 | m_host.AddScriptLPS(1); | 2618 | m_host.AddScriptLPS(1); |
2614 | 2619 | ||
2615 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2620 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2628,7 +2633,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2628 | 2633 | ||
2629 | public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options) | 2634 | public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options) |
2630 | { | 2635 | { |
2631 | CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); | 2636 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget")) return; |
2632 | m_host.AddScriptLPS(1); | 2637 | m_host.AddScriptLPS(1); |
2633 | 2638 | ||
2634 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2639 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2676,7 +2681,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2676 | 2681 | ||
2677 | public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) | 2682 | public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) |
2678 | { | 2683 | { |
2679 | CheckThreatLevel(ThreatLevel.High, "osNpcSetRot"); | 2684 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcSetRot")) return; |
2680 | m_host.AddScriptLPS(1); | 2685 | m_host.AddScriptLPS(1); |
2681 | 2686 | ||
2682 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2687 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2698,7 +2703,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2698 | 2703 | ||
2699 | public void osNpcStopMoveToTarget(LSL_Key npc) | 2704 | public void osNpcStopMoveToTarget(LSL_Key npc) |
2700 | { | 2705 | { |
2701 | CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); | 2706 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget")) return; |
2702 | m_host.AddScriptLPS(1); | 2707 | m_host.AddScriptLPS(1); |
2703 | 2708 | ||
2704 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2709 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2720,7 +2725,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2720 | 2725 | ||
2721 | public void osNpcSay(LSL_Key npc, int channel, string message) | 2726 | public void osNpcSay(LSL_Key npc, int channel, string message) |
2722 | { | 2727 | { |
2723 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); | 2728 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcSay")) return; |
2724 | m_host.AddScriptLPS(1); | 2729 | m_host.AddScriptLPS(1); |
2725 | 2730 | ||
2726 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2731 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2737,7 +2742,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2737 | 2742 | ||
2738 | public void osNpcShout(LSL_Key npc, int channel, string message) | 2743 | public void osNpcShout(LSL_Key npc, int channel, string message) |
2739 | { | 2744 | { |
2740 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | 2745 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcShout")) return; |
2741 | m_host.AddScriptLPS(1); | 2746 | m_host.AddScriptLPS(1); |
2742 | 2747 | ||
2743 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2748 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2754,7 +2759,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2754 | 2759 | ||
2755 | public void osNpcSit(LSL_Key npc, LSL_Key target, int options) | 2760 | public void osNpcSit(LSL_Key npc, LSL_Key target, int options) |
2756 | { | 2761 | { |
2757 | CheckThreatLevel(ThreatLevel.High, "osNpcSit"); | 2762 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcSit")) return; |
2758 | m_host.AddScriptLPS(1); | 2763 | m_host.AddScriptLPS(1); |
2759 | 2764 | ||
2760 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2765 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2771,7 +2776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2771 | 2776 | ||
2772 | public void osNpcStand(LSL_Key npc) | 2777 | public void osNpcStand(LSL_Key npc) |
2773 | { | 2778 | { |
2774 | CheckThreatLevel(ThreatLevel.High, "osNpcStand"); | 2779 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcStand")) return; |
2775 | m_host.AddScriptLPS(1); | 2780 | m_host.AddScriptLPS(1); |
2776 | 2781 | ||
2777 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2782 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2788,7 +2793,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2788 | 2793 | ||
2789 | public void osNpcRemove(LSL_Key npc) | 2794 | public void osNpcRemove(LSL_Key npc) |
2790 | { | 2795 | { |
2791 | CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); | 2796 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcRemove")) return; |
2792 | m_host.AddScriptLPS(1); | 2797 | m_host.AddScriptLPS(1); |
2793 | 2798 | ||
2794 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2799 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2805,7 +2810,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2805 | 2810 | ||
2806 | public void osNpcPlayAnimation(LSL_Key npc, string animation) | 2811 | public void osNpcPlayAnimation(LSL_Key npc, string animation) |
2807 | { | 2812 | { |
2808 | CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation"); | 2813 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation")) return; |
2809 | m_host.AddScriptLPS(1); | 2814 | m_host.AddScriptLPS(1); |
2810 | 2815 | ||
2811 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2816 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2820,7 +2825,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2820 | 2825 | ||
2821 | public void osNpcStopAnimation(LSL_Key npc, string animation) | 2826 | public void osNpcStopAnimation(LSL_Key npc, string animation) |
2822 | { | 2827 | { |
2823 | CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation"); | 2828 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation")) return; |
2824 | m_host.AddScriptLPS(1); | 2829 | m_host.AddScriptLPS(1); |
2825 | 2830 | ||
2826 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2831 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2835,7 +2840,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2835 | 2840 | ||
2836 | public void osNpcWhisper(LSL_Key npc, int channel, string message) | 2841 | public void osNpcWhisper(LSL_Key npc, int channel, string message) |
2837 | { | 2842 | { |
2838 | CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); | 2843 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcWhisper")) return; |
2839 | m_host.AddScriptLPS(1); | 2844 | m_host.AddScriptLPS(1); |
2840 | 2845 | ||
2841 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2846 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2852,7 +2857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2852 | 2857 | ||
2853 | public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num) | 2858 | public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num) |
2854 | { | 2859 | { |
2855 | CheckThreatLevel(ThreatLevel.High, "osNpcTouch"); | 2860 | if (!CheckThreatLevel(ThreatLevel.High, "osNpcTouch")) return; |
2856 | m_host.AddScriptLPS(1); | 2861 | m_host.AddScriptLPS(1); |
2857 | 2862 | ||
2858 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2863 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2897,7 +2902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2897 | /// <returns>The asset ID of the notecard saved.</returns> | 2902 | /// <returns>The asset ID of the notecard saved.</returns> |
2898 | public LSL_Key osOwnerSaveAppearance(string notecard) | 2903 | public LSL_Key osOwnerSaveAppearance(string notecard) |
2899 | { | 2904 | { |
2900 | CheckThreatLevel(ThreatLevel.Moderate, "osOwnerSaveAppearance"); | 2905 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osOwnerSaveAppearance")) return new LSL_Key(ScriptBaseClass.NULL_KEY); |
2901 | m_host.AddScriptLPS(1); | 2906 | m_host.AddScriptLPS(1); |
2902 | 2907 | ||
2903 | return SaveAppearanceToNotecard(m_host.OwnerID, notecard); | 2908 | return SaveAppearanceToNotecard(m_host.OwnerID, notecard); |
@@ -2905,7 +2910,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2905 | 2910 | ||
2906 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) | 2911 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) |
2907 | { | 2912 | { |
2908 | CheckThreatLevel(ThreatLevel.High, "osAgentSaveAppearance"); | 2913 | if (!CheckThreatLevel(ThreatLevel.High, "osAgentSaveAppearance")) return new LSL_Key(ScriptBaseClass.NULL_KEY); |
2909 | m_host.AddScriptLPS(1); | 2914 | m_host.AddScriptLPS(1); |
2910 | 2915 | ||
2911 | return SaveAppearanceToNotecard(avatarId, notecard); | 2916 | return SaveAppearanceToNotecard(avatarId, notecard); |
@@ -3077,7 +3082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3077 | 3082 | ||
3078 | public int osGetSimulatorMemory() | 3083 | public int osGetSimulatorMemory() |
3079 | { | 3084 | { |
3080 | CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); | 3085 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory")) return 0; |
3081 | m_host.AddScriptLPS(1); | 3086 | m_host.AddScriptLPS(1); |
3082 | long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; | 3087 | long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; |
3083 | 3088 | ||
@@ -3091,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3091 | 3096 | ||
3092 | public void osSetSpeed(string UUID, LSL_Float SpeedModifier) | 3097 | public void osSetSpeed(string UUID, LSL_Float SpeedModifier) |
3093 | { | 3098 | { |
3094 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | 3099 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed")) return; |
3095 | m_host.AddScriptLPS(1); | 3100 | m_host.AddScriptLPS(1); |
3096 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | 3101 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); |
3097 | 3102 | ||
@@ -3101,7 +3106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3101 | 3106 | ||
3102 | public void osKickAvatar(string FirstName, string SurName, string alert) | 3107 | public void osKickAvatar(string FirstName, string SurName, string alert) |
3103 | { | 3108 | { |
3104 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 3109 | if (!CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar")) return; |
3105 | m_host.AddScriptLPS(1); | 3110 | m_host.AddScriptLPS(1); |
3106 | 3111 | ||
3107 | World.ForEachRootScenePresence(delegate(ScenePresence sp) | 3112 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
@@ -3130,7 +3135,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3130 | 3135 | ||
3131 | public void osCauseDamage(string avatar, double damage) | 3136 | public void osCauseDamage(string avatar, double damage) |
3132 | { | 3137 | { |
3133 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | 3138 | if (!CheckThreatLevel(ThreatLevel.High, "osCauseDamage")) return; |
3134 | m_host.AddScriptLPS(1); | 3139 | m_host.AddScriptLPS(1); |
3135 | 3140 | ||
3136 | UUID avatarId = new UUID(avatar); | 3141 | UUID avatarId = new UUID(avatar); |
@@ -3158,7 +3163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3158 | 3163 | ||
3159 | public void osCauseHealing(string avatar, double healing) | 3164 | public void osCauseHealing(string avatar, double healing) |
3160 | { | 3165 | { |
3161 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | 3166 | if (!CheckThreatLevel(ThreatLevel.High, "osCauseHealing")) return; |
3162 | m_host.AddScriptLPS(1); | 3167 | m_host.AddScriptLPS(1); |
3163 | 3168 | ||
3164 | UUID avatarId = new UUID(avatar); | 3169 | UUID avatarId = new UUID(avatar); |
@@ -3178,7 +3183,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3178 | 3183 | ||
3179 | public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) | 3184 | public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) |
3180 | { | 3185 | { |
3181 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); | 3186 | if (!CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams")) return new LSL_List(); |
3182 | m_host.AddScriptLPS(1); | 3187 | m_host.AddScriptLPS(1); |
3183 | InitLSL(); | 3188 | InitLSL(); |
3184 | 3189 | ||
@@ -3187,7 +3192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3187 | 3192 | ||
3188 | public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) | 3193 | public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) |
3189 | { | 3194 | { |
3190 | CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); | 3195 | if (!CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams")) return; |
3191 | m_host.AddScriptLPS(1); | 3196 | m_host.AddScriptLPS(1); |
3192 | InitLSL(); | 3197 | InitLSL(); |
3193 | 3198 | ||
@@ -3199,7 +3204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3199 | /// </summary> | 3204 | /// </summary> |
3200 | public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) | 3205 | public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) |
3201 | { | 3206 | { |
3202 | CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); | 3207 | if (!CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams")) return; |
3203 | 3208 | ||
3204 | osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb); | 3209 | osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb); |
3205 | } | 3210 | } |
@@ -3209,7 +3214,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3209 | /// </summary> | 3214 | /// </summary> |
3210 | public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) | 3215 | public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) |
3211 | { | 3216 | { |
3212 | CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); | 3217 | if (!CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams")) return; |
3213 | m_host.AddScriptLPS(1); | 3218 | m_host.AddScriptLPS(1); |
3214 | 3219 | ||
3215 | SceneObjectPart obj = null; | 3220 | SceneObjectPart obj = null; |
@@ -3303,7 +3308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3303 | /// <returns></returns> | 3308 | /// <returns></returns> |
3304 | public LSL_Integer osInviteToGroup(LSL_Key agentId) | 3309 | public LSL_Integer osInviteToGroup(LSL_Key agentId) |
3305 | { | 3310 | { |
3306 | CheckThreatLevel(ThreatLevel.VeryLow, "osInviteToGroup"); | 3311 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osInviteToGroup")) return ScriptBaseClass.FALSE; |
3307 | m_host.AddScriptLPS(1); | 3312 | m_host.AddScriptLPS(1); |
3308 | 3313 | ||
3309 | UUID agent = new UUID(agentId); | 3314 | UUID agent = new UUID(agentId); |
@@ -3338,7 +3343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3338 | /// <returns></returns> | 3343 | /// <returns></returns> |
3339 | public LSL_Integer osEjectFromGroup(LSL_Key agentId) | 3344 | public LSL_Integer osEjectFromGroup(LSL_Key agentId) |
3340 | { | 3345 | { |
3341 | CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup"); | 3346 | if (!CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup")) return ScriptBaseClass.FALSE; |
3342 | m_host.AddScriptLPS(1); | 3347 | m_host.AddScriptLPS(1); |
3343 | 3348 | ||
3344 | UUID agent = new UUID(agentId); | 3349 | UUID agent = new UUID(agentId); |
@@ -3373,7 +3378,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3373 | /// <returns></returns> | 3378 | /// <returns></returns> |
3374 | public void osSetTerrainTexture(int level, LSL_Key texture) | 3379 | public void osSetTerrainTexture(int level, LSL_Key texture) |
3375 | { | 3380 | { |
3376 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture"); | 3381 | if (!CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture")) return; |
3377 | 3382 | ||
3378 | m_host.AddScriptLPS(1); | 3383 | m_host.AddScriptLPS(1); |
3379 | //Check to make sure that the script's owner is the estate manager/master | 3384 | //Check to make sure that the script's owner is the estate manager/master |
@@ -3403,7 +3408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3403 | /// <returns></returns> | 3408 | /// <returns></returns> |
3404 | public void osSetTerrainTextureHeight(int corner, double low, double high) | 3409 | public void osSetTerrainTextureHeight(int corner, double low, double high) |
3405 | { | 3410 | { |
3406 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight"); | 3411 | if (!CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight")) return; |
3407 | 3412 | ||
3408 | m_host.AddScriptLPS(1); | 3413 | m_host.AddScriptLPS(1); |
3409 | //Check to make sure that the script's owner is the estate manager/master | 3414 | //Check to make sure that the script's owner is the estate manager/master |
@@ -3424,7 +3429,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3424 | 3429 | ||
3425 | public void osForceAttachToAvatar(int attachmentPoint) | 3430 | public void osForceAttachToAvatar(int attachmentPoint) |
3426 | { | 3431 | { |
3427 | CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); | 3432 | if (!CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar")) return; |
3428 | 3433 | ||
3429 | m_host.AddScriptLPS(1); | 3434 | m_host.AddScriptLPS(1); |
3430 | 3435 | ||
@@ -3434,7 +3439,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3434 | 3439 | ||
3435 | public void osForceAttachToAvatarFromInventory(string itemName, int attachmentPoint) | 3440 | public void osForceAttachToAvatarFromInventory(string itemName, int attachmentPoint) |
3436 | { | 3441 | { |
3437 | CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory"); | 3442 | if (!CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory")) return; |
3438 | 3443 | ||
3439 | m_host.AddScriptLPS(1); | 3444 | m_host.AddScriptLPS(1); |
3440 | 3445 | ||
@@ -3443,7 +3448,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3443 | 3448 | ||
3444 | public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint) | 3449 | public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint) |
3445 | { | 3450 | { |
3446 | CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory"); | 3451 | if (!CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory")) return; |
3447 | 3452 | ||
3448 | m_host.AddScriptLPS(1); | 3453 | m_host.AddScriptLPS(1); |
3449 | 3454 | ||
@@ -3504,7 +3509,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3504 | 3509 | ||
3505 | public void osForceDetachFromAvatar() | 3510 | public void osForceDetachFromAvatar() |
3506 | { | 3511 | { |
3507 | CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); | 3512 | if (!CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar")) return; |
3508 | 3513 | ||
3509 | m_host.AddScriptLPS(1); | 3514 | m_host.AddScriptLPS(1); |
3510 | 3515 | ||
@@ -3514,7 +3519,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3514 | 3519 | ||
3515 | public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints) | 3520 | public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints) |
3516 | { | 3521 | { |
3517 | CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments"); | 3522 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments")) return new LSL_List(); |
3518 | 3523 | ||
3519 | m_host.AddScriptLPS(1); | 3524 | m_host.AddScriptLPS(1); |
3520 | 3525 | ||
@@ -3550,7 +3555,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3550 | 3555 | ||
3551 | public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options) | 3556 | public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options) |
3552 | { | 3557 | { |
3553 | CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments"); | 3558 | if (!CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments")) return; |
3554 | m_host.AddScriptLPS(1); | 3559 | m_host.AddScriptLPS(1); |
3555 | 3560 | ||
3556 | UUID targetUUID; | 3561 | UUID targetUUID; |
@@ -3733,7 +3738,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3733 | /// <returns></returns> | 3738 | /// <returns></returns> |
3734 | public void osSetContentType(LSL_Key id, string type) | 3739 | public void osSetContentType(LSL_Key id, string type) |
3735 | { | 3740 | { |
3736 | CheckThreatLevel(ThreatLevel.High, "osSetContentType"); | 3741 | if (!CheckThreatLevel(ThreatLevel.High, "osSetContentType")) return; |
3737 | 3742 | ||
3738 | if (m_UrlModule != null) | 3743 | if (m_UrlModule != null) |
3739 | m_UrlModule.HttpContentType(new UUID(id),type); | 3744 | m_UrlModule.HttpContentType(new UUID(id),type); |
@@ -3795,7 +3800,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3795 | 3800 | ||
3796 | public void osDropAttachment() | 3801 | public void osDropAttachment() |
3797 | { | 3802 | { |
3798 | CheckThreatLevel(ThreatLevel.Low, "osDropAttachment"); | 3803 | if (!CheckThreatLevel(ThreatLevel.Low, "osDropAttachment")) return; |
3799 | m_host.AddScriptLPS(1); | 3804 | m_host.AddScriptLPS(1); |
3800 | 3805 | ||
3801 | DropAttachment(true); | 3806 | DropAttachment(true); |
@@ -3803,7 +3808,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3803 | 3808 | ||
3804 | public void osForceDropAttachment() | 3809 | public void osForceDropAttachment() |
3805 | { | 3810 | { |
3806 | CheckThreatLevel(ThreatLevel.High, "osForceDropAttachment"); | 3811 | if (!CheckThreatLevel(ThreatLevel.High, "osForceDropAttachment")) return; |
3807 | m_host.AddScriptLPS(1); | 3812 | m_host.AddScriptLPS(1); |
3808 | 3813 | ||
3809 | DropAttachment(false); | 3814 | DropAttachment(false); |
@@ -3811,7 +3816,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3811 | 3816 | ||
3812 | public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) | 3817 | public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) |
3813 | { | 3818 | { |
3814 | CheckThreatLevel(ThreatLevel.Low, "osDropAttachmentAt"); | 3819 | if (!CheckThreatLevel(ThreatLevel.Low, "osDropAttachmentAt")) return; |
3815 | m_host.AddScriptLPS(1); | 3820 | m_host.AddScriptLPS(1); |
3816 | 3821 | ||
3817 | DropAttachmentAt(true, pos, rot); | 3822 | DropAttachmentAt(true, pos, rot); |
@@ -3819,7 +3824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3819 | 3824 | ||
3820 | public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) | 3825 | public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) |
3821 | { | 3826 | { |
3822 | CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt"); | 3827 | if (!CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt")) return; |
3823 | m_host.AddScriptLPS(1); | 3828 | m_host.AddScriptLPS(1); |
3824 | 3829 | ||
3825 | DropAttachmentAt(false, pos, rot); | 3830 | DropAttachmentAt(false, pos, rot); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6259b76..82fdc53 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
114 | 114 | ||
115 | public interface IOSSL_Api | 115 | public interface IOSSL_Api |
116 | { | 116 | { |
117 | void CheckThreatLevel(ThreatLevel level, string function); | 117 | bool CheckThreatLevel(ThreatLevel level, string function); |
118 | 118 | ||
119 | //OpenSim functions | 119 | //OpenSim functions |
120 | string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); | 120 | string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); |