diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 178 |
1 files changed, 39 insertions, 139 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6202a5c..3f61aff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -455,13 +455,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
455 | 455 | ||
456 | public LSL_Float osGetTerrainHeight(int x, int y) | 456 | public LSL_Float osGetTerrainHeight(int x, int y) |
457 | { | 457 | { |
458 | CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight"); | ||
459 | return GetTerrainHeight(x, y); | 458 | return GetTerrainHeight(x, y); |
460 | } | 459 | } |
461 | 460 | ||
462 | public LSL_Float osTerrainGetHeight(int x, int y) | 461 | public LSL_Float osTerrainGetHeight(int x, int y) |
463 | { | 462 | { |
464 | CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); | ||
465 | OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); | 463 | OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); |
466 | return GetTerrainHeight(x, y); | 464 | return GetTerrainHeight(x, y); |
467 | } | 465 | } |
@@ -569,11 +567,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
569 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, | 567 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, |
570 | int timer) | 568 | int timer) |
571 | { | 569 | { |
572 | // This may be upgraded depending on the griefing or DOS | ||
573 | // potential, or guarded with a delay | ||
574 | // | ||
575 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURL"); | ||
576 | |||
577 | m_host.AddScriptLPS(1); | 570 | m_host.AddScriptLPS(1); |
578 | if (dynamicID == String.Empty) | 571 | if (dynamicID == String.Empty) |
579 | { | 572 | { |
@@ -594,8 +587,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
594 | public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, | 587 | public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, |
595 | int timer, int alpha) | 588 | int timer, int alpha) |
596 | { | 589 | { |
597 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlend"); | ||
598 | |||
599 | m_host.AddScriptLPS(1); | 590 | m_host.AddScriptLPS(1); |
600 | if (dynamicID == String.Empty) | 591 | if (dynamicID == String.Empty) |
601 | { | 592 | { |
@@ -616,8 +607,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
616 | public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, | 607 | public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, |
617 | bool blend, int disp, int timer, int alpha, int face) | 608 | bool blend, int disp, int timer, int alpha, int face) |
618 | { | 609 | { |
619 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace"); | ||
620 | |||
621 | m_host.AddScriptLPS(1); | 610 | m_host.AddScriptLPS(1); |
622 | if (dynamicID == String.Empty) | 611 | if (dynamicID == String.Empty) |
623 | { | 612 | { |
@@ -638,8 +627,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
638 | public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, | 627 | public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, |
639 | int timer) | 628 | int timer) |
640 | { | 629 | { |
641 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData"); | ||
642 | |||
643 | m_host.AddScriptLPS(1); | 630 | m_host.AddScriptLPS(1); |
644 | if (dynamicID == String.Empty) | 631 | if (dynamicID == String.Empty) |
645 | { | 632 | { |
@@ -667,8 +654,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
667 | public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, | 654 | public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, |
668 | int timer, int alpha) | 655 | int timer, int alpha) |
669 | { | 656 | { |
670 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend"); | ||
671 | |||
672 | m_host.AddScriptLPS(1); | 657 | m_host.AddScriptLPS(1); |
673 | if (dynamicID == String.Empty) | 658 | if (dynamicID == String.Empty) |
674 | { | 659 | { |
@@ -696,8 +681,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
696 | public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, | 681 | public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, |
697 | bool blend, int disp, int timer, int alpha, int face) | 682 | bool blend, int disp, int timer, int alpha, int face) |
698 | { | 683 | { |
699 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlendFace"); | ||
700 | |||
701 | m_host.AddScriptLPS(1); | 684 | m_host.AddScriptLPS(1); |
702 | if (dynamicID == String.Empty) | 685 | if (dynamicID == String.Empty) |
703 | { | 686 | { |
@@ -752,7 +735,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
752 | { | 735 | { |
753 | // High because there is no security check. High griefer potential | 736 | // High because there is no security check. High griefer potential |
754 | // | 737 | // |
755 | CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); | 738 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); |
756 | 739 | ||
757 | TeleportAgent(agent, regionName, position, lookat, false); | 740 | TeleportAgent(agent, regionName, position, lookat, false); |
758 | } | 741 | } |
@@ -794,7 +777,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
794 | { | 777 | { |
795 | // High because there is no security check. High griefer potential | 778 | // High because there is no security check. High griefer potential |
796 | // | 779 | // |
797 | CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); | 780 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); |
798 | 781 | ||
799 | TeleportAgent(agent, regionX, regionY, position, lookat, false); | 782 | TeleportAgent(agent, regionX, regionY, position, lookat, false); |
800 | } | 783 | } |
@@ -837,14 +820,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
837 | 820 | ||
838 | public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | 821 | public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) |
839 | { | 822 | { |
823 | // High because there is no security check. High griefer potential | ||
824 | // | ||
825 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | ||
826 | |||
840 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); | 827 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); |
841 | } | 828 | } |
842 | 829 | ||
843 | public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | 830 | public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) |
844 | { | 831 | { |
845 | // Threat level None because this is what can already be done with the World Map in the viewer | ||
846 | CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); | ||
847 | |||
848 | TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, true); | 832 | TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, true); |
849 | } | 833 | } |
850 | 834 | ||
@@ -855,8 +839,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
855 | 839 | ||
856 | public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | 840 | public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) |
857 | { | 841 | { |
858 | CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); | ||
859 | |||
860 | TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true); | 842 | TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true); |
861 | } | 843 | } |
862 | 844 | ||
@@ -889,8 +871,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
889 | m_host.AddScriptLPS(1); | 871 | m_host.AddScriptLPS(1); |
890 | 872 | ||
891 | UUID targetID = new UUID(target); | 873 | UUID targetID = new UUID(target); |
892 | 874 | ||
893 | ForceSit(avatar, targetID); | 875 | ForceSit(avatar, targetID); |
894 | } | 876 | } |
895 | 877 | ||
896 | public void ForceSit(string avatar, UUID targetID) | 878 | public void ForceSit(string avatar, UUID targetID) |
@@ -920,9 +902,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
920 | //resources based on the IP address of the clients connected. | 902 | //resources based on the IP address of the clients connected. |
921 | //I think High is a good risk level for this, as it is an | 903 | //I think High is a good risk level for this, as it is an |
922 | //information leak. | 904 | //information leak. |
905 | // Severe is even better coz privacy is important. | ||
923 | public string osGetAgentIP(string agent) | 906 | public string osGetAgentIP(string agent) |
924 | { | 907 | { |
925 | CheckThreatLevel(ThreatLevel.High, "osGetAgentIP"); | 908 | CheckThreatLevel(ThreatLevel.Severe, "osGetAgentIP"); |
926 | 909 | ||
927 | UUID avatarID = (UUID)agent; | 910 | UUID avatarID = (UUID)agent; |
928 | 911 | ||
@@ -932,7 +915,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
932 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; | 915 | ScenePresence target = (ScenePresence)World.Entities[avatarID]; |
933 | return target.ControllingClient.RemoteEndPoint.Address.ToString(); | 916 | return target.ControllingClient.RemoteEndPoint.Address.ToString(); |
934 | } | 917 | } |
935 | 918 | ||
936 | // fall through case, just return nothing | 919 | // fall through case, just return nothing |
937 | return ""; | 920 | return ""; |
938 | } | 921 | } |
@@ -940,9 +923,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
940 | // Get a list of all the avatars/agents in the region | 923 | // Get a list of all the avatars/agents in the region |
941 | public LSL_List osGetAgents() | 924 | public LSL_List osGetAgents() |
942 | { | 925 | { |
943 | // threat level is None as we could get this information with an | ||
944 | // in-world script as well, just not as efficient | ||
945 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); | ||
946 | m_host.AddScriptLPS(1); | 926 | m_host.AddScriptLPS(1); |
947 | 927 | ||
948 | LSL_List result = new LSL_List(); | 928 | LSL_List result = new LSL_List(); |
@@ -1024,7 +1004,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1024 | else | 1004 | else |
1025 | animID = UUID.Zero; | 1005 | animID = UUID.Zero; |
1026 | } | 1006 | } |
1027 | 1007 | ||
1028 | if (animID == UUID.Zero) | 1008 | if (animID == UUID.Zero) |
1029 | target.Animator.RemoveAnimation(animation); | 1009 | target.Animator.RemoveAnimation(animation); |
1030 | else | 1010 | else |
@@ -1036,8 +1016,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1036 | //Texture draw functions | 1016 | //Texture draw functions |
1037 | public string osMovePen(string drawList, int x, int y) | 1017 | public string osMovePen(string drawList, int x, int y) |
1038 | { | 1018 | { |
1039 | CheckThreatLevel(ThreatLevel.None, "osMovePen"); | ||
1040 | |||
1041 | m_host.AddScriptLPS(1); | 1019 | m_host.AddScriptLPS(1); |
1042 | drawList += "MoveTo " + x + "," + y + ";"; | 1020 | drawList += "MoveTo " + x + "," + y + ";"; |
1043 | return drawList; | 1021 | return drawList; |
@@ -1045,8 +1023,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1045 | 1023 | ||
1046 | public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) | 1024 | public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) |
1047 | { | 1025 | { |
1048 | CheckThreatLevel(ThreatLevel.None, "osDrawLine"); | ||
1049 | |||
1050 | m_host.AddScriptLPS(1); | 1026 | m_host.AddScriptLPS(1); |
1051 | drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; | 1027 | drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; |
1052 | return drawList; | 1028 | return drawList; |
@@ -1054,8 +1030,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1054 | 1030 | ||
1055 | public string osDrawLine(string drawList, int endX, int endY) | 1031 | public string osDrawLine(string drawList, int endX, int endY) |
1056 | { | 1032 | { |
1057 | CheckThreatLevel(ThreatLevel.None, "osDrawLine"); | ||
1058 | |||
1059 | m_host.AddScriptLPS(1); | 1033 | m_host.AddScriptLPS(1); |
1060 | drawList += "LineTo " + endX + "," + endY + "; "; | 1034 | drawList += "LineTo " + endX + "," + endY + "; "; |
1061 | return drawList; | 1035 | return drawList; |
@@ -1063,8 +1037,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1063 | 1037 | ||
1064 | public string osDrawText(string drawList, string text) | 1038 | public string osDrawText(string drawList, string text) |
1065 | { | 1039 | { |
1066 | CheckThreatLevel(ThreatLevel.None, "osDrawText"); | ||
1067 | |||
1068 | m_host.AddScriptLPS(1); | 1040 | m_host.AddScriptLPS(1); |
1069 | drawList += "Text " + text + "; "; | 1041 | drawList += "Text " + text + "; "; |
1070 | return drawList; | 1042 | return drawList; |
@@ -1072,8 +1044,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1072 | 1044 | ||
1073 | public string osDrawEllipse(string drawList, int width, int height) | 1045 | public string osDrawEllipse(string drawList, int width, int height) |
1074 | { | 1046 | { |
1075 | CheckThreatLevel(ThreatLevel.None, "osDrawEllipse"); | ||
1076 | |||
1077 | m_host.AddScriptLPS(1); | 1047 | m_host.AddScriptLPS(1); |
1078 | drawList += "Ellipse " + width + "," + height + "; "; | 1048 | drawList += "Ellipse " + width + "," + height + "; "; |
1079 | return drawList; | 1049 | return drawList; |
@@ -1081,8 +1051,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1081 | 1051 | ||
1082 | public string osDrawRectangle(string drawList, int width, int height) | 1052 | public string osDrawRectangle(string drawList, int width, int height) |
1083 | { | 1053 | { |
1084 | CheckThreatLevel(ThreatLevel.None, "osDrawRectangle"); | ||
1085 | |||
1086 | m_host.AddScriptLPS(1); | 1054 | m_host.AddScriptLPS(1); |
1087 | drawList += "Rectangle " + width + "," + height + "; "; | 1055 | drawList += "Rectangle " + width + "," + height + "; "; |
1088 | return drawList; | 1056 | return drawList; |
@@ -1090,8 +1058,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1090 | 1058 | ||
1091 | public string osDrawFilledRectangle(string drawList, int width, int height) | 1059 | public string osDrawFilledRectangle(string drawList, int width, int height) |
1092 | { | 1060 | { |
1093 | CheckThreatLevel(ThreatLevel.None, "osDrawFilledRectangle"); | ||
1094 | |||
1095 | m_host.AddScriptLPS(1); | 1061 | m_host.AddScriptLPS(1); |
1096 | drawList += "FillRectangle " + width + "," + height + "; "; | 1062 | drawList += "FillRectangle " + width + "," + height + "; "; |
1097 | return drawList; | 1063 | return drawList; |
@@ -1099,8 +1065,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1099 | 1065 | ||
1100 | public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) | 1066 | public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) |
1101 | { | 1067 | { |
1102 | CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); | ||
1103 | |||
1104 | m_host.AddScriptLPS(1); | 1068 | m_host.AddScriptLPS(1); |
1105 | 1069 | ||
1106 | if (x.Length != y.Length || x.Length < 3) | 1070 | if (x.Length != y.Length || x.Length < 3) |
@@ -1118,8 +1082,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1118 | 1082 | ||
1119 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) | 1083 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) |
1120 | { | 1084 | { |
1121 | CheckThreatLevel(ThreatLevel.None, "osDrawPolygon"); | ||
1122 | |||
1123 | m_host.AddScriptLPS(1); | 1085 | m_host.AddScriptLPS(1); |
1124 | 1086 | ||
1125 | if (x.Length != y.Length || x.Length < 3) | 1087 | if (x.Length != y.Length || x.Length < 3) |
@@ -1137,8 +1099,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1137 | 1099 | ||
1138 | public string osSetFontSize(string drawList, int fontSize) | 1100 | public string osSetFontSize(string drawList, int fontSize) |
1139 | { | 1101 | { |
1140 | CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); | ||
1141 | |||
1142 | m_host.AddScriptLPS(1); | 1102 | m_host.AddScriptLPS(1); |
1143 | drawList += "FontSize "+ fontSize +"; "; | 1103 | drawList += "FontSize "+ fontSize +"; "; |
1144 | return drawList; | 1104 | return drawList; |
@@ -1146,8 +1106,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1146 | 1106 | ||
1147 | public string osSetFontName(string drawList, string fontName) | 1107 | public string osSetFontName(string drawList, string fontName) |
1148 | { | 1108 | { |
1149 | CheckThreatLevel(ThreatLevel.None, "osSetFontName"); | ||
1150 | |||
1151 | m_host.AddScriptLPS(1); | 1109 | m_host.AddScriptLPS(1); |
1152 | drawList += "FontName "+ fontName +"; "; | 1110 | drawList += "FontName "+ fontName +"; "; |
1153 | return drawList; | 1111 | return drawList; |
@@ -1155,8 +1113,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1155 | 1113 | ||
1156 | public string osSetPenSize(string drawList, int penSize) | 1114 | public string osSetPenSize(string drawList, int penSize) |
1157 | { | 1115 | { |
1158 | CheckThreatLevel(ThreatLevel.None, "osSetPenSize"); | ||
1159 | |||
1160 | m_host.AddScriptLPS(1); | 1116 | m_host.AddScriptLPS(1); |
1161 | drawList += "PenSize " + penSize + "; "; | 1117 | drawList += "PenSize " + penSize + "; "; |
1162 | return drawList; | 1118 | return drawList; |
@@ -1164,8 +1120,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1164 | 1120 | ||
1165 | public string osSetPenColor(string drawList, string color) | 1121 | public string osSetPenColor(string drawList, string color) |
1166 | { | 1122 | { |
1167 | CheckThreatLevel(ThreatLevel.None, "osSetPenColor"); | ||
1168 | |||
1169 | m_host.AddScriptLPS(1); | 1123 | m_host.AddScriptLPS(1); |
1170 | drawList += "PenColor " + color + "; "; | 1124 | drawList += "PenColor " + color + "; "; |
1171 | return drawList; | 1125 | return drawList; |
@@ -1174,7 +1128,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1174 | // Deprecated | 1128 | // Deprecated |
1175 | public string osSetPenColour(string drawList, string colour) | 1129 | public string osSetPenColour(string drawList, string colour) |
1176 | { | 1130 | { |
1177 | CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); | ||
1178 | OSSLDeprecated("osSetPenColour", "osSetPenColor"); | 1131 | OSSLDeprecated("osSetPenColour", "osSetPenColor"); |
1179 | 1132 | ||
1180 | m_host.AddScriptLPS(1); | 1133 | m_host.AddScriptLPS(1); |
@@ -1184,8 +1137,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1184 | 1137 | ||
1185 | public string osSetPenCap(string drawList, string direction, string type) | 1138 | public string osSetPenCap(string drawList, string direction, string type) |
1186 | { | 1139 | { |
1187 | CheckThreatLevel(ThreatLevel.None, "osSetPenCap"); | ||
1188 | |||
1189 | m_host.AddScriptLPS(1); | 1140 | m_host.AddScriptLPS(1); |
1190 | drawList += "PenCap " + direction + "," + type + "; "; | 1141 | drawList += "PenCap " + direction + "," + type + "; "; |
1191 | return drawList; | 1142 | return drawList; |
@@ -1193,8 +1144,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1193 | 1144 | ||
1194 | public string osDrawImage(string drawList, int width, int height, string imageUrl) | 1145 | public string osDrawImage(string drawList, int width, int height, string imageUrl) |
1195 | { | 1146 | { |
1196 | CheckThreatLevel(ThreatLevel.None, "osDrawImage"); | ||
1197 | |||
1198 | m_host.AddScriptLPS(1); | 1147 | m_host.AddScriptLPS(1); |
1199 | drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; | 1148 | drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; |
1200 | return drawList; | 1149 | return drawList; |
@@ -1202,7 +1151,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1202 | 1151 | ||
1203 | public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) | 1152 | public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) |
1204 | { | 1153 | { |
1205 | CheckThreatLevel(ThreatLevel.VeryLow, "osGetDrawStringSize"); | ||
1206 | m_host.AddScriptLPS(1); | 1154 | m_host.AddScriptLPS(1); |
1207 | 1155 | ||
1208 | LSL_Vector vec = new LSL_Vector(0,0,0); | 1156 | LSL_Vector vec = new LSL_Vector(0,0,0); |
@@ -1297,8 +1245,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1297 | /// <returns></returns> | 1245 | /// <returns></returns> |
1298 | public double osGetCurrentSunHour() | 1246 | public double osGetCurrentSunHour() |
1299 | { | 1247 | { |
1300 | CheckThreatLevel(ThreatLevel.None, "osGetCurrentSunHour"); | ||
1301 | |||
1302 | m_host.AddScriptLPS(1); | 1248 | m_host.AddScriptLPS(1); |
1303 | 1249 | ||
1304 | // Must adjust for the fact that Region Sun Settings are still LL offset | 1250 | // Must adjust for the fact that Region Sun Settings are still LL offset |
@@ -1316,14 +1262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1316 | 1262 | ||
1317 | public double osSunGetParam(string param) | 1263 | public double osSunGetParam(string param) |
1318 | { | 1264 | { |
1319 | CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); | ||
1320 | OSSLDeprecated("osSunGetParam", "osGetSunParam"); | 1265 | OSSLDeprecated("osSunGetParam", "osGetSunParam"); |
1321 | return GetSunParam(param); | 1266 | return GetSunParam(param); |
1322 | } | 1267 | } |
1323 | 1268 | ||
1324 | public double osGetSunParam(string param) | 1269 | public double osGetSunParam(string param) |
1325 | { | 1270 | { |
1326 | CheckThreatLevel(ThreatLevel.None, "osGetSunParam"); | ||
1327 | return GetSunParam(param); | 1271 | return GetSunParam(param); |
1328 | } | 1272 | } |
1329 | 1273 | ||
@@ -1344,14 +1288,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1344 | 1288 | ||
1345 | public void osSunSetParam(string param, double value) | 1289 | public void osSunSetParam(string param, double value) |
1346 | { | 1290 | { |
1347 | CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); | 1291 | //// CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); |
1348 | OSSLDeprecated("osSunSetParam", "osSetSunParam"); | 1292 | OSSLDeprecated("osSunSetParam", "osSetSunParam"); |
1349 | SetSunParam(param, value); | 1293 | SetSunParam(param, value); |
1350 | } | 1294 | } |
1351 | 1295 | ||
1352 | public void osSetSunParam(string param, double value) | 1296 | public void osSetSunParam(string param, double value) |
1353 | { | 1297 | { |
1354 | CheckThreatLevel(ThreatLevel.None, "osSetSunParam"); | 1298 | //// CheckThreatLevel(ThreatLevel.None, "osSetSunParam"); |
1355 | SetSunParam(param, value); | 1299 | SetSunParam(param, value); |
1356 | } | 1300 | } |
1357 | 1301 | ||
@@ -1368,7 +1312,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1368 | 1312 | ||
1369 | public string osWindActiveModelPluginName() | 1313 | public string osWindActiveModelPluginName() |
1370 | { | 1314 | { |
1371 | CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName"); | ||
1372 | m_host.AddScriptLPS(1); | 1315 | m_host.AddScriptLPS(1); |
1373 | 1316 | ||
1374 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | 1317 | IWindModule module = World.RequestModuleInterface<IWindModule>(); |
@@ -1398,7 +1341,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1398 | 1341 | ||
1399 | public LSL_Float osGetWindParam(string plugin, string param) | 1342 | public LSL_Float osGetWindParam(string plugin, string param) |
1400 | { | 1343 | { |
1401 | CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); | ||
1402 | m_host.AddScriptLPS(1); | 1344 | m_host.AddScriptLPS(1); |
1403 | 1345 | ||
1404 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | 1346 | IWindModule module = World.RequestModuleInterface<IWindModule>(); |
@@ -1522,8 +1464,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1522 | // is not allowed to contain any. | 1464 | // is not allowed to contain any. |
1523 | // This really should be removed. | 1465 | // This really should be removed. |
1524 | // | 1466 | // |
1525 | CheckThreatLevel(ThreatLevel.None, "osList2Double"); | ||
1526 | |||
1527 | m_host.AddScriptLPS(1); | 1467 | m_host.AddScriptLPS(1); |
1528 | if (index < 0) | 1468 | if (index < 0) |
1529 | { | 1469 | { |
@@ -1584,8 +1524,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1584 | // that trigger engine-specific failures. | 1524 | // that trigger engine-specific failures. |
1585 | // Besides, public grid users aren't supposed to know. | 1525 | // Besides, public grid users aren't supposed to know. |
1586 | // | 1526 | // |
1587 | CheckThreatLevel(ThreatLevel.High, "osGetScriptEngineName"); | 1527 | // On the other hand, what other script engines are there? |
1588 | 1528 | // | |
1589 | m_host.AddScriptLPS(1); | 1529 | m_host.AddScriptLPS(1); |
1590 | 1530 | ||
1591 | int scriptEngineNameIndex = 0; | 1531 | int scriptEngineNameIndex = 0; |
@@ -1637,15 +1577,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1637 | // throwing an exception. | 1577 | // throwing an exception. |
1638 | m_host.AddScriptLPS(1); | 1578 | m_host.AddScriptLPS(1); |
1639 | string ret = String.Empty; | 1579 | string ret = String.Empty; |
1640 | if (String.IsNullOrEmpty(CheckThreatLevelTest(ThreatLevel.High, "osGetPhysicsEngineType"))) | 1580 | if (m_ScriptEngine.World.PhysicsScene != null) |
1641 | { | 1581 | { |
1642 | if (m_ScriptEngine.World.PhysicsScene != null) | 1582 | ret = m_ScriptEngine.World.PhysicsScene.EngineType; |
1643 | { | 1583 | // An old physics engine might have an uninitialized engine type |
1644 | ret = m_ScriptEngine.World.PhysicsScene.EngineType; | 1584 | if (ret == null) |
1645 | // An old physics engine might have an uninitialized engine type | 1585 | ret = "unknown"; |
1646 | if (ret == null) | ||
1647 | ret = "unknown"; | ||
1648 | } | ||
1649 | } | 1586 | } |
1650 | 1587 | ||
1651 | return ret; | 1588 | return ret; |
@@ -1653,12 +1590,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1653 | 1590 | ||
1654 | public string osGetSimulatorVersion() | 1591 | public string osGetSimulatorVersion() |
1655 | { | 1592 | { |
1656 | // High because it can be used to target attacks to known weaknesses | ||
1657 | // This would allow a new class of griefer scripts that don't even | ||
1658 | // require their user to know what they are doing (see script | ||
1659 | // kiddie) | ||
1660 | // | ||
1661 | CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion"); | ||
1662 | m_host.AddScriptLPS(1); | 1593 | m_host.AddScriptLPS(1); |
1663 | 1594 | ||
1664 | return m_ScriptEngine.World.GetSimulatorVersion(); | 1595 | return m_ScriptEngine.World.GetSimulatorVersion(); |
@@ -1703,8 +1634,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1703 | 1634 | ||
1704 | public Object osParseJSONNew(string JSON) | 1635 | public Object osParseJSONNew(string JSON) |
1705 | { | 1636 | { |
1706 | CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); | ||
1707 | |||
1708 | m_host.AddScriptLPS(1); | 1637 | m_host.AddScriptLPS(1); |
1709 | 1638 | ||
1710 | try | 1639 | try |
@@ -1721,8 +1650,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1721 | 1650 | ||
1722 | public Hashtable osParseJSON(string JSON) | 1651 | public Hashtable osParseJSON(string JSON) |
1723 | { | 1652 | { |
1724 | CheckThreatLevel(ThreatLevel.None, "osParseJSON"); | ||
1725 | |||
1726 | m_host.AddScriptLPS(1); | 1653 | m_host.AddScriptLPS(1); |
1727 | 1654 | ||
1728 | Object decoded = osParseJSONNew(JSON); | 1655 | Object decoded = osParseJSONNew(JSON); |
@@ -1754,7 +1681,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1754 | /// <param name="message"></param> | 1681 | /// <param name="message"></param> |
1755 | public void osMessageObject(LSL_Key objectUUID, string message) | 1682 | public void osMessageObject(LSL_Key objectUUID, string message) |
1756 | { | 1683 | { |
1757 | CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); | ||
1758 | m_host.AddScriptLPS(1); | 1684 | m_host.AddScriptLPS(1); |
1759 | 1685 | ||
1760 | UUID objUUID; | 1686 | UUID objUUID; |
@@ -1796,7 +1722,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1796 | /// <param name="contents">The contents of the notecard.</param> | 1722 | /// <param name="contents">The contents of the notecard.</param> |
1797 | public void osMakeNotecard(string notecardName, LSL_Types.list contents) | 1723 | public void osMakeNotecard(string notecardName, LSL_Types.list contents) |
1798 | { | 1724 | { |
1799 | CheckThreatLevel(ThreatLevel.High, "osMakeNotecard"); | ||
1800 | m_host.AddScriptLPS(1); | 1725 | m_host.AddScriptLPS(1); |
1801 | 1726 | ||
1802 | StringBuilder notecardData = new StringBuilder(); | 1727 | StringBuilder notecardData = new StringBuilder(); |
@@ -1885,16 +1810,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1885 | if (assetID != UUID.Zero) | 1810 | if (assetID != UUID.Zero) |
1886 | { | 1811 | { |
1887 | StringBuilder notecardData = new StringBuilder(); | 1812 | StringBuilder notecardData = new StringBuilder(); |
1888 | 1813 | ||
1889 | for (int count = 0; count < NotecardCache.GetLines(assetID); count++) | 1814 | for (int count = 0; count < NotecardCache.GetLines(assetID); count++) |
1890 | { | 1815 | { |
1891 | string line = NotecardCache.GetLine(assetID, count) + "\n"; | 1816 | string line = NotecardCache.GetLine(assetID, count) + "\n"; |
1892 | 1817 | ||
1893 | // m_log.DebugFormat("[OSSL]: From notecard {0} loading line {1}", notecardNameOrUuid, line); | 1818 | // m_log.DebugFormat("[OSSL]: From notecard {0} loading line {1}", notecardNameOrUuid, line); |
1894 | 1819 | ||
1895 | notecardData.Append(line); | 1820 | notecardData.Append(line); |
1896 | } | 1821 | } |
1897 | 1822 | ||
1898 | return notecardData.ToString(); | 1823 | return notecardData.ToString(); |
1899 | } | 1824 | } |
1900 | 1825 | ||
@@ -1955,7 +1880,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1955 | /// <returns>Notecard line</returns> | 1880 | /// <returns>Notecard line</returns> |
1956 | public string osGetNotecardLine(string name, int line) | 1881 | public string osGetNotecardLine(string name, int line) |
1957 | { | 1882 | { |
1958 | CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine"); | ||
1959 | m_host.AddScriptLPS(1); | 1883 | m_host.AddScriptLPS(1); |
1960 | 1884 | ||
1961 | UUID assetID = CacheNotecard(name); | 1885 | UUID assetID = CacheNotecard(name); |
@@ -1983,7 +1907,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1983 | /// <returns>Notecard text</returns> | 1907 | /// <returns>Notecard text</returns> |
1984 | public string osGetNotecard(string name) | 1908 | public string osGetNotecard(string name) |
1985 | { | 1909 | { |
1986 | CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard"); | ||
1987 | m_host.AddScriptLPS(1); | 1910 | m_host.AddScriptLPS(1); |
1988 | 1911 | ||
1989 | string text = LoadNotecard(name); | 1912 | string text = LoadNotecard(name); |
@@ -2013,7 +1936,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2013 | /// <returns></returns> | 1936 | /// <returns></returns> |
2014 | public int osGetNumberOfNotecardLines(string name) | 1937 | public int osGetNumberOfNotecardLines(string name) |
2015 | { | 1938 | { |
2016 | CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines"); | ||
2017 | m_host.AddScriptLPS(1); | 1939 | m_host.AddScriptLPS(1); |
2018 | 1940 | ||
2019 | UUID assetID = CacheNotecard(name); | 1941 | UUID assetID = CacheNotecard(name); |
@@ -2081,7 +2003,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2081 | 2003 | ||
2082 | public string osKey2Name(string id) | 2004 | public string osKey2Name(string id) |
2083 | { | 2005 | { |
2084 | CheckThreatLevel(ThreatLevel.Low, "osKey2Name"); | ||
2085 | m_host.AddScriptLPS(1); | 2006 | m_host.AddScriptLPS(1); |
2086 | 2007 | ||
2087 | UUID key = new UUID(); | 2008 | UUID key = new UUID(); |
@@ -2108,7 +2029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2108 | } | 2029 | } |
2109 | } | 2030 | } |
2110 | } | 2031 | } |
2111 | 2032 | ||
2112 | return ""; | 2033 | return ""; |
2113 | } | 2034 | } |
2114 | 2035 | ||
@@ -2191,7 +2112,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2191 | /// <returns></returns> | 2112 | /// <returns></returns> |
2192 | public string osGetGridNick() | 2113 | public string osGetGridNick() |
2193 | { | 2114 | { |
2194 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick"); | 2115 | //// CheckThreatLevel(ThreatLevel.None, "osGetGridNick"); |
2195 | m_host.AddScriptLPS(1); | 2116 | m_host.AddScriptLPS(1); |
2196 | 2117 | ||
2197 | string nick = String.Empty; | 2118 | string nick = String.Empty; |
@@ -2208,7 +2129,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2208 | 2129 | ||
2209 | public string osGetGridName() | 2130 | public string osGetGridName() |
2210 | { | 2131 | { |
2211 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName"); | 2132 | //// CheckThreatLevel(ThreatLevel.None, "osGetGridName"); |
2212 | m_host.AddScriptLPS(1); | 2133 | m_host.AddScriptLPS(1); |
2213 | 2134 | ||
2214 | string name = String.Empty; | 2135 | string name = String.Empty; |
@@ -2300,7 +2221,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2300 | 2221 | ||
2301 | public string osGetAvatarHomeURI(string uuid) | 2222 | public string osGetAvatarHomeURI(string uuid) |
2302 | { | 2223 | { |
2303 | CheckThreatLevel(ThreatLevel.Low, "osGetAvatarHomeURI"); | 2224 | CheckThreatLevel(ThreatLevel.Moderate, "osGetAvatarHomeURI"); |
2304 | m_host.AddScriptLPS(1); | 2225 | m_host.AddScriptLPS(1); |
2305 | 2226 | ||
2306 | IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>(); | 2227 | IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>(); |
@@ -2333,7 +2254,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2333 | 2254 | ||
2334 | public LSL_String osFormatString(string str, LSL_List strings) | 2255 | public LSL_String osFormatString(string str, LSL_List strings) |
2335 | { | 2256 | { |
2336 | CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString"); | ||
2337 | m_host.AddScriptLPS(1); | 2257 | m_host.AddScriptLPS(1); |
2338 | 2258 | ||
2339 | return String.Format(str, strings.Data); | 2259 | return String.Format(str, strings.Data); |
@@ -2341,7 +2261,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2341 | 2261 | ||
2342 | public LSL_List osMatchString(string src, string pattern, int start) | 2262 | public LSL_List osMatchString(string src, string pattern, int start) |
2343 | { | 2263 | { |
2344 | CheckThreatLevel(ThreatLevel.VeryLow, "osMatchString"); | ||
2345 | m_host.AddScriptLPS(1); | 2264 | m_host.AddScriptLPS(1); |
2346 | 2265 | ||
2347 | LSL_List result = new LSL_List(); | 2266 | LSL_List result = new LSL_List(); |
@@ -2383,7 +2302,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2383 | 2302 | ||
2384 | public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) | 2303 | public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) |
2385 | { | 2304 | { |
2386 | CheckThreatLevel(ThreatLevel.VeryLow, "osReplaceString"); | ||
2387 | m_host.AddScriptLPS(1); | 2305 | m_host.AddScriptLPS(1); |
2388 | 2306 | ||
2389 | // Normalize indices (if negative). | 2307 | // Normalize indices (if negative). |
@@ -2503,7 +2421,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2503 | 2421 | ||
2504 | public LSL_Integer osIsNpc(LSL_Key npc) | 2422 | public LSL_Integer osIsNpc(LSL_Key npc) |
2505 | { | 2423 | { |
2506 | CheckThreatLevel(ThreatLevel.None, "osIsNpc"); | ||
2507 | m_host.AddScriptLPS(1); | 2424 | m_host.AddScriptLPS(1); |
2508 | 2425 | ||
2509 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2426 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
@@ -2648,7 +2565,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2648 | 2565 | ||
2649 | public LSL_Key osNpcGetOwner(LSL_Key npc) | 2566 | public LSL_Key osNpcGetOwner(LSL_Key npc) |
2650 | { | 2567 | { |
2651 | CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner"); | ||
2652 | m_host.AddScriptLPS(1); | 2568 | m_host.AddScriptLPS(1); |
2653 | 2569 | ||
2654 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2570 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2670,7 +2586,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2670 | 2586 | ||
2671 | public LSL_Vector osNpcGetPos(LSL_Key npc) | 2587 | public LSL_Vector osNpcGetPos(LSL_Key npc) |
2672 | { | 2588 | { |
2673 | CheckThreatLevel(ThreatLevel.High, "osNpcGetPos"); | ||
2674 | m_host.AddScriptLPS(1); | 2589 | m_host.AddScriptLPS(1); |
2675 | 2590 | ||
2676 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2591 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2706,7 +2621,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2706 | 2621 | ||
2707 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | 2622 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) |
2708 | return; | 2623 | return; |
2709 | 2624 | ||
2710 | module.MoveToTarget(npcId, World, pos, false, true, false); | 2625 | module.MoveToTarget(npcId, World, pos, false, true, false); |
2711 | } | 2626 | } |
2712 | } | 2627 | } |
@@ -2738,7 +2653,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2738 | 2653 | ||
2739 | public LSL_Rotation osNpcGetRot(LSL_Key npc) | 2654 | public LSL_Rotation osNpcGetRot(LSL_Key npc) |
2740 | { | 2655 | { |
2741 | CheckThreatLevel(ThreatLevel.High, "osNpcGetRot"); | ||
2742 | m_host.AddScriptLPS(1); | 2656 | m_host.AddScriptLPS(1); |
2743 | 2657 | ||
2744 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | 2658 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); |
@@ -2940,7 +2854,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2940 | { | 2854 | { |
2941 | CheckThreatLevel(ThreatLevel.High, "osNpcTouch"); | 2855 | CheckThreatLevel(ThreatLevel.High, "osNpcTouch"); |
2942 | m_host.AddScriptLPS(1); | 2856 | m_host.AddScriptLPS(1); |
2943 | 2857 | ||
2944 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2858 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
2945 | int linkNum = link_num.value; | 2859 | int linkNum = link_num.value; |
2946 | if (module != null || (linkNum < 0 && linkNum != ScriptBaseClass.LINK_THIS)) | 2860 | if (module != null || (linkNum < 0 && linkNum != ScriptBaseClass.LINK_THIS)) |
@@ -2983,7 +2897,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2983 | /// <returns>The asset ID of the notecard saved.</returns> | 2897 | /// <returns>The asset ID of the notecard saved.</returns> |
2984 | public LSL_Key osOwnerSaveAppearance(string notecard) | 2898 | public LSL_Key osOwnerSaveAppearance(string notecard) |
2985 | { | 2899 | { |
2986 | CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); | 2900 | CheckThreatLevel(ThreatLevel.Moderate, "osOwnerSaveAppearance"); |
2987 | m_host.AddScriptLPS(1); | 2901 | m_host.AddScriptLPS(1); |
2988 | 2902 | ||
2989 | return SaveAppearanceToNotecard(m_host.OwnerID, notecard); | 2903 | return SaveAppearanceToNotecard(m_host.OwnerID, notecard); |
@@ -2991,7 +2905,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2991 | 2905 | ||
2992 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) | 2906 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) |
2993 | { | 2907 | { |
2994 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); | 2908 | CheckThreatLevel(ThreatLevel.High, "osAgentSaveAppearance"); |
2995 | m_host.AddScriptLPS(1); | 2909 | m_host.AddScriptLPS(1); |
2996 | 2910 | ||
2997 | return SaveAppearanceToNotecard(avatarId, notecard); | 2911 | return SaveAppearanceToNotecard(avatarId, notecard); |
@@ -3043,7 +2957,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3043 | /// <returns>"male" or "female" or "unknown"</returns> | 2957 | /// <returns>"male" or "female" or "unknown"</returns> |
3044 | public LSL_String osGetGender(LSL_Key rawAvatarId) | 2958 | public LSL_String osGetGender(LSL_Key rawAvatarId) |
3045 | { | 2959 | { |
3046 | CheckThreatLevel(ThreatLevel.None, "osGetGender"); | ||
3047 | m_host.AddScriptLPS(1); | 2960 | m_host.AddScriptLPS(1); |
3048 | 2961 | ||
3049 | UUID avatarId; | 2962 | UUID avatarId; |
@@ -3087,7 +3000,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3087 | /// <returns></returns> | 3000 | /// <returns></returns> |
3088 | public LSL_Key osGetMapTexture() | 3001 | public LSL_Key osGetMapTexture() |
3089 | { | 3002 | { |
3090 | CheckThreatLevel(ThreatLevel.None, "osGetMapTexture"); | ||
3091 | m_host.AddScriptLPS(1); | 3003 | m_host.AddScriptLPS(1); |
3092 | 3004 | ||
3093 | return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); | 3005 | return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); |
@@ -3100,7 +3012,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3100 | /// <returns></returns> | 3012 | /// <returns></returns> |
3101 | public LSL_Key osGetRegionMapTexture(string regionName) | 3013 | public LSL_Key osGetRegionMapTexture(string regionName) |
3102 | { | 3014 | { |
3103 | CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture"); | ||
3104 | m_host.AddScriptLPS(1); | 3015 | m_host.AddScriptLPS(1); |
3105 | 3016 | ||
3106 | Scene scene = m_ScriptEngine.World; | 3017 | Scene scene = m_ScriptEngine.World; |
@@ -3129,7 +3040,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3129 | /// <returns>List of floats</returns> | 3040 | /// <returns>List of floats</returns> |
3130 | public LSL_List osGetRegionStats() | 3041 | public LSL_List osGetRegionStats() |
3131 | { | 3042 | { |
3132 | CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); | ||
3133 | m_host.AddScriptLPS(1); | 3043 | m_host.AddScriptLPS(1); |
3134 | LSL_List ret = new LSL_List(); | 3044 | LSL_List ret = new LSL_List(); |
3135 | float[] stats = World.StatsReporter.LastReportedSimStats; | 3045 | float[] stats = World.StatsReporter.LastReportedSimStats; |
@@ -3143,7 +3053,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3143 | 3053 | ||
3144 | public LSL_Vector osGetRegionSize() | 3054 | public LSL_Vector osGetRegionSize() |
3145 | { | 3055 | { |
3146 | CheckThreatLevel(ThreatLevel.None, "osGetRegionSize"); | ||
3147 | m_host.AddScriptLPS(1); | 3056 | m_host.AddScriptLPS(1); |
3148 | 3057 | ||
3149 | bool isMegaregion; | 3058 | bool isMegaregion; |
@@ -3211,7 +3120,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3211 | 3120 | ||
3212 | public LSL_Float osGetHealth(string avatar) | 3121 | public LSL_Float osGetHealth(string avatar) |
3213 | { | 3122 | { |
3214 | CheckThreatLevel(ThreatLevel.None, "osGetHealth"); | ||
3215 | m_host.AddScriptLPS(1); | 3123 | m_host.AddScriptLPS(1); |
3216 | 3124 | ||
3217 | LSL_Float health = new LSL_Float(-1); | 3125 | LSL_Float health = new LSL_Float(-1); |
@@ -3273,7 +3181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3273 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); | 3181 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); |
3274 | m_host.AddScriptLPS(1); | 3182 | m_host.AddScriptLPS(1); |
3275 | InitLSL(); | 3183 | InitLSL(); |
3276 | 3184 | ||
3277 | return m_LSL_Api.GetPrimitiveParamsEx(prim, rules); | 3185 | return m_LSL_Api.GetPrimitiveParamsEx(prim, rules); |
3278 | } | 3186 | } |
3279 | 3187 | ||
@@ -3282,10 +3190,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3282 | CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); | 3190 | CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); |
3283 | m_host.AddScriptLPS(1); | 3191 | m_host.AddScriptLPS(1); |
3284 | InitLSL(); | 3192 | InitLSL(); |
3285 | 3193 | ||
3286 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); | 3194 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); |
3287 | } | 3195 | } |
3288 | 3196 | ||
3289 | /// <summary> | 3197 | /// <summary> |
3290 | /// Set parameters for light projection in host prim | 3198 | /// Set parameters for light projection in host prim |
3291 | /// </summary> | 3199 | /// </summary> |
@@ -3332,7 +3240,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3332 | /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns> | 3240 | /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns> |
3333 | public LSL_List osGetAvatarList() | 3241 | public LSL_List osGetAvatarList() |
3334 | { | 3242 | { |
3335 | CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); | ||
3336 | m_host.AddScriptLPS(1); | 3243 | m_host.AddScriptLPS(1); |
3337 | 3244 | ||
3338 | LSL_List result = new LSL_List(); | 3245 | LSL_List result = new LSL_List(); |
@@ -3356,7 +3263,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3356 | /// <returns></returns> | 3263 | /// <returns></returns> |
3357 | public LSL_String osUnixTimeToTimestamp(long time) | 3264 | public LSL_String osUnixTimeToTimestamp(long time) |
3358 | { | 3265 | { |
3359 | CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); | ||
3360 | m_host.AddScriptLPS(1); | 3266 | m_host.AddScriptLPS(1); |
3361 | 3267 | ||
3362 | long baseTicks = 621355968000000000; | 3268 | long baseTicks = 621355968000000000; |
@@ -3537,7 +3443,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3537 | 3443 | ||
3538 | public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint) | 3444 | public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint) |
3539 | { | 3445 | { |
3540 | CheckThreatLevel(ThreatLevel.VeryHigh, "osForceAttachToOtherAvatarFromInventory"); | 3446 | CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory"); |
3541 | 3447 | ||
3542 | m_host.AddScriptLPS(1); | 3448 | m_host.AddScriptLPS(1); |
3543 | 3449 | ||
@@ -3782,7 +3688,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3782 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> | 3688 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> |
3783 | public LSL_Integer osIsUUID(string thing) | 3689 | public LSL_Integer osIsUUID(string thing) |
3784 | { | 3690 | { |
3785 | CheckThreatLevel(ThreatLevel.None, "osIsUUID"); | ||
3786 | m_host.AddScriptLPS(1); | 3691 | m_host.AddScriptLPS(1); |
3787 | 3692 | ||
3788 | UUID test; | 3693 | UUID test; |
@@ -3797,7 +3702,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3797 | /// <returns></returns> | 3702 | /// <returns></returns> |
3798 | public LSL_Float osMin(double a, double b) | 3703 | public LSL_Float osMin(double a, double b) |
3799 | { | 3704 | { |
3800 | CheckThreatLevel(ThreatLevel.None, "osMin"); | ||
3801 | m_host.AddScriptLPS(1); | 3705 | m_host.AddScriptLPS(1); |
3802 | 3706 | ||
3803 | return Math.Min(a, b); | 3707 | return Math.Min(a, b); |
@@ -3811,7 +3715,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3811 | /// <returns></returns> | 3715 | /// <returns></returns> |
3812 | public LSL_Float osMax(double a, double b) | 3716 | public LSL_Float osMax(double a, double b) |
3813 | { | 3717 | { |
3814 | CheckThreatLevel(ThreatLevel.None, "osMax"); | ||
3815 | m_host.AddScriptLPS(1); | 3718 | m_host.AddScriptLPS(1); |
3816 | 3719 | ||
3817 | return Math.Max(a, b); | 3720 | return Math.Max(a, b); |
@@ -3819,7 +3722,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3819 | 3722 | ||
3820 | public LSL_Key osGetRezzingObject() | 3723 | public LSL_Key osGetRezzingObject() |
3821 | { | 3724 | { |
3822 | CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); | ||
3823 | m_host.AddScriptLPS(1); | 3725 | m_host.AddScriptLPS(1); |
3824 | 3726 | ||
3825 | return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); | 3727 | return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); |
@@ -3893,7 +3795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3893 | 3795 | ||
3894 | public void osDropAttachment() | 3796 | public void osDropAttachment() |
3895 | { | 3797 | { |
3896 | CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); | 3798 | CheckThreatLevel(ThreatLevel.Low, "osDropAttachment"); |
3897 | m_host.AddScriptLPS(1); | 3799 | m_host.AddScriptLPS(1); |
3898 | 3800 | ||
3899 | DropAttachment(true); | 3801 | DropAttachment(true); |
@@ -3909,7 +3811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3909 | 3811 | ||
3910 | public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) | 3812 | public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) |
3911 | { | 3813 | { |
3912 | CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachmentAt"); | 3814 | CheckThreatLevel(ThreatLevel.Low, "osDropAttachmentAt"); |
3913 | m_host.AddScriptLPS(1); | 3815 | m_host.AddScriptLPS(1); |
3914 | 3816 | ||
3915 | DropAttachmentAt(true, pos, rot); | 3817 | DropAttachmentAt(true, pos, rot); |
@@ -3925,7 +3827,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3925 | 3827 | ||
3926 | public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield) | 3828 | public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield) |
3927 | { | 3829 | { |
3928 | CheckThreatLevel(ThreatLevel.Low, "osListenRegex"); | ||
3929 | m_host.AddScriptLPS(1); | 3830 | m_host.AddScriptLPS(1); |
3930 | UUID keyID; | 3831 | UUID keyID; |
3931 | UUID.TryParse(ID, out keyID); | 3832 | UUID.TryParse(ID, out keyID); |
@@ -3973,7 +3874,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3973 | 3874 | ||
3974 | public LSL_Integer osRegexIsMatch(string input, string pattern) | 3875 | public LSL_Integer osRegexIsMatch(string input, string pattern) |
3975 | { | 3876 | { |
3976 | CheckThreatLevel(ThreatLevel.Low, "osRegexIsMatch"); | ||
3977 | m_host.AddScriptLPS(1); | 3877 | m_host.AddScriptLPS(1); |
3978 | try | 3878 | try |
3979 | { | 3879 | { |