aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs224
-rw-r--r--bin/config-include/osslEnable.ini4
2 files changed, 18 insertions, 210 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 1139579..22d247d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -264,6 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
264 // for safe funtions always active 264 // for safe funtions always active
265 public void CheckThreatLevel() 265 public void CheckThreatLevel()
266 { 266 {
267 m_host.AddScriptLPS(1);
267 if (!m_OSFunctionsEnabled) 268 if (!m_OSFunctionsEnabled)
268 OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws 269 OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws
269 } 270 }
@@ -271,6 +272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
271 // Returns if the function is allowed. Throws a script exception if not allowed. 272 // Returns if the function is allowed. Throws a script exception if not allowed.
272 public void CheckThreatLevel(ThreatLevel level, string function) 273 public void CheckThreatLevel(ThreatLevel level, string function)
273 { 274 {
275 m_host.AddScriptLPS(1);
274 if (!m_OSFunctionsEnabled) 276 if (!m_OSFunctionsEnabled)
275 OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws 277 OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws
276 278
@@ -498,8 +500,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
498 500
499 private LSL_Integer SetTerrainHeight(int x, int y, double val) 501 private LSL_Integer SetTerrainHeight(int x, int y, double val)
500 { 502 {
501 m_host.AddScriptLPS(1);
502
503 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) 503 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0)
504 OSSLError("osSetTerrainHeight: Coordinate out of bounds"); 504 OSSLError("osSetTerrainHeight: Coordinate out of bounds");
505 505
@@ -529,7 +529,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
529 529
530 private LSL_Float GetTerrainHeight(int x, int y) 530 private LSL_Float GetTerrainHeight(int x, int y)
531 { 531 {
532 m_host.AddScriptLPS(1);
533 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) 532 if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0)
534 OSSLError("osGetTerrainHeight: Coordinate out of bounds"); 533 OSSLError("osGetTerrainHeight: Coordinate out of bounds");
535 534
@@ -539,7 +538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
539 public void osTerrainFlush() 538 public void osTerrainFlush()
540 { 539 {
541 CheckThreatLevel(ThreatLevel.VeryLow, "osTerrainFlush"); 540 CheckThreatLevel(ThreatLevel.VeryLow, "osTerrainFlush");
542 m_host.AddScriptLPS(1);
543 541
544 ITerrainModule terrainModule = World.RequestModuleInterface<ITerrainModule>(); 542 ITerrainModule terrainModule = World.RequestModuleInterface<ITerrainModule>();
545 if (terrainModule != null) terrainModule.TaintTerrain(); 543 if (terrainModule != null) terrainModule.TaintTerrain();
@@ -556,7 +554,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
556 CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); 554 CheckThreatLevel(ThreatLevel.High, "osRegionRestart");
557 555
558 IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); 556 IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>();
559 m_host.AddScriptLPS(1);
560 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) 557 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null))
561 { 558 {
562 if (seconds < 15) 559 if (seconds < 15)
@@ -579,7 +576,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
579 CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); 576 CheckThreatLevel(ThreatLevel.High, "osRegionRestart");
580 577
581 IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); 578 IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>();
582 m_host.AddScriptLPS(1);
583 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) 579 if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null))
584 { 580 {
585 if (seconds < 15) 581 if (seconds < 15)
@@ -630,8 +626,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
630 // 626 //
631 CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); 627 CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice");
632 628
633 m_host.AddScriptLPS(1);
634
635 IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); 629 IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
636 630
637 if (dm != null) 631 if (dm != null)
@@ -645,7 +639,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
645 // 639 //
646 CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot"); 640 CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot");
647 641
648 m_host.AddScriptLPS(1);
649 if (World.Entities.ContainsKey(target)) 642 if (World.Entities.ContainsKey(target))
650 { 643 {
651 EntityBase entity; 644 EntityBase entity;
@@ -671,7 +664,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
671 // 664 //
672 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURL"); 665 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURL");
673 666
674 m_host.AddScriptLPS(1);
675 if (dynamicID == String.Empty) 667 if (dynamicID == String.Empty)
676 { 668 {
677 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 669 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -693,7 +685,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
693 { 685 {
694 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlend"); 686 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlend");
695 687
696 m_host.AddScriptLPS(1);
697 if (dynamicID == String.Empty) 688 if (dynamicID == String.Empty)
698 { 689 {
699 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 690 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -715,7 +706,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
715 { 706 {
716 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace"); 707 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace");
717 708
718 m_host.AddScriptLPS(1);
719 if (dynamicID == String.Empty) 709 if (dynamicID == String.Empty)
720 { 710 {
721 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 711 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -743,7 +733,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
743 { 733 {
744 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData"); 734 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData");
745 735
746 m_host.AddScriptLPS(1);
747 if (dynamicID == String.Empty) 736 if (dynamicID == String.Empty)
748 { 737 {
749 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 738 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -773,7 +762,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
773 { 762 {
774 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend"); 763 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend");
775 764
776 m_host.AddScriptLPS(1);
777 if (dynamicID == String.Empty) 765 if (dynamicID == String.Empty)
778 { 766 {
779 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 767 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -802,7 +790,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
802 { 790 {
803 CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace"); 791 CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace");
804 792
805 m_host.AddScriptLPS(1);
806 if (dynamicID == String.Empty) 793 if (dynamicID == String.Empty)
807 { 794 {
808 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 795 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -830,8 +817,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
830 { 817 {
831 CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand"); 818 CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand");
832 819
833 m_host.AddScriptLPS(1);
834
835 // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions 820 // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions
836 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 821 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
837 { 822 {
@@ -846,8 +831,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
846 { 831 {
847 CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater"); 832 CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater");
848 833
849 m_host.AddScriptLPS(1);
850
851 m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); 834 m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN);
852 } 835 }
853 836
@@ -905,7 +888,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
905 private void TeleportAgent(string agent, string regionName, 888 private void TeleportAgent(string agent, string regionName,
906 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 889 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
907 { 890 {
908 m_host.AddScriptLPS(1);
909 if(String.IsNullOrEmpty(regionName)) 891 if(String.IsNullOrEmpty(regionName))
910 regionName = World.RegionInfo.RegionName; 892 regionName = World.RegionInfo.RegionName;
911 893
@@ -956,8 +938,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
956 private void TeleportAgent(string agent, int regionGridX, int regionGridY, 938 private void TeleportAgent(string agent, int regionGridX, int regionGridY,
957 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 939 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
958 { 940 {
959 m_host.AddScriptLPS(1);
960
961 ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY); 941 ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY);
962 942
963 UUID agentId; 943 UUID agentId;
@@ -986,7 +966,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
986 966
987 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 967 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
988 { 968 {
989 m_host.AddScriptLPS(1);
990 UUID agentId; 969 UUID agentId;
991 if (UUID.TryParse(agent, out agentId)) 970 if (UUID.TryParse(agent, out agentId))
992 { 971 {
@@ -1024,6 +1003,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1024 1003
1025 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 1004 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
1026 { 1005 {
1006 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
1007
1027 osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); 1008 osTeleportAgent(m_host.OwnerID.ToString(), position, lookat);
1028 } 1009 }
1029 1010
@@ -1038,8 +1019,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1038 { 1019 {
1039 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); 1020 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit");
1040 1021
1041 m_host.AddScriptLPS(1);
1042
1043 ForceSit(avatar, m_host.UUID); 1022 ForceSit(avatar, m_host.UUID);
1044 } 1023 }
1045 1024
@@ -1053,8 +1032,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1053 { 1032 {
1054 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); 1033 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit");
1055 1034
1056 m_host.AddScriptLPS(1);
1057
1058 UUID targetID = new UUID(target); 1035 UUID targetID = new UUID(target);
1059 1036
1060 ForceSit(avatar, targetID); 1037 ForceSit(avatar, targetID);
@@ -1086,7 +1063,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1086 // threat level is None as we could get this information with an 1063 // threat level is None as we could get this information with an
1087 // in-world script as well, just not as efficient 1064 // in-world script as well, just not as efficient
1088 CheckThreatLevel(ThreatLevel.None, "osGetAgents"); 1065 CheckThreatLevel(ThreatLevel.None, "osGetAgents");
1089 m_host.AddScriptLPS(1);
1090 1066
1091 LSL_List result = new LSL_List(); 1067 LSL_List result = new LSL_List();
1092 World.ForEachRootScenePresence(delegate(ScenePresence sp) 1068 World.ForEachRootScenePresence(delegate(ScenePresence sp)
@@ -1104,7 +1080,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1104 1080
1105 UUID avatarID = (UUID)agent; 1081 UUID avatarID = (UUID)agent;
1106 1082
1107 m_host.AddScriptLPS(1);
1108 if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) 1083 if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence)
1109 { 1084 {
1110 ScenePresence target = (ScenePresence)World.Entities[avatarID]; 1085 ScenePresence target = (ScenePresence)World.Entities[avatarID];
@@ -1125,8 +1100,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1125 1100
1126 private void AvatarPlayAnimation(string avatar, string animation) 1101 private void AvatarPlayAnimation(string avatar, string animation)
1127 { 1102 {
1128 m_host.AddScriptLPS(1);
1129
1130 UUID avatarID; 1103 UUID avatarID;
1131 if(!UUID.TryParse(avatar, out avatarID)) 1104 if(!UUID.TryParse(avatar, out avatarID))
1132 return; 1105 return;
@@ -1167,8 +1140,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1167 { 1140 {
1168 UUID avatarID = (UUID)avatar; 1141 UUID avatarID = (UUID)avatar;
1169 1142
1170 m_host.AddScriptLPS(1);
1171
1172 // FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common 1143 // FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common
1173 // method (though see that doesn't do the is animation check, which is probably a bug) and have both 1144 // method (though see that doesn't do the is animation check, which is probably a bug) and have both
1174 // these functions call that common code. However, this does mean navigating the brain-dead requirement 1145 // these functions call that common code. However, this does mean navigating the brain-dead requirement
@@ -1203,7 +1174,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1203 public string osDrawResetTransform(string drawList) 1174 public string osDrawResetTransform(string drawList)
1204 { 1175 {
1205 CheckThreatLevel(); 1176 CheckThreatLevel();
1206 m_host.AddScriptLPS(1); 1177
1207 drawList += "ResetTransf;"; 1178 drawList += "ResetTransf;";
1208 return drawList; 1179 return drawList;
1209 } 1180 }
@@ -1211,7 +1182,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1211 public string osDrawRotationTransform(string drawList, LSL_Float x) 1182 public string osDrawRotationTransform(string drawList, LSL_Float x)
1212 { 1183 {
1213 CheckThreatLevel(); 1184 CheckThreatLevel();
1214 m_host.AddScriptLPS(1); 1185
1215 drawList += "RotTransf " + x + ";"; 1186 drawList += "RotTransf " + x + ";";
1216 return drawList; 1187 return drawList;
1217 } 1188 }
@@ -1220,7 +1191,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1220 { 1191 {
1221 CheckThreatLevel(); 1192 CheckThreatLevel();
1222 1193
1223 m_host.AddScriptLPS(1);
1224 drawList += "ScaleTransf " + x + "," + y + ";"; 1194 drawList += "ScaleTransf " + x + "," + y + ";";
1225 return drawList; 1195 return drawList;
1226 } 1196 }
@@ -1229,7 +1199,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1229 { 1199 {
1230 CheckThreatLevel(); 1200 CheckThreatLevel();
1231 1201
1232 m_host.AddScriptLPS(1);
1233 drawList += "TransTransf " + x + "," + y + ";"; 1202 drawList += "TransTransf " + x + "," + y + ";";
1234 return drawList; 1203 return drawList;
1235 } 1204 }
@@ -1238,7 +1207,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1238 { 1207 {
1239 CheckThreatLevel(); 1208 CheckThreatLevel();
1240 1209
1241 m_host.AddScriptLPS(1);
1242 drawList += "MoveTo " + x + "," + y + ";"; 1210 drawList += "MoveTo " + x + "," + y + ";";
1243 return drawList; 1211 return drawList;
1244 } 1212 }
@@ -1247,7 +1215,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1247 { 1215 {
1248 CheckThreatLevel(); 1216 CheckThreatLevel();
1249 1217
1250 m_host.AddScriptLPS(1);
1251 drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; 1218 drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; ";
1252 return drawList; 1219 return drawList;
1253 } 1220 }
@@ -1256,7 +1223,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1256 { 1223 {
1257 CheckThreatLevel(); 1224 CheckThreatLevel();
1258 1225
1259 m_host.AddScriptLPS(1);
1260 drawList += "LineTo " + endX + "," + endY + "; "; 1226 drawList += "LineTo " + endX + "," + endY + "; ";
1261 return drawList; 1227 return drawList;
1262 } 1228 }
@@ -1265,7 +1231,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1265 { 1231 {
1266 CheckThreatLevel(ThreatLevel.None, "osDrawText"); 1232 CheckThreatLevel(ThreatLevel.None, "osDrawText");
1267 1233
1268 m_host.AddScriptLPS(1);
1269 drawList += "Text " + text + "; "; 1234 drawList += "Text " + text + "; ";
1270 return drawList; 1235 return drawList;
1271 } 1236 }
@@ -1274,7 +1239,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1274 { 1239 {
1275 CheckThreatLevel(); 1240 CheckThreatLevel();
1276 1241
1277 m_host.AddScriptLPS(1);
1278 drawList += "Ellipse " + width + "," + height + "; "; 1242 drawList += "Ellipse " + width + "," + height + "; ";
1279 return drawList; 1243 return drawList;
1280 } 1244 }
@@ -1283,7 +1247,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1283 { 1247 {
1284 CheckThreatLevel(); 1248 CheckThreatLevel();
1285 1249
1286 m_host.AddScriptLPS(1);
1287 drawList += "FillEllipse " + width + "," + height + "; "; 1250 drawList += "FillEllipse " + width + "," + height + "; ";
1288 return drawList; 1251 return drawList;
1289 } 1252 }
@@ -1292,7 +1255,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1292 { 1255 {
1293 CheckThreatLevel(); 1256 CheckThreatLevel();
1294 1257
1295 m_host.AddScriptLPS(1);
1296 drawList += "Rectangle " + width + "," + height + "; "; 1258 drawList += "Rectangle " + width + "," + height + "; ";
1297 return drawList; 1259 return drawList;
1298 } 1260 }
@@ -1301,7 +1263,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1301 { 1263 {
1302 CheckThreatLevel(); 1264 CheckThreatLevel();
1303 1265
1304 m_host.AddScriptLPS(1);
1305 drawList += "FillRectangle " + width + "," + height + "; "; 1266 drawList += "FillRectangle " + width + "," + height + "; ";
1306 return drawList; 1267 return drawList;
1307 } 1268 }
@@ -1310,8 +1271,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1310 { 1271 {
1311 CheckThreatLevel(); 1272 CheckThreatLevel();
1312 1273
1313 m_host.AddScriptLPS(1);
1314
1315 if (x.Length != y.Length || x.Length < 3) 1274 if (x.Length != y.Length || x.Length < 3)
1316 { 1275 {
1317 return ""; 1276 return "";
@@ -1329,8 +1288,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1329 { 1288 {
1330 CheckThreatLevel(); 1289 CheckThreatLevel();
1331 1290
1332 m_host.AddScriptLPS(1);
1333
1334 if (x.Length != y.Length || x.Length < 3) 1291 if (x.Length != y.Length || x.Length < 3)
1335 { 1292 {
1336 return ""; 1293 return "";
@@ -1348,7 +1305,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1348 { 1305 {
1349 CheckThreatLevel(); 1306 CheckThreatLevel();
1350 1307
1351 m_host.AddScriptLPS(1);
1352 drawList += "FontSize "+ fontSize +"; "; 1308 drawList += "FontSize "+ fontSize +"; ";
1353 return drawList; 1309 return drawList;
1354 } 1310 }
@@ -1357,7 +1313,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1357 { 1313 {
1358 CheckThreatLevel(); 1314 CheckThreatLevel();
1359 1315
1360 m_host.AddScriptLPS(1);
1361 drawList += "FontName "+ fontName +"; "; 1316 drawList += "FontName "+ fontName +"; ";
1362 return drawList; 1317 return drawList;
1363 } 1318 }
@@ -1366,7 +1321,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1366 { 1321 {
1367 CheckThreatLevel(); 1322 CheckThreatLevel();
1368 1323
1369 m_host.AddScriptLPS(1);
1370 drawList += "PenSize " + penSize + "; "; 1324 drawList += "PenSize " + penSize + "; ";
1371 return drawList; 1325 return drawList;
1372 } 1326 }
@@ -1375,7 +1329,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1375 { 1329 {
1376 CheckThreatLevel(); 1330 CheckThreatLevel();
1377 1331
1378 m_host.AddScriptLPS(1);
1379 drawList += "PenColor " + color + "; "; 1332 drawList += "PenColor " + color + "; ";
1380 return drawList; 1333 return drawList;
1381 } 1334 }
@@ -1386,7 +1339,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1386 CheckThreatLevel(); 1339 CheckThreatLevel();
1387 OSSLDeprecated("osSetPenColour", "osSetPenColor"); 1340 OSSLDeprecated("osSetPenColour", "osSetPenColor");
1388 1341
1389 m_host.AddScriptLPS(1);
1390 drawList += "PenColour " + colour + "; "; 1342 drawList += "PenColour " + colour + "; ";
1391 return drawList; 1343 return drawList;
1392 } 1344 }
@@ -1395,7 +1347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1395 { 1347 {
1396 CheckThreatLevel(); 1348 CheckThreatLevel();
1397 1349
1398 m_host.AddScriptLPS(1);
1399 drawList += "PenCap " + direction + "," + type + "; "; 1350 drawList += "PenCap " + direction + "," + type + "; ";
1400 return drawList; 1351 return drawList;
1401 } 1352 }
@@ -1404,7 +1355,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1404 { 1355 {
1405 CheckThreatLevel(); 1356 CheckThreatLevel();
1406 1357
1407 m_host.AddScriptLPS(1);
1408 drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; 1358 drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ;
1409 return drawList; 1359 return drawList;
1410 } 1360 }
@@ -1412,7 +1362,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1412 public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) 1362 public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize)
1413 { 1363 {
1414 CheckThreatLevel(); 1364 CheckThreatLevel();
1415 m_host.AddScriptLPS(1);
1416 1365
1417 LSL_Vector vec = new LSL_Vector(0,0,0); 1366 LSL_Vector vec = new LSL_Vector(0,0,0);
1418 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 1367 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
@@ -1435,7 +1384,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1435 // should be removed 1384 // should be removed
1436 // 1385 //
1437 CheckThreatLevel(ThreatLevel.High, "osSetStateEvents"); 1386 CheckThreatLevel(ThreatLevel.High, "osSetStateEvents");
1438 m_host.AddScriptLPS(1);
1439 1387
1440 m_host.SetScriptEvents(m_item.ItemID, events); 1388 m_host.SetScriptEvents(m_item.ItemID, events);
1441 } 1389 }
@@ -1444,8 +1392,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1444 { 1392 {
1445 CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); 1393 CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight");
1446 1394
1447 m_host.AddScriptLPS(1);
1448
1449 World.EventManager.TriggerRequestChangeWaterHeight((float)height); 1395 World.EventManager.TriggerRequestChangeWaterHeight((float)height);
1450 } 1396 }
1451 1397
@@ -1459,8 +1405,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1459 { 1405 {
1460 CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings"); 1406 CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings");
1461 1407
1462 m_host.AddScriptLPS(1);
1463
1464 while (sunHour > 24.0) 1408 while (sunHour > 24.0)
1465 sunHour -= 24.0; 1409 sunHour -= 24.0;
1466 1410
@@ -1484,8 +1428,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1484 { 1428 {
1485 CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); 1429 CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings");
1486 1430
1487 m_host.AddScriptLPS(1);
1488
1489 while (sunHour > 24.0) 1431 while (sunHour > 24.0)
1490 sunHour -= 24.0; 1432 sunHour -= 24.0;
1491 1433
@@ -1508,8 +1450,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1508 { 1450 {
1509 CheckThreatLevel(); 1451 CheckThreatLevel();
1510 1452
1511 m_host.AddScriptLPS(1);
1512
1513 // Must adjust for the fact that Region Sun Settings are still LL offset 1453 // Must adjust for the fact that Region Sun Settings are still LL offset
1514 double sunHour = World.RegionInfo.RegionSettings.SunPosition - 6; 1454 double sunHour = World.RegionInfo.RegionSettings.SunPosition - 6;
1515 1455
@@ -1538,8 +1478,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1538 1478
1539 private double GetSunParam(string param) 1479 private double GetSunParam(string param)
1540 { 1480 {
1541 m_host.AddScriptLPS(1);
1542
1543 double value = 0.0; 1481 double value = 0.0;
1544 1482
1545 ISunModule module = World.RequestModuleInterface<ISunModule>(); 1483 ISunModule module = World.RequestModuleInterface<ISunModule>();
@@ -1566,8 +1504,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1566 1504
1567 private void SetSunParam(string param, double value) 1505 private void SetSunParam(string param, double value)
1568 { 1506 {
1569 m_host.AddScriptLPS(1);
1570
1571 ISunModule module = World.RequestModuleInterface<ISunModule>(); 1507 ISunModule module = World.RequestModuleInterface<ISunModule>();
1572 if (module != null) 1508 if (module != null)
1573 { 1509 {
@@ -1578,7 +1514,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1578 public string osWindActiveModelPluginName() 1514 public string osWindActiveModelPluginName()
1579 { 1515 {
1580 CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName"); 1516 CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName");
1581 m_host.AddScriptLPS(1);
1582 1517
1583 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1518 IWindModule module = World.RequestModuleInterface<IWindModule>();
1584 if (module != null) 1519 if (module != null)
@@ -1592,7 +1527,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1592 public void osSetWindParam(string plugin, string param, LSL_Float value) 1527 public void osSetWindParam(string plugin, string param, LSL_Float value)
1593 { 1528 {
1594 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); 1529 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
1595 m_host.AddScriptLPS(1);
1596 1530
1597 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1531 IWindModule module = World.RequestModuleInterface<IWindModule>();
1598 if (module != null) 1532 if (module != null)
@@ -1608,7 +1542,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1608 public LSL_Float osGetWindParam(string plugin, string param) 1542 public LSL_Float osGetWindParam(string plugin, string param)
1609 { 1543 {
1610 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); 1544 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
1611 m_host.AddScriptLPS(1);
1612 1545
1613 IWindModule module = World.RequestModuleInterface<IWindModule>(); 1546 IWindModule module = World.RequestModuleInterface<IWindModule>();
1614 if (module != null) 1547 if (module != null)
@@ -1623,7 +1556,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1623 public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2) 1556 public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2)
1624 { 1557 {
1625 CheckThreatLevel(ThreatLevel.High, "osParcelJoin"); 1558 CheckThreatLevel(ThreatLevel.High, "osParcelJoin");
1626 m_host.AddScriptLPS(1);
1627 1559
1628 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); 1560 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x);
1629 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); 1561 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y);
@@ -1636,7 +1568,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1636 public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) 1568 public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2)
1637 { 1569 {
1638 CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide"); 1570 CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide");
1639 m_host.AddScriptLPS(1);
1640 1571
1641 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); 1572 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x);
1642 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); 1573 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y);
@@ -1663,8 +1594,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1663 1594
1664 private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName) 1595 private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
1665 { 1596 {
1666 m_host.AddScriptLPS(1);
1667
1668 // Get a reference to the land data and make sure the owner of the script 1597 // Get a reference to the land data and make sure the owner of the script
1669 // can modify it 1598 // can modify it
1670 1599
@@ -1733,7 +1662,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1733 // 1662 //
1734 CheckThreatLevel(); 1663 CheckThreatLevel();
1735 1664
1736 m_host.AddScriptLPS(1);
1737 if (index < 0) 1665 if (index < 0)
1738 { 1666 {
1739 index = src.Length + index; 1667 index = src.Length + index;
@@ -1751,8 +1679,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1751 // 1679 //
1752 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); 1680 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
1753 1681
1754 m_host.AddScriptLPS(1);
1755
1756 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 1682 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
1757 1683
1758 if (land.LandData.OwnerID != m_host.OwnerID) 1684 if (land.LandData.OwnerID != m_host.OwnerID)
@@ -1767,8 +1693,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1767 // 1693 //
1768 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress"); 1694 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
1769 1695
1770 m_host.AddScriptLPS(1);
1771
1772 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 1696 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
1773 1697
1774 if (land.LandData.OwnerID != m_host.OwnerID) 1698 if (land.LandData.OwnerID != m_host.OwnerID)
@@ -1795,8 +1719,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1795 // 1719 //
1796 CheckThreatLevel(ThreatLevel.High, "osGetScriptEngineName"); 1720 CheckThreatLevel(ThreatLevel.High, "osGetScriptEngineName");
1797 1721
1798 m_host.AddScriptLPS(1);
1799
1800 int scriptEngineNameIndex = 0; 1722 int scriptEngineNameIndex = 0;
1801 1723
1802 if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName)) 1724 if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName))
@@ -1822,7 +1744,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1822 public LSL_Integer osCheckODE() 1744 public LSL_Integer osCheckODE()
1823 { 1745 {
1824 CheckThreatLevel(); 1746 CheckThreatLevel();
1825 m_host.AddScriptLPS(1);
1826 1747
1827 LSL_Integer ret = 0; // false 1748 LSL_Integer ret = 0; // false
1828 if (m_ScriptEngine.World.PhysicsScene != null) 1749 if (m_ScriptEngine.World.PhysicsScene != null)
@@ -1846,6 +1767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1846 // about the physics engine, this function returns an empty string if 1767 // about the physics engine, this function returns an empty string if
1847 // the user does not have permission to see it. This as opposed to 1768 // the user does not have permission to see it. This as opposed to
1848 // throwing an exception. 1769 // throwing an exception.
1770
1849 m_host.AddScriptLPS(1); 1771 m_host.AddScriptLPS(1);
1850 string ret = String.Empty; 1772 string ret = String.Empty;
1851 if (String.IsNullOrEmpty(CheckThreatLevelTest(ThreatLevel.High, "osGetPhysicsEngineType"))) 1773 if (String.IsNullOrEmpty(CheckThreatLevelTest(ThreatLevel.High, "osGetPhysicsEngineType")))
@@ -1865,7 +1787,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1865 public string osGetPhysicsEngineName() 1787 public string osGetPhysicsEngineName()
1866 { 1788 {
1867 CheckThreatLevel(); 1789 CheckThreatLevel();
1868 m_host.AddScriptLPS(1);
1869 1790
1870 string ret = "NoEngine"; 1791 string ret = "NoEngine";
1871 if (m_ScriptEngine.World.PhysicsScene != null) 1792 if (m_ScriptEngine.World.PhysicsScene != null)
@@ -1886,7 +1807,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1886 // kiddie) 1807 // kiddie)
1887 // 1808 //
1888 CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion"); 1809 CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion");
1889 m_host.AddScriptLPS(1);
1890 1810
1891 return m_ScriptEngine.World.GetSimulatorVersion(); 1811 return m_ScriptEngine.World.GetSimulatorVersion();
1892 } 1812 }
@@ -1932,8 +1852,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1932 { 1852 {
1933 CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); 1853 CheckThreatLevel(ThreatLevel.None, "osParseJSONNew");
1934 1854
1935 m_host.AddScriptLPS(1);
1936
1937 try 1855 try
1938 { 1856 {
1939 OSD decoded = OSDParser.DeserializeJson(JSON); 1857 OSD decoded = OSDParser.DeserializeJson(JSON);
@@ -1950,8 +1868,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1950 { 1868 {
1951 CheckThreatLevel(ThreatLevel.None, "osParseJSON"); 1869 CheckThreatLevel(ThreatLevel.None, "osParseJSON");
1952 1870
1953 m_host.AddScriptLPS(1);
1954
1955 Object decoded = osParseJSONNew(JSON); 1871 Object decoded = osParseJSONNew(JSON);
1956 1872
1957 if ( decoded is Hashtable ) { 1873 if ( decoded is Hashtable ) {
@@ -1982,7 +1898,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1982 public void osMessageObject(LSL_Key objectUUID, string message) 1898 public void osMessageObject(LSL_Key objectUUID, string message)
1983 { 1899 {
1984 CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); 1900 CheckThreatLevel(ThreatLevel.Low, "osMessageObject");
1985 m_host.AddScriptLPS(1);
1986 1901
1987 UUID objUUID; 1902 UUID objUUID;
1988 if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead. 1903 if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead.
@@ -2023,7 +1938,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2023 // if this is restricted to objects rezzed by this host level can be reduced 1938 // if this is restricted to objects rezzed by this host level can be reduced
2024 1939
2025 CheckThreatLevel(ThreatLevel.Low, "osDie"); 1940 CheckThreatLevel(ThreatLevel.Low, "osDie");
2026 m_host.AddScriptLPS(1);
2027 1941
2028 UUID objUUID; 1942 UUID objUUID;
2029 if (!UUID.TryParse(objectUUID, out objUUID)) 1943 if (!UUID.TryParse(objectUUID, out objUUID))
@@ -2073,7 +1987,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2073 public void osMakeNotecard(string notecardName, LSL_Types.list contents) 1987 public void osMakeNotecard(string notecardName, LSL_Types.list contents)
2074 { 1988 {
2075 CheckThreatLevel(ThreatLevel.High, "osMakeNotecard"); 1989 CheckThreatLevel(ThreatLevel.High, "osMakeNotecard");
2076 m_host.AddScriptLPS(1);
2077 1990
2078 StringBuilder notecardData = new StringBuilder(); 1991 StringBuilder notecardData = new StringBuilder();
2079 1992
@@ -2259,7 +2172,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2259 public string osGetNotecardLine(string name, int line) 2172 public string osGetNotecardLine(string name, int line)
2260 { 2173 {
2261 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine"); 2174 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine");
2262 m_host.AddScriptLPS(1);
2263 2175
2264 UUID assetID = CacheNotecard(name); 2176 UUID assetID = CacheNotecard(name);
2265 2177
@@ -2287,7 +2199,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2287 public string osGetNotecard(string name) 2199 public string osGetNotecard(string name)
2288 { 2200 {
2289 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard"); 2201 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard");
2290 m_host.AddScriptLPS(1);
2291 2202
2292 string text = LoadNotecard(name); 2203 string text = LoadNotecard(name);
2293 2204
@@ -2317,7 +2228,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2317 public int osGetNumberOfNotecardLines(string name) 2228 public int osGetNumberOfNotecardLines(string name)
2318 { 2229 {
2319 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines"); 2230 CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines");
2320 m_host.AddScriptLPS(1);
2321 2231
2322 UUID assetID = CacheNotecard(name); 2232 UUID assetID = CacheNotecard(name);
2323 2233
@@ -2333,7 +2243,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2333 public string osAvatarName2Key(string firstname, string lastname) 2243 public string osAvatarName2Key(string firstname, string lastname)
2334 { 2244 {
2335 CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); 2245 CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key");
2336 m_host.AddScriptLPS(1);
2337 2246
2338 IUserManagement userManager = World.RequestModuleInterface<IUserManagement>(); 2247 IUserManagement userManager = World.RequestModuleInterface<IUserManagement>();
2339 if (userManager == null) 2248 if (userManager == null)
@@ -2385,7 +2294,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2385 public string osKey2Name(string id) 2294 public string osKey2Name(string id)
2386 { 2295 {
2387 CheckThreatLevel(ThreatLevel.Low, "osKey2Name"); 2296 CheckThreatLevel(ThreatLevel.Low, "osKey2Name");
2388 m_host.AddScriptLPS(1);
2389 2297
2390 UUID key = new UUID(); 2298 UUID key = new UUID();
2391 2299
@@ -2495,7 +2403,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2495 public string osGetGridNick() 2403 public string osGetGridNick()
2496 { 2404 {
2497 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick"); 2405 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick");
2498 m_host.AddScriptLPS(1);
2499 2406
2500 string nick = String.Empty; 2407 string nick = String.Empty;
2501 IConfigSource config = m_ScriptEngine.ConfigSource; 2408 IConfigSource config = m_ScriptEngine.ConfigSource;
@@ -2512,7 +2419,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2512 public string osGetGridName() 2419 public string osGetGridName()
2513 { 2420 {
2514 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName"); 2421 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName");
2515 m_host.AddScriptLPS(1);
2516 2422
2517 string name = String.Empty; 2423 string name = String.Empty;
2518 IConfigSource config = m_ScriptEngine.ConfigSource; 2424 IConfigSource config = m_ScriptEngine.ConfigSource;
@@ -2529,7 +2435,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2529 public string osGetGridLoginURI() 2435 public string osGetGridLoginURI()
2530 { 2436 {
2531 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI"); 2437 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI");
2532 m_host.AddScriptLPS(1);
2533 2438
2534 string loginURI = String.Empty; 2439 string loginURI = String.Empty;
2535 IConfigSource config = m_ScriptEngine.ConfigSource; 2440 IConfigSource config = m_ScriptEngine.ConfigSource;
@@ -2546,7 +2451,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2546 public string osGetGridHomeURI() 2451 public string osGetGridHomeURI()
2547 { 2452 {
2548 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); 2453 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI");
2549 m_host.AddScriptLPS(1);
2550 2454
2551 IConfigSource config = m_ScriptEngine.ConfigSource; 2455 IConfigSource config = m_ScriptEngine.ConfigSource;
2552 string HomeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI", 2456 string HomeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
@@ -2568,7 +2472,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2568 public string osGetGridGatekeeperURI() 2472 public string osGetGridGatekeeperURI()
2569 { 2473 {
2570 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI"); 2474 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI");
2571 m_host.AddScriptLPS(1);
2572 2475
2573 IConfigSource config = m_ScriptEngine.ConfigSource; 2476 IConfigSource config = m_ScriptEngine.ConfigSource;
2574 string gatekeeperURI = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", 2477 string gatekeeperURI = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI",
@@ -2587,7 +2490,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2587 public string osGetGridCustom(string key) 2490 public string osGetGridCustom(string key)
2588 { 2491 {
2589 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); 2492 CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom");
2590 m_host.AddScriptLPS(1);
2591 2493
2592 string retval = String.Empty; 2494 string retval = String.Empty;
2593 IConfigSource config = m_ScriptEngine.ConfigSource; 2495 IConfigSource config = m_ScriptEngine.ConfigSource;
@@ -2604,7 +2506,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2604 public string osGetAvatarHomeURI(string uuid) 2506 public string osGetAvatarHomeURI(string uuid)
2605 { 2507 {
2606 CheckThreatLevel(ThreatLevel.Low, "osGetAvatarHomeURI"); 2508 CheckThreatLevel(ThreatLevel.Low, "osGetAvatarHomeURI");
2607 m_host.AddScriptLPS(1);
2608 2509
2609 IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>(); 2510 IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>();
2610 string returnValue = ""; 2511 string returnValue = "";
@@ -2637,7 +2538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2637 public LSL_String osFormatString(string str, LSL_List strings) 2538 public LSL_String osFormatString(string str, LSL_List strings)
2638 { 2539 {
2639 CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString"); 2540 CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString");
2640 m_host.AddScriptLPS(1);
2641 2541
2642 return String.Format(str, strings.Data); 2542 return String.Format(str, strings.Data);
2643 } 2543 }
@@ -2645,7 +2545,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2645 public LSL_List osMatchString(string src, string pattern, int start) 2545 public LSL_List osMatchString(string src, string pattern, int start)
2646 { 2546 {
2647 CheckThreatLevel(ThreatLevel.VeryLow, "osMatchString"); 2547 CheckThreatLevel(ThreatLevel.VeryLow, "osMatchString");
2648 m_host.AddScriptLPS(1);
2649 2548
2650 LSL_List result = new LSL_List(); 2549 LSL_List result = new LSL_List();
2651 2550
@@ -2687,7 +2586,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2687 public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) 2586 public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
2688 { 2587 {
2689 CheckThreatLevel(ThreatLevel.VeryLow, "osReplaceString"); 2588 CheckThreatLevel(ThreatLevel.VeryLow, "osReplaceString");
2690 m_host.AddScriptLPS(1);
2691 2589
2692 // Normalize indices (if negative). 2590 // Normalize indices (if negative).
2693 // After normlaization they may still be 2591 // After normlaization they may still be
@@ -2712,7 +2610,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2712 public string osLoadedCreationDate() 2610 public string osLoadedCreationDate()
2713 { 2611 {
2714 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); 2612 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate");
2715 m_host.AddScriptLPS(1);
2716 2613
2717 return World.RegionInfo.RegionSettings.LoadedCreationDate; 2614 return World.RegionInfo.RegionSettings.LoadedCreationDate;
2718 } 2615 }
@@ -2720,7 +2617,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2720 public string osLoadedCreationTime() 2617 public string osLoadedCreationTime()
2721 { 2618 {
2722 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime"); 2619 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime");
2723 m_host.AddScriptLPS(1);
2724 2620
2725 return World.RegionInfo.RegionSettings.LoadedCreationTime; 2621 return World.RegionInfo.RegionSettings.LoadedCreationTime;
2726 } 2622 }
@@ -2728,7 +2624,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2728 public string osLoadedCreationID() 2624 public string osLoadedCreationID()
2729 { 2625 {
2730 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID"); 2626 CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID");
2731 m_host.AddScriptLPS(1);
2732 2627
2733 return World.RegionInfo.RegionSettings.LoadedCreationID; 2628 return World.RegionInfo.RegionSettings.LoadedCreationID;
2734 } 2629 }
@@ -2749,7 +2644,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2749 public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules) 2644 public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules)
2750 { 2645 {
2751 CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams"); 2646 CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams");
2752 m_host.AddScriptLPS(1); 2647
2753 InitLSL(); 2648 InitLSL();
2754 // One needs to cast m_LSL_Api because we're using functions not 2649 // One needs to cast m_LSL_Api because we're using functions not
2755 // on the ILSL_Api interface. 2650 // on the ILSL_Api interface.
@@ -2778,8 +2673,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2778 { 2673 {
2779 CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink"); 2674 CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink");
2780 2675
2781 m_host.AddScriptLPS(1);
2782
2783 InitLSL(); 2676 InitLSL();
2784 ((LSL_Api)m_LSL_Api).CreateLink(target, parent); 2677 ((LSL_Api)m_LSL_Api).CreateLink(target, parent);
2785 } 2678 }
@@ -2788,8 +2681,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2788 { 2681 {
2789 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink"); 2682 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink");
2790 2683
2791 m_host.AddScriptLPS(1);
2792
2793 InitLSL(); 2684 InitLSL();
2794 ((LSL_Api)m_LSL_Api).BreakLink(linknum); 2685 ((LSL_Api)m_LSL_Api).BreakLink(linknum);
2795 } 2686 }
@@ -2798,8 +2689,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2798 { 2689 {
2799 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks"); 2690 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks");
2800 2691
2801 m_host.AddScriptLPS(1);
2802
2803 InitLSL(); 2692 InitLSL();
2804 ((LSL_Api)m_LSL_Api).BreakAllLinks(); 2693 ((LSL_Api)m_LSL_Api).BreakAllLinks();
2805 } 2694 }
@@ -2807,7 +2696,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2807 public LSL_Integer osIsNpc(LSL_Key npc) 2696 public LSL_Integer osIsNpc(LSL_Key npc)
2808 { 2697 {
2809 CheckThreatLevel(); 2698 CheckThreatLevel();
2810 m_host.AddScriptLPS(1);
2811 2699
2812 INPCModule module = World.RequestModuleInterface<INPCModule>(); 2700 INPCModule module = World.RequestModuleInterface<INPCModule>();
2813 if (module != null) 2701 if (module != null)
@@ -2824,7 +2712,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2824 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) 2712 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard)
2825 { 2713 {
2826 CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); 2714 CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
2827 m_host.AddScriptLPS(1);
2828 2715
2829 // have to get the npc module also here to set the default Not Owned 2716 // have to get the npc module also here to set the default Not Owned
2830 INPCModule module = World.RequestModuleInterface<INPCModule>(); 2717 INPCModule module = World.RequestModuleInterface<INPCModule>();
@@ -2839,7 +2726,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2839 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) 2726 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
2840 { 2727 {
2841 CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); 2728 CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
2842 m_host.AddScriptLPS(1);
2843 2729
2844 return NpcCreate( 2730 return NpcCreate(
2845 firstname, lastname, position, notecard, 2731 firstname, lastname, position, notecard,
@@ -2982,7 +2868,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2982 public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) 2868 public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard)
2983 { 2869 {
2984 CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); 2870 CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance");
2985 m_host.AddScriptLPS(1);
2986 2871
2987 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 2872 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
2988 2873
@@ -3004,7 +2889,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3004 public void osNpcLoadAppearance(LSL_Key npc, string notecard) 2889 public void osNpcLoadAppearance(LSL_Key npc, string notecard)
3005 { 2890 {
3006 CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); 2891 CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance");
3007 m_host.AddScriptLPS(1);
3008 2892
3009 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 2893 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3010 2894
@@ -3036,7 +2920,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3036 public LSL_Key osNpcGetOwner(LSL_Key npc) 2920 public LSL_Key osNpcGetOwner(LSL_Key npc)
3037 { 2921 {
3038 CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner"); 2922 CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner");
3039 m_host.AddScriptLPS(1);
3040 2923
3041 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 2924 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3042 if (npcModule != null) 2925 if (npcModule != null)
@@ -3058,7 +2941,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3058 public LSL_Vector osNpcGetPos(LSL_Key npc) 2941 public LSL_Vector osNpcGetPos(LSL_Key npc)
3059 { 2942 {
3060 CheckThreatLevel(ThreatLevel.High, "osNpcGetPos"); 2943 CheckThreatLevel(ThreatLevel.High, "osNpcGetPos");
3061 m_host.AddScriptLPS(1);
3062 2944
3063 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 2945 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3064 if (npcModule != null) 2946 if (npcModule != null)
@@ -3082,7 +2964,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3082 public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) 2964 public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos)
3083 { 2965 {
3084 CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); 2966 CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
3085 m_host.AddScriptLPS(1);
3086 2967
3087 INPCModule module = World.RequestModuleInterface<INPCModule>(); 2968 INPCModule module = World.RequestModuleInterface<INPCModule>();
3088 if (module != null) 2969 if (module != null)
@@ -3101,7 +2982,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3101 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options) 2982 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options)
3102 { 2983 {
3103 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); 2984 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
3104 m_host.AddScriptLPS(1);
3105 2985
3106 INPCModule module = World.RequestModuleInterface<INPCModule>(); 2986 INPCModule module = World.RequestModuleInterface<INPCModule>();
3107 if (module != null) 2987 if (module != null)
@@ -3126,7 +3006,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3126 public LSL_Rotation osNpcGetRot(LSL_Key npc) 3006 public LSL_Rotation osNpcGetRot(LSL_Key npc)
3127 { 3007 {
3128 CheckThreatLevel(ThreatLevel.High, "osNpcGetRot"); 3008 CheckThreatLevel(ThreatLevel.High, "osNpcGetRot");
3129 m_host.AddScriptLPS(1);
3130 3009
3131 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 3010 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3132 if (npcModule != null) 3011 if (npcModule != null)
@@ -3150,7 +3029,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3150 public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) 3029 public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation)
3151 { 3030 {
3152 CheckThreatLevel(ThreatLevel.High, "osNpcSetRot"); 3031 CheckThreatLevel(ThreatLevel.High, "osNpcSetRot");
3153 m_host.AddScriptLPS(1);
3154 3032
3155 INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); 3033 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3156 if (npcModule != null) 3034 if (npcModule != null)
@@ -3172,7 +3050,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3172 public void osNpcStopMoveToTarget(LSL_Key npc) 3050 public void osNpcStopMoveToTarget(LSL_Key npc)
3173 { 3051 {
3174 CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); 3052 CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget");
3175 m_host.AddScriptLPS(1);
3176 3053
3177 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3054 INPCModule module = World.RequestModuleInterface<INPCModule>();
3178 if (module != null) 3055 if (module != null)
@@ -3189,7 +3066,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3189 public void osNpcSetProfileAbout(LSL_Key npc, string about) 3066 public void osNpcSetProfileAbout(LSL_Key npc, string about)
3190 { 3067 {
3191 CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout"); 3068 CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout");
3192 m_host.AddScriptLPS(1);
3193 3069
3194 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3070 INPCModule module = World.RequestModuleInterface<INPCModule>();
3195 if (module != null) 3071 if (module != null)
@@ -3208,7 +3084,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3208 public void osNpcSetProfileImage(LSL_Key npc, string image) 3084 public void osNpcSetProfileImage(LSL_Key npc, string image)
3209 { 3085 {
3210 CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage"); 3086 CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage");
3211 m_host.AddScriptLPS(1);
3212 3087
3213 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3088 INPCModule module = World.RequestModuleInterface<INPCModule>();
3214 if (module != null) 3089 if (module != null)
@@ -3242,7 +3117,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3242 public void osNpcSay(LSL_Key npc, int channel, string message) 3117 public void osNpcSay(LSL_Key npc, int channel, string message)
3243 { 3118 {
3244 CheckThreatLevel(ThreatLevel.High, "osNpcSay"); 3119 CheckThreatLevel(ThreatLevel.High, "osNpcSay");
3245 m_host.AddScriptLPS(1);
3246 3120
3247 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3121 INPCModule module = World.RequestModuleInterface<INPCModule>();
3248 if (module != null) 3122 if (module != null)
@@ -3259,7 +3133,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3259 public void osNpcShout(LSL_Key npc, int channel, string message) 3133 public void osNpcShout(LSL_Key npc, int channel, string message)
3260 { 3134 {
3261 CheckThreatLevel(ThreatLevel.High, "osNpcShout"); 3135 CheckThreatLevel(ThreatLevel.High, "osNpcShout");
3262 m_host.AddScriptLPS(1);
3263 3136
3264 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3137 INPCModule module = World.RequestModuleInterface<INPCModule>();
3265 if (module != null) 3138 if (module != null)
@@ -3276,7 +3149,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3276 public void osNpcSit(LSL_Key npc, LSL_Key target, int options) 3149 public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
3277 { 3150 {
3278 CheckThreatLevel(ThreatLevel.High, "osNpcSit"); 3151 CheckThreatLevel(ThreatLevel.High, "osNpcSit");
3279 m_host.AddScriptLPS(1);
3280 3152
3281 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3153 INPCModule module = World.RequestModuleInterface<INPCModule>();
3282 if (module != null) 3154 if (module != null)
@@ -3293,7 +3165,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3293 public void osNpcStand(LSL_Key npc) 3165 public void osNpcStand(LSL_Key npc)
3294 { 3166 {
3295 CheckThreatLevel(ThreatLevel.High, "osNpcStand"); 3167 CheckThreatLevel(ThreatLevel.High, "osNpcStand");
3296 m_host.AddScriptLPS(1);
3297 3168
3298 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3169 INPCModule module = World.RequestModuleInterface<INPCModule>();
3299 if (module != null) 3170 if (module != null)
@@ -3310,7 +3181,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3310 public void osNpcRemove(LSL_Key npc) 3181 public void osNpcRemove(LSL_Key npc)
3311 { 3182 {
3312 CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); 3183 CheckThreatLevel(ThreatLevel.High, "osNpcRemove");
3313 m_host.AddScriptLPS(1);
3314 3184
3315 try 3185 try
3316 { 3186 {
@@ -3331,7 +3201,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3331 public void osNpcPlayAnimation(LSL_Key npc, string animation) 3201 public void osNpcPlayAnimation(LSL_Key npc, string animation)
3332 { 3202 {
3333 CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation"); 3203 CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation");
3334 m_host.AddScriptLPS(1);
3335 3204
3336 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3205 INPCModule module = World.RequestModuleInterface<INPCModule>();
3337 if (module != null) 3206 if (module != null)
@@ -3346,7 +3215,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3346 public void osNpcStopAnimation(LSL_Key npc, string animation) 3215 public void osNpcStopAnimation(LSL_Key npc, string animation)
3347 { 3216 {
3348 CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation"); 3217 CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation");
3349 m_host.AddScriptLPS(1);
3350 3218
3351 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3219 INPCModule module = World.RequestModuleInterface<INPCModule>();
3352 if (module != null) 3220 if (module != null)
@@ -3361,7 +3229,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3361 public void osNpcWhisper(LSL_Key npc, int channel, string message) 3229 public void osNpcWhisper(LSL_Key npc, int channel, string message)
3362 { 3230 {
3363 CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); 3231 CheckThreatLevel(ThreatLevel.High, "osNpcWhisper");
3364 m_host.AddScriptLPS(1);
3365 3232
3366 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3233 INPCModule module = World.RequestModuleInterface<INPCModule>();
3367 if (module != null) 3234 if (module != null)
@@ -3378,7 +3245,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3378 public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num) 3245 public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
3379 { 3246 {
3380 CheckThreatLevel(ThreatLevel.High, "osNpcTouch"); 3247 CheckThreatLevel(ThreatLevel.High, "osNpcTouch");
3381 m_host.AddScriptLPS(1);
3382 3248
3383 INPCModule module = World.RequestModuleInterface<INPCModule>(); 3249 INPCModule module = World.RequestModuleInterface<INPCModule>();
3384 int linkNum = link_num.value; 3250 int linkNum = link_num.value;
@@ -3423,7 +3289,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3423 public LSL_Key osOwnerSaveAppearance(string notecard) 3289 public LSL_Key osOwnerSaveAppearance(string notecard)
3424 { 3290 {
3425 CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); 3291 CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance");
3426 m_host.AddScriptLPS(1);
3427 3292
3428 return SaveAppearanceToNotecard(m_host.OwnerID, notecard); 3293 return SaveAppearanceToNotecard(m_host.OwnerID, notecard);
3429 } 3294 }
@@ -3431,7 +3296,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3431 public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) 3296 public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard)
3432 { 3297 {
3433 CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); 3298 CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
3434 m_host.AddScriptLPS(1);
3435 3299
3436 return SaveAppearanceToNotecard(avatarId, notecard); 3300 return SaveAppearanceToNotecard(avatarId, notecard);
3437 } 3301 }
@@ -3484,7 +3348,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3484 public LSL_String osGetGender(LSL_Key rawAvatarId) 3348 public LSL_String osGetGender(LSL_Key rawAvatarId)
3485 { 3349 {
3486 CheckThreatLevel(ThreatLevel.None, "osGetGender"); 3350 CheckThreatLevel(ThreatLevel.None, "osGetGender");
3487 m_host.AddScriptLPS(1);
3488 3351
3489 UUID avatarId; 3352 UUID avatarId;
3490 if (!UUID.TryParse(rawAvatarId, out avatarId)) 3353 if (!UUID.TryParse(rawAvatarId, out avatarId))
@@ -3527,9 +3390,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3527 /// <returns></returns> 3390 /// <returns></returns>
3528 public LSL_Key osGetMapTexture() 3391 public LSL_Key osGetMapTexture()
3529 { 3392 {
3530// CheckThreatLevel(ThreatLevel.None, "osGetMapTexture");
3531 CheckThreatLevel(); 3393 CheckThreatLevel();
3532 m_host.AddScriptLPS(1);
3533 3394
3534 return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); 3395 return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString();
3535 } 3396 }
@@ -3542,7 +3403,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3542 public LSL_Key osGetRegionMapTexture(string regionName) 3403 public LSL_Key osGetRegionMapTexture(string regionName)
3543 { 3404 {
3544 CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture"); 3405 CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture");
3545 m_host.AddScriptLPS(1);
3546 3406
3547 Scene scene = m_ScriptEngine.World; 3407 Scene scene = m_ScriptEngine.World;
3548 UUID key = UUID.Zero; 3408 UUID key = UUID.Zero;
@@ -3573,7 +3433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3573 public LSL_List osGetRegionStats() 3433 public LSL_List osGetRegionStats()
3574 { 3434 {
3575 CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); 3435 CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
3576 m_host.AddScriptLPS(1); 3436
3577 LSL_List ret = new LSL_List(); 3437 LSL_List ret = new LSL_List();
3578 float[] stats = World.StatsReporter.LastReportedSimStats; 3438 float[] stats = World.StatsReporter.LastReportedSimStats;
3579 3439
@@ -3587,7 +3447,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3587 public LSL_Vector osGetRegionSize() 3447 public LSL_Vector osGetRegionSize()
3588 { 3448 {
3589 CheckThreatLevel(); 3449 CheckThreatLevel();
3590 m_host.AddScriptLPS(1);
3591 3450
3592 Scene scene = m_ScriptEngine.World; 3451 Scene scene = m_ScriptEngine.World;
3593 RegionInfo reg = World.RegionInfo; 3452 RegionInfo reg = World.RegionInfo;
@@ -3599,7 +3458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3599 public int osGetSimulatorMemory() 3458 public int osGetSimulatorMemory()
3600 { 3459 {
3601 CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); 3460 CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
3602 m_host.AddScriptLPS(1); 3461
3603 long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; 3462 long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64;
3604 3463
3605 if (pws > Int32.MaxValue) 3464 if (pws > Int32.MaxValue)
@@ -3613,7 +3472,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3613 public void osSetSpeed(string UUID, LSL_Float SpeedModifier) 3472 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
3614 { 3473 {
3615 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 3474 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
3616 m_host.AddScriptLPS(1); 3475
3617 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 3476 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
3618 3477
3619 if (avatar != null) 3478 if (avatar != null)
@@ -3623,7 +3482,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3623 public void osKickAvatar(string FirstName, string SurName, string alert) 3482 public void osKickAvatar(string FirstName, string SurName, string alert)
3624 { 3483 {
3625 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 3484 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
3626 m_host.AddScriptLPS(1);
3627 3485
3628 World.ForEachRootScenePresence(delegate(ScenePresence sp) 3486 World.ForEachRootScenePresence(delegate(ScenePresence sp)
3629 { 3487 {
@@ -3642,7 +3500,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3642 public LSL_Float osGetHealth(string avatar) 3500 public LSL_Float osGetHealth(string avatar)
3643 { 3501 {
3644 CheckThreatLevel(ThreatLevel.None, "osGetHealth"); 3502 CheckThreatLevel(ThreatLevel.None, "osGetHealth");
3645 m_host.AddScriptLPS(1);
3646 3503
3647 LSL_Float health = new LSL_Float(-1); 3504 LSL_Float health = new LSL_Float(-1);
3648 ScenePresence presence = World.GetScenePresence(new UUID(avatar)); 3505 ScenePresence presence = World.GetScenePresence(new UUID(avatar));
@@ -3654,7 +3511,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3654 public void osCauseDamage(string avatar, double damage) 3511 public void osCauseDamage(string avatar, double damage)
3655 { 3512 {
3656 CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); 3513 CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
3657 m_host.AddScriptLPS(1);
3658 3514
3659 UUID avatarId = new UUID(avatar); 3515 UUID avatarId = new UUID(avatar);
3660 Vector3 pos = m_host.GetWorldPosition(); 3516 Vector3 pos = m_host.GetWorldPosition();
@@ -3682,7 +3538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3682 public void osCauseHealing(string avatar, double healing) 3538 public void osCauseHealing(string avatar, double healing)
3683 { 3539 {
3684 CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); 3540 CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
3685 m_host.AddScriptLPS(1);
3686 3541
3687 UUID avatarId = new UUID(avatar); 3542 UUID avatarId = new UUID(avatar);
3688 ScenePresence presence = World.GetScenePresence(avatarId); 3543 ScenePresence presence = World.GetScenePresence(avatarId);
@@ -3702,7 +3557,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3702 public void osSetHealth(string avatar, double health) 3557 public void osSetHealth(string avatar, double health)
3703 { 3558 {
3704 CheckThreatLevel(ThreatLevel.High, "osSetHealth"); 3559 CheckThreatLevel(ThreatLevel.High, "osSetHealth");
3705 m_host.AddScriptLPS(1);
3706 3560
3707 UUID avatarId = new UUID(avatar); 3561 UUID avatarId = new UUID(avatar);
3708 ScenePresence presence = World.GetScenePresence(avatarId); 3562 ScenePresence presence = World.GetScenePresence(avatarId);
@@ -3721,7 +3575,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3721 public void osSetHealRate(string avatar, double healrate) 3575 public void osSetHealRate(string avatar, double healrate)
3722 { 3576 {
3723 CheckThreatLevel(ThreatLevel.High, "osSetHealRate"); 3577 CheckThreatLevel(ThreatLevel.High, "osSetHealRate");
3724 m_host.AddScriptLPS(1);
3725 3578
3726 UUID avatarId = new UUID(avatar); 3579 UUID avatarId = new UUID(avatar);
3727 ScenePresence presence = World.GetScenePresence(avatarId); 3580 ScenePresence presence = World.GetScenePresence(avatarId);
@@ -3733,7 +3586,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3733 public LSL_Float osGetHealRate(string avatar) 3586 public LSL_Float osGetHealRate(string avatar)
3734 { 3587 {
3735 CheckThreatLevel(ThreatLevel.None, "osGetHealRate"); 3588 CheckThreatLevel(ThreatLevel.None, "osGetHealRate");
3736 m_host.AddScriptLPS(1);
3737 3589
3738 LSL_Float rate = new LSL_Float(0); 3590 LSL_Float rate = new LSL_Float(0);
3739 ScenePresence presence = World.GetScenePresence(new UUID(avatar)); 3591 ScenePresence presence = World.GetScenePresence(new UUID(avatar));
@@ -3745,18 +3597,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3745 public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) 3597 public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
3746 { 3598 {
3747 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 3599 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
3748 m_host.AddScriptLPS(1);
3749 InitLSL();
3750 3600
3601 InitLSL();
3751 return m_LSL_Api.GetPrimitiveParamsEx(prim, rules); 3602 return m_LSL_Api.GetPrimitiveParamsEx(prim, rules);
3752 } 3603 }
3753 3604
3754 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 3605 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
3755 { 3606 {
3756 CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); 3607 CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
3757 m_host.AddScriptLPS(1);
3758 InitLSL();
3759 3608
3609 InitLSL();
3760 m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); 3610 m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams");
3761 } 3611 }
3762 3612
@@ -3765,8 +3615,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3765 /// </summary> 3615 /// </summary>
3766 public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) 3616 public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
3767 { 3617 {
3768 CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams");
3769
3770 osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb); 3618 osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb);
3771 } 3619 }
3772 3620
@@ -3776,7 +3624,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3776 public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) 3624 public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
3777 { 3625 {
3778 CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); 3626 CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams");
3779 m_host.AddScriptLPS(1);
3780 3627
3781 SceneObjectPart obj = null; 3628 SceneObjectPart obj = null;
3782 if (prim == UUID.Zero.ToString()) 3629 if (prim == UUID.Zero.ToString())
@@ -3807,7 +3654,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3807 public LSL_List osGetAvatarList() 3654 public LSL_List osGetAvatarList()
3808 { 3655 {
3809 CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); 3656 CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
3810 m_host.AddScriptLPS(1);
3811 3657
3812 LSL_List result = new LSL_List(); 3658 LSL_List result = new LSL_List();
3813 World.ForEachRootScenePresence(delegate (ScenePresence avatar) 3659 World.ForEachRootScenePresence(delegate (ScenePresence avatar)
@@ -3826,7 +3672,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3826 public LSL_List osGetNPCList() 3672 public LSL_List osGetNPCList()
3827 { 3673 {
3828 CheckThreatLevel(ThreatLevel.None, "osGetNPCList"); 3674 CheckThreatLevel(ThreatLevel.None, "osGetNPCList");
3829 m_host.AddScriptLPS(1);
3830 3675
3831 LSL_List result = new LSL_List(); 3676 LSL_List result = new LSL_List();
3832 World.ForEachRootScenePresence(delegate (ScenePresence avatar) 3677 World.ForEachRootScenePresence(delegate (ScenePresence avatar)
@@ -3851,7 +3696,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3851 public LSL_String osUnixTimeToTimestamp(long time) 3696 public LSL_String osUnixTimeToTimestamp(long time)
3852 { 3697 {
3853 CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); 3698 CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp");
3854 m_host.AddScriptLPS(1);
3855 3699
3856 long baseTicks = 621355968000000000; 3700 long baseTicks = 621355968000000000;
3857 long tickResolution = 10000000; 3701 long tickResolution = 10000000;
@@ -3869,7 +3713,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3869 public LSL_String osGetInventoryDesc(string item) 3713 public LSL_String osGetInventoryDesc(string item)
3870 { 3714 {
3871 CheckThreatLevel(); 3715 CheckThreatLevel();
3872 m_host.AddScriptLPS(1);
3873 3716
3874 lock (m_host.TaskInventory) 3717 lock (m_host.TaskInventory)
3875 { 3718 {
@@ -3893,7 +3736,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3893 public LSL_Integer osInviteToGroup(LSL_Key agentId) 3736 public LSL_Integer osInviteToGroup(LSL_Key agentId)
3894 { 3737 {
3895 CheckThreatLevel(ThreatLevel.VeryLow, "osInviteToGroup"); 3738 CheckThreatLevel(ThreatLevel.VeryLow, "osInviteToGroup");
3896 m_host.AddScriptLPS(1);
3897 3739
3898 UUID agent = new UUID(agentId); 3740 UUID agent = new UUID(agentId);
3899 3741
@@ -3928,7 +3770,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3928 public LSL_Integer osEjectFromGroup(LSL_Key agentId) 3770 public LSL_Integer osEjectFromGroup(LSL_Key agentId)
3929 { 3771 {
3930 CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup"); 3772 CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup");
3931 m_host.AddScriptLPS(1);
3932 3773
3933 UUID agent = new UUID(agentId); 3774 UUID agent = new UUID(agentId);
3934 3775
@@ -3964,7 +3805,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3964 { 3805 {
3965 CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture"); 3806 CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture");
3966 3807
3967 m_host.AddScriptLPS(1);
3968 //Check to make sure that the script's owner is the estate manager/master 3808 //Check to make sure that the script's owner is the estate manager/master
3969 //World.Permissions.GenericEstatePermission( 3809 //World.Permissions.GenericEstatePermission(
3970 if (World.Permissions.IsGod(m_host.OwnerID)) 3810 if (World.Permissions.IsGod(m_host.OwnerID))
@@ -3994,7 +3834,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3994 { 3834 {
3995 CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight"); 3835 CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight");
3996 3836
3997 m_host.AddScriptLPS(1);
3998 //Check to make sure that the script's owner is the estate manager/master 3837 //Check to make sure that the script's owner is the estate manager/master
3999 //World.Permissions.GenericEstatePermission( 3838 //World.Permissions.GenericEstatePermission(
4000 if (World.Permissions.IsGod(m_host.OwnerID)) 3839 if (World.Permissions.IsGod(m_host.OwnerID))
@@ -4015,8 +3854,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4015 { 3854 {
4016 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); 3855 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar");
4017 3856
4018 m_host.AddScriptLPS(1);
4019
4020 InitLSL(); 3857 InitLSL();
4021 ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint); 3858 ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint);
4022 } 3859 }
@@ -4025,8 +3862,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4025 { 3862 {
4026 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory"); 3863 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory");
4027 3864
4028 m_host.AddScriptLPS(1);
4029
4030 ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint); 3865 ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint);
4031 } 3866 }
4032 3867
@@ -4034,8 +3869,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4034 { 3869 {
4035 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceAttachToOtherAvatarFromInventory"); 3870 CheckThreatLevel(ThreatLevel.VeryHigh, "osForceAttachToOtherAvatarFromInventory");
4036 3871
4037 m_host.AddScriptLPS(1);
4038
4039 UUID avatarId; 3872 UUID avatarId;
4040 3873
4041 if (!UUID.TryParse(rawAvatarId, out avatarId)) 3874 if (!UUID.TryParse(rawAvatarId, out avatarId))
@@ -4095,8 +3928,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4095 { 3928 {
4096 CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); 3929 CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar");
4097 3930
4098 m_host.AddScriptLPS(1);
4099
4100 InitLSL(); 3931 InitLSL();
4101 ((LSL_Api)m_LSL_Api).DetachFromAvatar(); 3932 ((LSL_Api)m_LSL_Api).DetachFromAvatar();
4102 } 3933 }
@@ -4105,8 +3936,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4105 { 3936 {
4106 CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments"); 3937 CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments");
4107 3938
4108 m_host.AddScriptLPS(1);
4109
4110 UUID targetUUID; 3939 UUID targetUUID;
4111 ScenePresence target; 3940 ScenePresence target;
4112 LSL_List resp = new LSL_List(); 3941 LSL_List resp = new LSL_List();
@@ -4140,7 +3969,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4140 public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options) 3969 public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options)
4141 { 3970 {
4142 CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments"); 3971 CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments");
4143 m_host.AddScriptLPS(1);
4144 3972
4145 UUID targetUUID; 3973 UUID targetUUID;
4146 if(!UUID.TryParse(avatar.ToString(), out targetUUID)) 3974 if(!UUID.TryParse(avatar.ToString(), out targetUUID))
@@ -4250,7 +4078,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4250 public LSL_Integer osIsUUID(string thing) 4078 public LSL_Integer osIsUUID(string thing)
4251 { 4079 {
4252 CheckThreatLevel(); 4080 CheckThreatLevel();
4253 m_host.AddScriptLPS(1);
4254 4081
4255 UUID test; 4082 UUID test;
4256 return UUID.TryParse(thing, out test) ? 1 : 0; 4083 return UUID.TryParse(thing, out test) ? 1 : 0;
@@ -4265,7 +4092,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4265 public LSL_Float osMin(double a, double b) 4092 public LSL_Float osMin(double a, double b)
4266 { 4093 {
4267 CheckThreatLevel(); 4094 CheckThreatLevel();
4268 m_host.AddScriptLPS(1);
4269 4095
4270 return Math.Min(a, b); 4096 return Math.Min(a, b);
4271 } 4097 }
@@ -4279,7 +4105,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4279 public LSL_Float osMax(double a, double b) 4105 public LSL_Float osMax(double a, double b)
4280 { 4106 {
4281 CheckThreatLevel(); 4107 CheckThreatLevel();
4282 m_host.AddScriptLPS(1);
4283 4108
4284 return Math.Max(a, b); 4109 return Math.Max(a, b);
4285 } 4110 }
@@ -4287,7 +4112,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4287 public LSL_Key osGetRezzingObject() 4112 public LSL_Key osGetRezzingObject()
4288 { 4113 {
4289 CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); 4114 CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject");
4290 m_host.AddScriptLPS(1); 4115
4291 UUID rezID = m_host.ParentGroup.RezzerID; 4116 UUID rezID = m_host.ParentGroup.RezzerID;
4292 if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null) 4117 if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null)
4293 return new LSL_Key(UUID.Zero.ToString()); 4118 return new LSL_Key(UUID.Zero.ToString());
@@ -4312,7 +4137,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4312 /// <returns>boolean indicating whether an error was shouted.</returns> 4137 /// <returns>boolean indicating whether an error was shouted.</returns>
4313 protected bool ShoutErrorOnLackingOwnerPerms(int perms, string errorPrefix) 4138 protected bool ShoutErrorOnLackingOwnerPerms(int perms, string errorPrefix)
4314 { 4139 {
4315 m_host.AddScriptLPS(1);
4316 bool fail = false; 4140 bool fail = false;
4317 if (m_item.PermsGranter != m_host.OwnerID) 4141 if (m_item.PermsGranter != m_host.OwnerID)
4318 { 4142 {
@@ -4363,7 +4187,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4363 public void osDropAttachment() 4187 public void osDropAttachment()
4364 { 4188 {
4365 CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); 4189 CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment");
4366 m_host.AddScriptLPS(1);
4367 4190
4368 DropAttachment(true); 4191 DropAttachment(true);
4369 } 4192 }
@@ -4371,7 +4194,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4371 public void osForceDropAttachment() 4194 public void osForceDropAttachment()
4372 { 4195 {
4373 CheckThreatLevel(ThreatLevel.High, "osForceDropAttachment"); 4196 CheckThreatLevel(ThreatLevel.High, "osForceDropAttachment");
4374 m_host.AddScriptLPS(1);
4375 4197
4376 DropAttachment(false); 4198 DropAttachment(false);
4377 } 4199 }
@@ -4379,7 +4201,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4379 public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) 4201 public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot)
4380 { 4202 {
4381 CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachmentAt"); 4203 CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachmentAt");
4382 m_host.AddScriptLPS(1);
4383 4204
4384 DropAttachmentAt(true, pos, rot); 4205 DropAttachmentAt(true, pos, rot);
4385 } 4206 }
@@ -4387,7 +4208,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4387 public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) 4208 public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot)
4388 { 4209 {
4389 CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt"); 4210 CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt");
4390 m_host.AddScriptLPS(1);
4391 4211
4392 DropAttachmentAt(false, pos, rot); 4212 DropAttachmentAt(false, pos, rot);
4393 } 4213 }
@@ -4395,7 +4215,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4395 public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield) 4215 public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield)
4396 { 4216 {
4397 CheckThreatLevel(ThreatLevel.Low, "osListenRegex"); 4217 CheckThreatLevel(ThreatLevel.Low, "osListenRegex");
4398 m_host.AddScriptLPS(1); 4218
4399 UUID keyID; 4219 UUID keyID;
4400 UUID.TryParse(ID, out keyID); 4220 UUID.TryParse(ID, out keyID);
4401 4221
@@ -4443,7 +4263,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4443 public LSL_Integer osRegexIsMatch(string input, string pattern) 4263 public LSL_Integer osRegexIsMatch(string input, string pattern)
4444 { 4264 {
4445 CheckThreatLevel(ThreatLevel.Low, "osRegexIsMatch"); 4265 CheckThreatLevel(ThreatLevel.Low, "osRegexIsMatch");
4446 m_host.AddScriptLPS(1); 4266
4447 try 4267 try
4448 { 4268 {
4449 return Regex.IsMatch(input, pattern) ? 1 : 0; 4269 return Regex.IsMatch(input, pattern) ? 1 : 0;
@@ -4458,7 +4278,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4458 public LSL_String osRequestURL(LSL_List options) 4278 public LSL_String osRequestURL(LSL_List options)
4459 { 4279 {
4460 CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL"); 4280 CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
4461 m_host.AddScriptLPS(1);
4462 4281
4463 Hashtable opts = new Hashtable(); 4282 Hashtable opts = new Hashtable();
4464 for (int i = 0 ; i < options.Length ; i++) 4283 for (int i = 0 ; i < options.Length ; i++)
@@ -4476,7 +4295,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4476 public LSL_String osRequestSecureURL(LSL_List options) 4295 public LSL_String osRequestSecureURL(LSL_List options)
4477 { 4296 {
4478 CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL"); 4297 CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
4479 m_host.AddScriptLPS(1);
4480 4298
4481 Hashtable opts = new Hashtable(); 4299 Hashtable opts = new Hashtable();
4482 for (int i = 0 ; i < options.Length ; i++) 4300 for (int i = 0 ; i < options.Length ; i++)
@@ -4494,7 +4312,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4494 public void osCollisionSound(string impact_sound, double impact_volume) 4312 public void osCollisionSound(string impact_sound, double impact_volume)
4495 { 4313 {
4496 CheckThreatLevel(); 4314 CheckThreatLevel();
4497 m_host.AddScriptLPS(1);
4498 4315
4499 if(impact_sound == "") 4316 if(impact_sound == "")
4500 { 4317 {
@@ -4527,7 +4344,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4527 public void osVolumeDetect(int detect) 4344 public void osVolumeDetect(int detect)
4528 { 4345 {
4529 CheckThreatLevel(); 4346 CheckThreatLevel();
4530 m_host.AddScriptLPS(1);
4531 4347
4532 if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment) 4348 if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment)
4533 return; 4349 return;
@@ -4550,7 +4366,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4550 public LSL_List osGetInertiaData() 4366 public LSL_List osGetInertiaData()
4551 { 4367 {
4552 CheckThreatLevel(); 4368 CheckThreatLevel();
4553 m_host.AddScriptLPS(1);
4554 4369
4555 LSL_List result = new LSL_List(); 4370 LSL_List result = new LSL_List();
4556 float TotalMass; 4371 float TotalMass;
@@ -4598,7 +4413,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4598 public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot) 4413 public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot)
4599 { 4414 {
4600 CheckThreatLevel(); 4415 CheckThreatLevel();
4601 m_host.AddScriptLPS(1);
4602 4416
4603 SceneObjectGroup sog = m_host.ParentGroup; 4417 SceneObjectGroup sog = m_host.ParentGroup;
4604 if(sog== null || sog.IsDeleted) 4418 if(sog== null || sog.IsDeleted)
@@ -4637,7 +4451,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4637 public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot) 4451 public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot)
4638 { 4452 {
4639 CheckThreatLevel(); 4453 CheckThreatLevel();
4640 m_host.AddScriptLPS(1);
4641 4454
4642 SceneObjectGroup sog = m_host.ParentGroup; 4455 SceneObjectGroup sog = m_host.ParentGroup;
4643 if(sog== null || sog.IsDeleted) 4456 if(sog== null || sog.IsDeleted)
@@ -4679,7 +4492,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4679 public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass) 4492 public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass)
4680 { 4493 {
4681 CheckThreatLevel(); 4494 CheckThreatLevel();
4682 m_host.AddScriptLPS(1);
4683 4495
4684 SceneObjectGroup sog = m_host.ParentGroup; 4496 SceneObjectGroup sog = m_host.ParentGroup;
4685 if(sog== null || sog.IsDeleted) 4497 if(sog== null || sog.IsDeleted)
@@ -4719,7 +4531,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4719 public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot) 4531 public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot)
4720 { 4532 {
4721 CheckThreatLevel(); 4533 CheckThreatLevel();
4722 m_host.AddScriptLPS(1);
4723 4534
4724 SceneObjectGroup sog = m_host.ParentGroup; 4535 SceneObjectGroup sog = m_host.ParentGroup;
4725 if(sog== null || sog.IsDeleted) 4536 if(sog== null || sog.IsDeleted)
@@ -4758,7 +4569,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4758 public void osClearInertia() 4569 public void osClearInertia()
4759 { 4570 {
4760 CheckThreatLevel(); 4571 CheckThreatLevel();
4761 m_host.AddScriptLPS(1);
4762 4572
4763 SceneObjectGroup sog = m_host.ParentGroup; 4573 SceneObjectGroup sog = m_host.ParentGroup;
4764 if(sog== null || sog.IsDeleted) 4574 if(sog== null || sog.IsDeleted)
@@ -4817,7 +4627,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4817 public LSL_Integer osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags) 4627 public LSL_Integer osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags)
4818 { 4628 {
4819 CheckThreatLevel(ThreatLevel.Severe, "osTeleportObject"); 4629 CheckThreatLevel(ThreatLevel.Severe, "osTeleportObject");
4820 m_host.AddScriptLPS(1);
4821 4630
4822 UUID objUUID; 4631 UUID objUUID;
4823 if (!UUID.TryParse(objectUUID, out objUUID)) 4632 if (!UUID.TryParse(objectUUID, out objUUID))
@@ -4846,7 +4655,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4846 public LSL_Integer osGetLinkNumber(LSL_String name) 4655 public LSL_Integer osGetLinkNumber(LSL_String name)
4847 { 4656 {
4848 CheckThreatLevel(); 4657 CheckThreatLevel();
4849 m_host.AddScriptLPS(1);
4850 4658
4851 SceneObjectGroup sog = m_host.ParentGroup; 4659 SceneObjectGroup sog = m_host.ParentGroup;
4852 if(sog== null || sog.IsDeleted) 4660 if(sog== null || sog.IsDeleted)
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini
index 83d9756..5f9eeb8 100644
--- a/bin/config-include/osslEnable.ini
+++ b/bin/config-include/osslEnable.ini
@@ -218,10 +218,10 @@
218 Allow_osTeleportAgent = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER 218 Allow_osTeleportAgent = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
219 Allow_osTeleportObject = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER 219 Allow_osTeleportObject = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
220 220
221; funtions ThreatLevel Severe with aditional internal restrictions 221; funtions ThreatLevel Severe with additional internal restrictions
222 Allow_osGetAgentIP = true ; always restricted to Administrators (true or false to disable) 222 Allow_osGetAgentIP = true ; always restricted to Administrators (true or false to disable)
223 223
224; avaiable funtions out of Threat level control (for reference only) 224; available funtions out of Threat level control (for reference only)
225; Allow_osClearInertia = true 225; Allow_osClearInertia = true
226; Allow_osCheckODE = true 226; Allow_osCheckODE = true
227; Allow_osCollisionSound = true 227; Allow_osCollisionSound = true