From 671ea405b272090e476b73ffd793279dfca75bb2 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 6 Jul 2021 13:52:19 +1000 Subject: Fix up the usual script messes. Don't slow scripts down with bogus monitoring that isn't used anywhere. Don't make scripts sleep all the time. Don't bother with useless OhSilly Threat checks, and clean up the remains. --- .../Shared/Api/Implementation/LSL_Api.cs | 632 --------------------- .../Shared/Api/Implementation/LS_Api.cs | 3 - .../Shared/Api/Implementation/OSSL_Api.cs | 335 +---------- 3 files changed, 3 insertions(+), 967 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 993fc6f..628ab54 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -351,7 +351,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_internalObjectHost = smtpConfig.GetString("internal_object_host", m_internalObjectHost); } } -//// m_sleepMsOnEmail = EMAIL_PAUSE_TIME * 1000; } public override Object InitializeLifetimeService() @@ -380,15 +379,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return p; } -//// protected virtual void ScriptSleep(int delay) -//// { -//// delay = (int)(delay * m_ScriptDelayFactor); -//// if (delay < 10) -//// return; -//// -//// Sleep(delay); -//// } - protected virtual void Sleep(int delay) { if (m_item == null) // Some unit tests don't set this @@ -420,8 +410,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api [DebuggerNonUserCode] public void llResetScript() { -//// m_host.AddScriptLPS(1); - // We need to tell the URL module, if we hav one, to release // the allocated URLs if (m_UrlModule != null) @@ -436,7 +424,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((item = GetScriptByName(name)) == UUID.Zero) { -//// m_host.AddScriptLPS(1); Error("llResetOtherScript", "Can't find script '" + name + "'"); return; } @@ -444,7 +431,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api llResetScript(); else { -//// m_host.AddScriptLPS(1); m_ScriptEngine.ResetScript(item); } } @@ -453,8 +439,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { UUID item; -//// m_host.AddScriptLPS(1); - if ((item = GetScriptByName(name)) != UUID.Zero) { return m_ScriptEngine.GetScriptState(item) ?1:0; @@ -472,8 +456,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { UUID item; -//// m_host.AddScriptLPS(1); - // These functions are supposed to be robust, // so get the state one step at a time. @@ -716,44 +698,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //These are the implementations of the various ll-functions used by the LSL scripts. public LSL_Float llSin(double f) { -//// m_host.AddScriptLPS(1); return (double)Math.Sin(f); } public LSL_Float llCos(double f) { -//// m_host.AddScriptLPS(1); return Math.Cos(f); } public LSL_Float llTan(double f) { -//// m_host.AddScriptLPS(1); return Math.Tan(f); } public LSL_Float llAtan2(LSL_Float x, LSL_Float y) { -//// m_host.AddScriptLPS(1); return Math.Atan2(x, y); } public LSL_Float llSqrt(double f) { -//// m_host.AddScriptLPS(1); return Math.Sqrt(f); } public LSL_Float llPow(double fbase, double fexponent) { -//// m_host.AddScriptLPS(1); return (double)Math.Pow(fbase, fexponent); } public LSL_Integer llAbs(LSL_Integer i) { // changed to replicate LSL behaviour whereby minimum int value is returned untouched. -//// m_host.AddScriptLPS(1); if (i == Int32.MinValue) return i; else @@ -762,13 +737,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llFabs(double f) { -//// m_host.AddScriptLPS(1); return (double)Math.Abs(f); } public LSL_Float llFrand(double mag) { -//// m_host.AddScriptLPS(1); lock (Util.RandomClass) { return Util.RandomClass.NextDouble() * mag; @@ -777,33 +750,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llFloor(double f) { -//// m_host.AddScriptLPS(1); return (int)Math.Floor(f); } public LSL_Integer llCeil(double f) { -//// m_host.AddScriptLPS(1); return (int)Math.Ceiling(f); } // Xantor 01/May/2008 fixed midpointrounding (2.5 becomes 3.0 instead of 2.0, default = ToEven) public LSL_Integer llRound(double f) { -//// m_host.AddScriptLPS(1); return (int)Math.Round(f, MidpointRounding.AwayFromZero); } //This next group are vector operations involving squaring and square root. ckrinke public LSL_Float llVecMag(LSL_Vector v) { -//// m_host.AddScriptLPS(1); return LSL_Vector.Mag(v); } public LSL_Vector llVecNorm(LSL_Vector v) { -//// m_host.AddScriptLPS(1); return LSL_Vector.Norm(v); } @@ -817,7 +785,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) { -//// m_host.AddScriptLPS(1); return VecDist(a, b); } @@ -827,7 +794,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llRot2Euler(LSL_Rotation q1) { -//// m_host.AddScriptLPS(1); LSL_Vector eul = new LSL_Vector(); double sqw = q1.s*q1.s; @@ -901,8 +867,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llEuler2Rot(LSL_Vector v) { -//// m_host.AddScriptLPS(1); - double x,y,z,s; v.x *= 0.5; v.y *= 0.5; @@ -928,7 +892,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up) { -//// m_host.AddScriptLPS(1); double s; double tr = fwd.x + left.y + up.z + 1.0; @@ -983,8 +946,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llRot2Fwd(LSL_Rotation r) { -//// m_host.AddScriptLPS(1); - double x, y, z, m; m = r.x * r.x + r.y * r.y + r.z * r.z + r.s * r.s; @@ -1008,8 +969,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llRot2Left(LSL_Rotation r) { -//// m_host.AddScriptLPS(1); - double x, y, z, m; m = r.x * r.x + r.y * r.y + r.z * r.z + r.s * r.s; @@ -1033,7 +992,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llRot2Up(LSL_Rotation r) { -//// m_host.AddScriptLPS(1); double x, y, z, m; m = r.x * r.x + r.y * r.y + r.z * r.z + r.s * r.s; @@ -1058,7 +1016,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llRotBetween(LSL_Vector a, LSL_Vector b) { //A and B should both be normalized -//// m_host.AddScriptLPS(1); /* This method is more accurate than the SL one, and thus causes problems for scripts that deal with the SL inaccuracy around 180-degrees -.- .._. @@ -1131,8 +1088,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llWhisper(int channelID, string text) { -//// m_host.AddScriptLPS(1); - if (text.Length > 1023) text = text.Substring(0, 1023); @@ -1158,15 +1113,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSay(int channelID, string text) { -//// m_host.AddScriptLPS(1); - if (channelID == 0) -// m_SayShoutCount++; CheckSayShoutTime(); -//// if (m_SayShoutCount >= 11) -//// ScriptSleep(2000); - if (m_scriptConsoleChannelEnabled && (channelID == m_scriptConsoleChannel)) { Console.WriteLine(text); @@ -1187,15 +1136,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llShout(int channelID, string text) { -//// m_host.AddScriptLPS(1); - if (channelID == 0) -// m_SayShoutCount++; CheckSayShoutTime(); -//// if (m_SayShoutCount >= 11) -//// ScriptSleep(2000); - if (text.Length > 1023) text = text.Substring(0, 1023); @@ -1217,9 +1160,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (text.Length > 1023) text = text.Substring(0, 1023); - -//// m_host.AddScriptLPS(1); - // debug channel is also sent to avatars if (channelID == ScriptBaseClass.DEBUG_CHANNEL) { @@ -1238,8 +1178,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (msg.Length > 1023) msg = msg.Substring(0, 1023); -//// m_host.AddScriptLPS(1); - if (channel == ScriptBaseClass.DEBUG_CHANNEL) return; @@ -1253,7 +1191,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llListen(int channelID, string name, string ID, string msg) { -//// m_host.AddScriptLPS(1); UUID keyID; UUID.TryParse(ID, out keyID); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -1265,7 +1202,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llListenControl(int number, int active) { -//// m_host.AddScriptLPS(1); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); if (wComm != null) wComm.ListenControl(m_item.ItemID, number, active); @@ -1273,7 +1209,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llListenRemove(int number) { -//// m_host.AddScriptLPS(1); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); if (wComm != null) wComm.ListenRemove(m_item.ItemID, number); @@ -1281,7 +1216,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSensor(string name, string id, int type, double range, double arc) { -//// m_host.AddScriptLPS(1); UUID keyID = UUID.Zero; UUID.TryParse(id, out keyID); @@ -1290,7 +1224,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { -//// m_host.AddScriptLPS(1); UUID keyID = UUID.Zero; UUID.TryParse(id, out keyID); @@ -1299,7 +1232,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSensorRemove() { -//// m_host.AddScriptLPS(1); AsyncCommands.SensorRepeatPlugin.UnSetSenseRepeaterEvents(m_host.LocalId, m_item.ItemID); } @@ -1340,7 +1272,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llDetectedName(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return String.Empty; @@ -1349,7 +1280,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llDetectedKey(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return String.Empty; @@ -1358,7 +1288,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llDetectedOwner(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return String.Empty; @@ -1367,7 +1296,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llDetectedType(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return 0; @@ -1376,7 +1304,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llDetectedPos(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return new LSL_Vector(); @@ -1385,7 +1312,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llDetectedVel(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return new LSL_Vector(); @@ -1394,7 +1320,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llDetectedGrab(int number) { -//// m_host.AddScriptLPS(1); DetectParams parms = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (parms == null) return new LSL_Vector(0, 0, 0); @@ -1404,7 +1329,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llDetectedRot(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return new LSL_Rotation(); @@ -1413,7 +1337,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llDetectedGroup(int number) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (detectedParams == null) return new LSL_Integer(0); @@ -1424,7 +1347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llDetectedLinkNumber(int number) { -//// m_host.AddScriptLPS(1); DetectParams parms = m_ScriptEngine.GetDetectParams(m_item.ItemID, number); if (parms == null) return new LSL_Integer(0); @@ -1437,7 +1359,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llDetectedTouchBinormal(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Vector(); @@ -1449,7 +1370,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Integer llDetectedTouchFace(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Integer(-1); @@ -1461,7 +1381,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llDetectedTouchNormal(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Vector(); @@ -1473,7 +1392,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llDetectedTouchPos(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Vector(); @@ -1485,7 +1403,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llDetectedTouchST(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Vector(-1.0, -1.0, 0.0); @@ -1497,7 +1414,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llDetectedTouchUV(int index) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, index); if (detectedParams == null) return new LSL_Vector(-1.0, -1.0, 0.0); @@ -1507,13 +1423,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api [DebuggerNonUserCode] public virtual void llDie() { -//// m_host.AddScriptLPS(1); if (!m_host.ParentGroup.IsAttachment) throw new SelfDeleteException(); } public LSL_Float llGround(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); Vector3 pos = m_host.GetWorldPosition() + (Vector3)offset; //Get the slope normal. This gives us the equation of the plane tangent to the slope. @@ -1543,7 +1457,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llCloud(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); float cloudCover = 0f; ICloudModule module = World.RequestModuleInterface(); if (module != null) @@ -1560,7 +1473,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llWind(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); LSL_Vector wind = new LSL_Vector(0, 0, 0); IWindModule module = World.RequestModuleInterface(); if (module != null) @@ -1581,7 +1493,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted) return; -//// m_host.AddScriptLPS(1); int statusrotationaxis = 0; @@ -1698,7 +1609,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetStatus(int status) { -//// m_host.AddScriptLPS(1); // m_log.Debug(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); switch (status) { @@ -1767,7 +1677,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llScaleByFactor(double scaling_factor) { -//// m_host.AddScriptLPS(1); SceneObjectGroup group = m_host.ParentGroup; if(scaling_factor < 1e-6) @@ -1792,7 +1701,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetMaxScaleFactor() { -//// m_host.AddScriptLPS(1); SceneObjectGroup group = m_host.ParentGroup; if (group == null || group.IsDeleted || group.inTransit) @@ -1803,7 +1711,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetMinScaleFactor() { -//// m_host.AddScriptLPS(1); SceneObjectGroup group = m_host.ParentGroup; if (group == null || group.IsDeleted || group.inTransit) @@ -1814,7 +1721,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetScale(LSL_Vector scale) { -//// m_host.AddScriptLPS(1); SetScale(m_host, scale); } @@ -1850,13 +1756,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetScale() { -//// m_host.AddScriptLPS(1); return new LSL_Vector(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z); } public void llSetClickAction(int action) { -//// m_host.AddScriptLPS(1); m_host.ClickAction = (byte)action; m_host.ParentGroup.HasGroupChanged = true; m_host.ScheduleFullUpdate(); @@ -1865,7 +1769,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetColor(LSL_Vector color, int face) { -//// m_host.AddScriptLPS(1); SetColor(m_host, color, face); } @@ -1880,8 +1783,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetContentType(LSL_Key reqid, LSL_Integer type) { -//// m_host.AddScriptLPS(1); - if (m_UrlModule == null) return; @@ -2102,8 +2003,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetAlpha(int face) { -//// m_host.AddScriptLPS(1); - return GetAlpha(m_host, face); } @@ -2128,15 +2027,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetAlpha(double alpha, int face) { -//// m_host.AddScriptLPS(1); - SetAlpha(m_host, alpha, face); } public void llSetLinkAlpha(int linknumber, double alpha, int face) { -//// m_host.AddScriptLPS(1); - List parts = GetLinkParts(linknumber); if (parts.Count > 0) { @@ -2273,7 +2168,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetColor(int face) { -//// m_host.AddScriptLPS(1); return GetColor(m_host, face); } @@ -2320,15 +2214,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetTexture(string texture, int face) { -//// m_host.AddScriptLPS(1); SetTexture(m_host, texture, face); -//// ScriptSleep(m_sleepMsOnSetTexture); } public void llSetLinkTexture(int linknumber, string texture, int face) { -//// m_host.AddScriptLPS(1); - List parts = GetLinkParts(linknumber); if (parts.Count > 0) { @@ -2339,7 +2229,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } finally { } } -//// ScriptSleep(m_sleepMsOnSetLinkTexture); } protected void SetTextureParams(SceneObjectPart part, string texture, double scaleU, double ScaleV, @@ -2448,10 +2337,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llScaleTexture(double u, double v, int face) { -//// m_host.AddScriptLPS(1); - ScaleTexture(m_host, u, v, face); -//// ScriptSleep(m_sleepMsOnScaleTexture); } protected void ScaleTexture(SceneObjectPart part, double u, double v, int face) @@ -2490,9 +2376,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llOffsetTexture(double u, double v, int face) { -//// m_host.AddScriptLPS(1); OffsetTexture(m_host, u, v, face); -//// ScriptSleep(m_sleepMsOnOffsetTexture); } protected void OffsetTexture(SceneObjectPart part, double u, double v, int face) @@ -2531,9 +2415,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRotateTexture(double rotation, int face) { -//// m_host.AddScriptLPS(1); RotateTexture(m_host, rotation, face); -//// ScriptSleep(m_sleepMsOnRotateTexture); } protected void RotateTexture(SceneObjectPart part, double rotation, int face) @@ -2569,7 +2451,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetTexture(int face) { -//// m_host.AddScriptLPS(1); return GetTexture(m_host, face); } @@ -2611,11 +2492,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetPos(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); - SetPos(m_host, pos, true); - -//// ScriptSleep(m_sleepMsOnSetPos); } /// @@ -2627,8 +2504,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// 1 if successful, 0 otherwise. public LSL_Integer llSetRegionPos(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); - // BEGIN WORKAROUND // IF YOU GET REGION CROSSINGS WORKING WITH THIS FUNCTION, REPLACE THE WORKAROUND. // @@ -2742,20 +2617,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetPos() { -//// m_host.AddScriptLPS(1); return m_host.GetWorldPosition(); } public LSL_Vector llGetLocalPos() { -//// m_host.AddScriptLPS(1); return GetPartLocalPos(m_host); } protected LSL_Vector GetPartLocalPos(SceneObjectPart part) { -//// m_host.AddScriptLPS(1); - Vector3 pos; if (!part.IsRoot) @@ -2777,8 +2648,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); - // try to let this work as in SL... if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart)) { @@ -2794,15 +2663,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); } } - -//// ScriptSleep(m_sleepMsOnSetRot); } public void llSetLocalRot(LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); SetRot(m_host, rot); -//// ScriptSleep(m_sleepMsOnSetLocalRot); } protected void SetRot(SceneObjectPart part, Quaternion rot) @@ -2862,7 +2727,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return llGetRootRotation(); } -//// m_host.AddScriptLPS(1); Quaternion q = m_host.GetWorldRotation(); if (m_host.ParentGroup != null && m_host.ParentGroup.AttachmentPoint != 0) @@ -2927,15 +2791,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private LSL_Rotation GetPartLocalRot(SceneObjectPart part) { -//// m_host.AddScriptLPS(1); Quaternion rot = part.RotationOffset; return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W); } public void llSetForce(LSL_Vector force, int local) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { if (local != 0) @@ -2949,8 +2810,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { LSL_Vector force = new LSL_Vector(0.0, 0.0, 0.0); -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { force = m_host.ParentGroup.RootPart.GetForce(); @@ -2961,55 +2820,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetVelocity(LSL_Vector vel, int local) { -//// m_host.AddScriptLPS(1); m_host.SetVelocity(new Vector3((float)vel.x, (float)vel.y, (float)vel.z), local != 0); } public void llSetAngularVelocity(LSL_Vector avel, int local) { -//// m_host.AddScriptLPS(1); m_host.SetAngularVelocity(new Vector3((float)avel.x, (float)avel.y, (float)avel.z), local != 0); } public LSL_Integer llTarget(LSL_Vector position, double range) { -//// m_host.AddScriptLPS(1); return m_host.ParentGroup.registerTargetWaypoint(position, (float)range); } public void llTargetRemove(int number) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.unregisterTargetWaypoint(number); } public LSL_Integer llRotTarget(LSL_Rotation rot, double error) { -//// m_host.AddScriptLPS(1); return m_host.ParentGroup.registerRotTargetWaypoint(rot, (float)error); } public void llRotTargetRemove(int number) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.unregisterRotTargetWaypoint(number); } public void llMoveToTarget(LSL_Vector target, double tau) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.MoveToTarget(target, (float)tau); } public void llStopMoveToTarget() { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.StopMoveToTarget(); } public void llApplyImpulse(LSL_Vector force, LSL_Integer local) { -//// m_host.AddScriptLPS(1); //No energy force yet Vector3 v = force; if (v.Length() > 20000.0f) @@ -3023,26 +2873,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llApplyRotationalImpulse(LSL_Vector force, int local) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.RootPart.ApplyAngularImpulse(force, local != 0); } public void llSetTorque(LSL_Vector torque, int local) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.RootPart.SetAngularImpulse(torque, local != 0); } public LSL_Vector llGetTorque() { -//// m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.ParentGroup.GetTorque()); } public void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local) { -//// m_host.AddScriptLPS(1); llSetForce(force, local); llSetTorque(torque, local); } @@ -3050,8 +2895,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetVel() { -//// m_host.AddScriptLPS(1); - Vector3 vel = Vector3.Zero; if (m_host.ParentGroup.IsAttachment) @@ -3070,46 +2913,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetAccel() { -//// m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.Acceleration); } public LSL_Vector llGetOmega() { -//// m_host.AddScriptLPS(1); Vector3 avel = m_host.AngularVelocity; return new LSL_Vector(avel.X, avel.Y, avel.Z); } public LSL_Float llGetTimeOfDay() { -//// m_host.AddScriptLPS(1); return (double)((DateTime.Now.TimeOfDay.TotalMilliseconds / 1000) % (3600 * 4)); } public LSL_Float llGetWallclock() { -//// m_host.AddScriptLPS(1); return DateTime.Now.TimeOfDay.TotalSeconds; } public LSL_Float llGetTime() { -//// m_host.AddScriptLPS(1); double ScriptTime = Util.GetTimeStampMS() - m_timer; return (float)Math.Round((ScriptTime / 1000.0), 3); } public void llResetTime() { -//// m_host.AddScriptLPS(1); m_timer = Util.GetTimeStampMS(); } public LSL_Float llGetAndResetTime() { -//// m_host.AddScriptLPS(1); double now = Util.GetTimeStampMS(); double ScriptTime = now - m_timer; m_timer = now; @@ -3118,7 +2953,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSound(string sound, double volume, int queue, int loop) { -//// m_host.AddScriptLPS(1); Deprecated("llSound", "Use llPlaySound instead"); } @@ -3126,8 +2960,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 20080530 Updated to remove code duplication public void llPlaySound(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3141,8 +2973,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoopSound(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3155,8 +2985,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoopSoundMaster(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3169,8 +2997,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoopSoundSlave(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3183,8 +3009,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPlaySoundSlave(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3198,8 +3022,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTriggerSound(string sound, double volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3213,16 +3035,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStopSound() { -//// m_host.AddScriptLPS(1); - if (m_SoundModule != null) m_SoundModule.StopSound(m_host.UUID); } public void llPreloadSound(string sound) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -3231,7 +3049,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; m_SoundModule.PreloadSound(m_host.UUID, soundID); -//// ScriptSleep(m_sleepMsOnPreloadSound); } /// @@ -3242,8 +3059,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String llGetSubString(string src, int start, int end) { -//// m_host.AddScriptLPS(1); - // Normalize indices (if negative). // After normlaization they may still be // negative, but that is now relative to @@ -3336,8 +3151,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String llDeleteSubString(string src, int start, int end) { -//// m_host.AddScriptLPS(1); - // Normalize indices (if negative). // After normlaization they may still be // negative, but that is now relative to @@ -3417,8 +3230,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String llInsertString(string dest, int index, string src) { -//// m_host.AddScriptLPS(1); - // Normalize indices (if negative). // After normlaization they may still be // negative, but that is now relative to @@ -3454,13 +3265,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llToUpper(string src) { -//// m_host.AddScriptLPS(1); return src.ToUpper(); } public LSL_String llToLower(string src) { -//// m_host.AddScriptLPS(1); return src.ToLower(); } @@ -3468,8 +3277,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { Util.FireAndForget(x => { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter == UUID.Zero) return; @@ -3506,30 +3313,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llMakeExplosion(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) { -//// m_host.AddScriptLPS(1); Deprecated("llMakeExplosion", "Use llParticleSystem instead"); -//// ScriptSleep(m_sleepMsOnMakeExplosion); } public void llMakeFountain(int particles, double scale, double vel, double lifetime, double arc, int bounce, string texture, LSL_Vector offset, double bounce_offset) { -//// m_host.AddScriptLPS(1); Deprecated("llMakeFountain", "Use llParticleSystem instead"); -//// ScriptSleep(m_sleepMsOnMakeFountain); } public void llMakeSmoke(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) { -//// m_host.AddScriptLPS(1); Deprecated("llMakeSmoke", "Use llParticleSystem instead"); -//// ScriptSleep(m_sleepMsOnMakeSmoke); } public void llMakeFire(int particles, double scale, double vel, double lifetime, double arc, string texture, LSL_Vector offset) { -//// m_host.AddScriptLPS(1); Deprecated("llMakeFire", "Use llParticleSystem instead"); -//// ScriptSleep(m_sleepMsOnMakeFire); } public void llRezAtRoot(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) @@ -3539,7 +3338,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot) { -//// m_host.AddScriptLPS(1); if (string.IsNullOrEmpty(inventory) || Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) return; @@ -3603,9 +3401,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } }, null, "LSL_Api.doObjectRez"); - -//// //ScriptSleep((int)((groupmass * velmag) / 10)); -//// ScriptSleep(m_sleepMsOnRezAtRoot); } public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) @@ -3615,8 +3410,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLookAt(LSL_Vector target, double strength, double damping) { -//// m_host.AddScriptLPS(1); - // Get the normalized vector to the target LSL_Vector from = llGetPos(); @@ -3663,7 +3456,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStopLookAt() { -//// m_host.AddScriptLPS(1); m_host.StopLookAt(); } @@ -3671,7 +3463,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (sec != 0.0 && sec < m_MinTimerInterval) sec = m_MinTimerInterval; -//// m_host.AddScriptLPS(1); // Setting timer repeat AsyncCommands.TimerPlugin.SetTimerEvent(m_host.LocalId, m_item.ItemID, sec); } @@ -3679,15 +3470,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public virtual void llSleep(double sec) { // m_log.Info("llSleep snoozing " + sec + "s."); -//// m_host.AddScriptLPS(1); - Sleep((int)(sec * 1000)); } public LSL_Float llGetMass() { -//// m_host.AddScriptLPS(1); - if (m_host.ParentGroup.IsAttachment) { ScenePresence attachedAvatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar); @@ -3722,7 +3509,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(LSL_String name, LSL_Key id, LSL_Integer accept) { -//// m_host.AddScriptLPS(1); m_host.CollisionFilter.Clear(); UUID objectID; @@ -3749,14 +3535,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } - -//// m_host.AddScriptLPS(1); } public void llReleaseControls() { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter != UUID.Zero) { ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); @@ -3776,7 +3558,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llReleaseURL(string url) { -//// m_host.AddScriptLPS(1); if (m_UrlModule != null) m_UrlModule.ReleaseURL(url); } @@ -3824,8 +3605,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAttachToAvatar(LSL_Integer attachmentPoint) { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter != m_host.OwnerID) return; @@ -3887,8 +3666,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llDetachFromAvatar() { -//// m_host.AddScriptLPS(1); - if (m_host.ParentGroup.AttachmentPoint == 0) return; @@ -3901,31 +3678,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTakeCamera(string avatar) { -//// m_host.AddScriptLPS(1); Deprecated("llTakeCamera", "Use llSetCameraParams instead"); } public void llReleaseCamera(string avatar) { -//// m_host.AddScriptLPS(1); Deprecated("llReleaseCamera", "Use llClearCameraParams instead"); } public LSL_Key llGetOwner() { -//// m_host.AddScriptLPS(1); - return m_host.OwnerID.ToString(); } public void llInstantMessage(string user, string message) { -//// m_host.AddScriptLPS(1); UUID result; if (!UUID.TryParse(user, out result) || result == UUID.Zero) { Error("llInstantMessage","An invalid key was passed to llInstantMessage"); -//// ScriptSleep(2000); return; } @@ -3973,12 +3744,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); } -//// ScriptSleep(m_sleepMsOnInstantMessage); } public void llEmail(string address, string subject, string message) { -//// m_host.AddScriptLPS(1); IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface(); if (emailModule == null) { @@ -4011,12 +3780,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } emailModule.SendEmail(m_host.UUID, address, subject, message); -//// ScriptSleep(m_sleepMsOnEmail); } public void llGetNextEmail(string address, string subject) { -//// m_host.AddScriptLPS(1); IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface(); if (emailModule == null) { @@ -4044,20 +3811,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetKey() { -//// m_host.AddScriptLPS(1); return m_host.UUID.ToString(); } public LSL_Key llGenerateKey() { -//// m_host.AddScriptLPS(1); return UUID.Random().ToString(); } public void llSetBuoyancy(double buoyancy) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetBuoyancy((float)buoyancy); @@ -4072,8 +3835,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Number of seconds over which to reach target public void llSetHoverHeight(double height, int water, double tau) { -//// m_host.AddScriptLPS(1); - PIDHoverType hoverType = PIDHoverType.Ground; if (water != 0) { @@ -4084,13 +3845,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStopHover() { -//// m_host.AddScriptLPS(1); m_host.SetHoverHeight(0f, PIDHoverType.Ground, 0f); } public void llMinEventDelay(double delay) { -//// m_host.AddScriptLPS(1); try { m_ScriptEngine.SetMinEventDelay(m_item.ItemID, delay); @@ -4104,14 +3863,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSoundPreload(string sound) { -//// m_host.AddScriptLPS(1); Deprecated("llSoundPreload", "Use llPreloadSound instead"); } public void llRotLookAt(LSL_Rotation target, double strength, double damping) { -//// m_host.AddScriptLPS(1); - // Per discussion with Melanie, for non-physical objects llLookAt appears to simply // set the rotation of the object, copy that behavior SceneObjectGroup sog = m_host.ParentGroup; @@ -4130,7 +3886,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llStringLength(string str) { -//// m_host.AddScriptLPS(1); if (str.Length > 0) { return str.Length; @@ -4143,8 +3898,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStartAnimation(string anim) { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter == UUID.Zero) return; @@ -4166,8 +3919,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStopAnimation(string anim) { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter == UUID.Zero) return; @@ -4189,8 +3940,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStartObjectAnimation(string anim) { -//// m_host.AddScriptLPS(1); - // Do NOT try to parse UUID, animations cannot be triggered by ID UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation); if (animID == UUID.Zero) @@ -4200,7 +3949,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llStopObjectAnimation(string anim) { -//// m_host.AddScriptLPS(1); UUID animID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, anim, AssetType.Animation); if (animID != UUID.Zero) m_host.RemoveAnimation(animID); @@ -4208,7 +3956,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetObjectAnimationNames() { -//// m_host.AddScriptLPS(1); LSL_List ret = new LSL_List(); if(m_host.AnimationsNames == null || m_host.AnimationsNames.Count == 0) @@ -4221,17 +3968,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPointAt(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); } public void llStopPointAt() { -//// m_host.AddScriptLPS(1); } public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) { -//// m_host.AddScriptLPS(1); TargetOmega(m_host, axis, spinrate, gain); } @@ -4245,7 +3989,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetStartParameter() { -//// m_host.AddScriptLPS(1); return m_ScriptEngine.GetStartParameter(m_item.ItemID); } @@ -4274,8 +4017,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_item.PermsGranter != agentID || (perm & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) == 0) llReleaseControls(); -//// m_host.AddScriptLPS(1); - int implicitPerms = 0; if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.AttachedAvatar) @@ -4402,15 +4143,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetPermissionsKey() { -//// m_host.AddScriptLPS(1); - return m_item.PermsGranter.ToString(); } public LSL_Integer llGetPermissions() { -//// m_host.AddScriptLPS(1); - int perms = m_item.PermsMask; if (m_automaticLinkPermission) @@ -4421,8 +4158,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetLinkNumber() { -//// m_host.AddScriptLPS(1); - if (m_host.ParentGroup.PrimCount > 1) { return m_host.LinkNum; @@ -4449,8 +4184,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCreateLink(LSL_Key target, LSL_Integer parent) { -//// m_host.AddScriptLPS(1); - UUID targetID; if (!UUID.TryParse(target, out targetID)) @@ -4513,14 +4246,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (client != null) parentPrim.SendPropertiesToClient(client); - -//// ScriptSleep(m_sleepMsOnCreateLink); } public void llBreakLink(int linknum) { -//// m_host.AddScriptLPS(1); - if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 && !m_automaticLinkPermission) { @@ -4620,8 +4349,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llBreakAllLinks() { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_item; if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 @@ -4653,7 +4380,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetLinkKey(int linknum) { -//// m_host.AddScriptLPS(1); SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); if (part != null) { @@ -4719,8 +4445,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String llGetLinkName(int linknum) { -//// m_host.AddScriptLPS(1); - ISceneEntity entity = GetLinkEntity(m_host, linknum); if (entity != null) @@ -4731,7 +4455,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetInventoryNumber(int type) { -//// m_host.AddScriptLPS(1); int count = 0; m_host.TaskInventory.LockItemsForRead(true); @@ -4749,7 +4472,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetInventoryName(int type, int number) { -//// m_host.AddScriptLPS(1); ArrayList keys = new ArrayList(); m_host.TaskInventory.LockItemsForRead(true); @@ -4776,15 +4498,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetEnergy() { -//// m_host.AddScriptLPS(1); // TODO: figure out real energy value return 1.0f; } public void llGiveInventory(LSL_Key destination, LSL_String inventory) { -//// m_host.AddScriptLPS(1); - UUID destId = UUID.Zero; if (!UUID.TryParse(destination, out destId)) @@ -4866,17 +4585,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_TransferModule != null) m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); } - -//// //This delay should only occur when giving inventory to avatars. -//// ScriptSleep(m_sleepMsOnGiveInventory); } } [DebuggerNonUserCode] public void llRemoveInventory(string name) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); if (item == null) @@ -4890,7 +4604,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetText(string text, LSL_Vector color, double alpha) { -//// m_host.AddScriptLPS(1); Vector3 av3 = Util.Clip(color, 0.0f, 1.0f); byte[] data; data = Util.StringToBytes256(text); @@ -4900,13 +4613,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llWater(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); return World.RegionInfo.RegionSettings.WaterHeight; } public void llPassTouches(int pass) { -//// m_host.AddScriptLPS(1); if (pass != 0) m_host.PassTouches = true; else @@ -4915,8 +4626,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llRequestAgentData(string id, int data) { -//// m_host.AddScriptLPS(1); - UUID uuid; if (UUID.TryParse(id, out uuid)) { @@ -5021,7 +4730,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(rq.ToString(), reply); -//// ScriptSleep(m_sleepMsOnRequestAgentData); return tid.ToString(); } else @@ -5033,8 +4741,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llRequestInventoryData(string name) { -//// m_host.AddScriptLPS(1); - foreach (TaskInventoryItem item in m_host.Inventory.GetInventoryItems()) { if (item.Type == 3 && item.Name == name) @@ -5060,24 +4766,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api reply); }); -//// ScriptSleep(m_sleepMsOnRequestInventoryData); return tid.ToString(); } } -//// ScriptSleep(m_sleepMsOnRequestInventoryData); return String.Empty; } public void llSetDamage(double damage) { -//// m_host.AddScriptLPS(1); m_host.ParentGroup.Damage = (float)damage; } public void llTeleportAgentHome(string agent) { -//// m_host.AddScriptLPS(1); UUID agentId = new UUID(); if (UUID.TryParse(agent, out agentId)) { @@ -5104,13 +4806,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } - -//// ScriptSleep(m_sleepMsOnSetDamage); } public void llTeleportAgent(string agent, string destination, LSL_Vector targetPos, LSL_Vector targetLookAt) { -//// m_host.AddScriptLPS(1); UUID agentId = new UUID(); if (UUID.TryParse(agent, out agentId)) @@ -5153,7 +4852,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global_coords, LSL_Vector targetPos, LSL_Vector targetLookAt) { -//// m_host.AddScriptLPS(1); UUID agentId = new UUID(); ulong regionHandle = Util.RegionWorldLocToHandle((uint)global_coords.x, (uint)global_coords.y); @@ -5218,7 +4916,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (dm == null) return; -//// m_host.AddScriptLPS(1); UUID av = new UUID(); if (!UUID.TryParse(agent,out av)) { @@ -5237,13 +4934,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { dm.SendTextBoxToUser(av, message, chatChannel, m_host.Name, m_host.UUID, m_host.OwnerID); -//// ScriptSleep(m_sleepMsOnTextBox); } } public void llModifyLand(int action, int brush) { -//// m_host.AddScriptLPS(1); ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface(); if (tm != null) { @@ -5253,8 +4948,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionSound(LSL_String impact_sound, LSL_Float impact_volume) { -//// m_host.AddScriptLPS(1); - if(impact_sound == "") { m_host.CollisionSoundVolume = (float)impact_volume; @@ -5281,7 +4974,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetAnimation(LSL_Key id) { // This should only return a value if the avatar is in the same region -//// m_host.AddScriptLPS(1); UUID avatar; if(!UUID.TryParse(id, out avatar)) return ""; @@ -5311,8 +5003,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llMessageLinked(int linknumber, int num, string msg, string id) { -//// m_host.AddScriptLPS(1); - List parts = GetLinkParts(linknumber); UUID partItemID; @@ -5342,7 +5032,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local) { -//// m_host.AddScriptLPS(1); bool pushrestricted = World.RegionInfo.RegionSettings.RestrictPushing; bool pushAllowed = false; @@ -5509,7 +5198,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPassCollisions(int pass) { -//// m_host.AddScriptLPS(1); if (pass == 0) { m_host.PassCollisions = false; @@ -5522,15 +5210,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetScriptName() { -//// m_host.AddScriptLPS(1); - return m_item.Name != null ? m_item.Name : String.Empty; } public LSL_Integer llGetLinkNumberOfSides(int link) { -//// m_host.AddScriptLPS(1); - SceneObjectPart linkedPart; if (link == ScriptBaseClass.LINK_ROOT) @@ -5545,8 +5229,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetNumberOfSides() { -//// m_host.AddScriptLPS(1); - return m_host.GetNumberOfSides(); } @@ -5584,8 +5266,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2)) public LSL_Rotation llAxisAngle2Rot(LSL_Vector axis, double angle) { -//// m_host.AddScriptLPS(1); - double x, y, z, s, t; s = Math.Cos(angle * 0.5); @@ -5605,8 +5285,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llRot2Axis(LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); - rot.Normalize(); double s = Math.Sqrt(1 - rot.s * rot.s); @@ -5623,8 +5301,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Returns the angle of a quaternion (see llRot2Axis for the axis) public LSL_Float llRot2Angle(LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); - rot.Normalize(); double angle = 2 * Math.Acos(rot.s); @@ -5636,21 +5312,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llAcos(LSL_Float val) { -//// m_host.AddScriptLPS(1); return (double)Math.Acos(val); } public LSL_Float llAsin(LSL_Float val) { -//// m_host.AddScriptLPS(1); return (double)Math.Asin(val); } // jcochran 5/jan/2012 public LSL_Float llAngleBetween(LSL_Rotation a, LSL_Rotation b) { -//// m_host.AddScriptLPS(1); - double aa = (a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s); double bb = (b.x * b.x + b.y * b.y + b.z * b.z + b.s * b.s); double aa_bb = aa * bb; @@ -5663,8 +5335,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetInventoryKey(string name) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); if (item == null) @@ -5682,8 +5352,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAllowInventoryDrop(LSL_Integer add) { -//// m_host.AddScriptLPS(1); - if (add != 0) m_host.ParentGroup.RootPart.AllowedDrop = true; else @@ -5695,15 +5363,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetSunDirection() { -//// m_host.AddScriptLPS(1); - Vector3 sun = World.RegionInfo.RegionSettings.SunVector; return new LSL_Vector(sun); } public LSL_Vector llGetTextureOffset(int face) { -//// m_host.AddScriptLPS(1); return GetTextureOffset(m_host, face); } @@ -5730,7 +5395,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetTextureScale(int side) { -//// m_host.AddScriptLPS(1); Primitive.TextureEntry tex = m_host.Shape.Textures; LSL_Vector scale; if (side == -1) @@ -5745,7 +5409,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetTextureRot(int face) { -//// m_host.AddScriptLPS(1); return GetTextureRot(m_host, face); } @@ -5768,7 +5431,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llSubStringIndex(string source, string pattern) { -//// m_host.AddScriptLPS(1); if (string.IsNullOrEmpty(source)) return -1; if (string.IsNullOrEmpty(pattern)) @@ -5778,7 +5440,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetOwnerKey(string id) { -//// m_host.AddScriptLPS(1); UUID key = new UUID(); if (UUID.TryParse(id, out key)) { @@ -5803,15 +5464,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetCenterOfMass() { -//// m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.GetCenterOfMass()); } public LSL_List llListSort(LSL_List src, int stride, int ascending) { -//// m_host.AddScriptLPS(1); - if (stride <= 0) { stride = 1; @@ -5821,14 +5478,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetListLength(LSL_List src) { -//// m_host.AddScriptLPS(1); - return src.Length; } public LSL_Integer llList2Integer(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -5858,7 +5512,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llList2Float(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -5913,7 +5566,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llList2String(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -5925,7 +5577,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llList2Key(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -5953,7 +5604,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llList2Vector(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -5982,7 +5632,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llList2Rot(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) index = src.Length + index; @@ -6009,7 +5658,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llList2List(LSL_List src, int start, int end) { -//// m_host.AddScriptLPS(1); return src.GetSublist(start, end); } @@ -6020,7 +5668,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetListEntryType(LSL_List src, int index) { -//// m_host.AddScriptLPS(1); if (index < 0) { index = src.Length + index; @@ -6064,8 +5711,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String llList2CSV(LSL_List src) { -//// m_host.AddScriptLPS(1); - return string.Join(", ", (new List(src.Data)).ConvertAll(o => { @@ -6089,8 +5734,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int start = 0; int length = 0; -//// m_host.AddScriptLPS(1); - for (int i = 0; i < src.Length; i++) { switch (src[i]) @@ -6146,8 +5789,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int chunkk; int[] chunks; -//// m_host.AddScriptLPS(1); - if (stride <= 0) { stride = 1; @@ -6218,8 +5859,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int[] ei = new int[2]; bool twopass = false; -//// m_host.AddScriptLPS(1); - // First step is always to deal with negative indices if (start < 0) @@ -6299,8 +5938,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetRegionAgentCount() { -//// m_host.AddScriptLPS(1); - int count = 0; World.ForEachRootScenePresence(delegate(ScenePresence sp) { count++; @@ -6311,13 +5948,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetRegionCorner() { -//// m_host.AddScriptLPS(1); return new LSL_Vector(World.RegionInfo.WorldLocX, World.RegionInfo.WorldLocY, 0); } public LSL_String llGetEnv(LSL_String name) { -//// m_host.AddScriptLPS(1); switch(name) { case "agent_limit": @@ -6390,8 +6025,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List pref; LSL_List suff; -//// m_host.AddScriptLPS(1); - if (index < 0) { index = index+dest.Length; @@ -6444,8 +6077,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int index = -1; int length = src.Length - test.Length + 1; -//// m_host.AddScriptLPS(1); - // If either list is empty, do not match if (src.Length != 0 && test.Length != 0) { @@ -6489,19 +6120,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetObjectName() { -//// m_host.AddScriptLPS(1); return m_host.Name !=null ? m_host.Name : String.Empty; } public void llSetObjectName(string name) { -//// m_host.AddScriptLPS(1); m_host.Name = name != null ? name : String.Empty; } public LSL_String llGetDate() { -//// m_host.AddScriptLPS(1); DateTime date = DateTime.Now.ToUniversalTime(); string result = date.ToString("yyyy-MM-dd"); return result; @@ -6509,8 +6137,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llEdgeOfWorld(LSL_Vector pos, LSL_Vector dir) { -//// m_host.AddScriptLPS(1); - if(dir.x == 0 && dir.y == 0) return 1; // SL wiki @@ -6576,8 +6202,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Integer llGetAgentInfo(LSL_Key id) { -//// m_host.AddScriptLPS(1); - UUID key = new UUID(); if (!UUID.TryParse(id, out key)) { @@ -6684,7 +6308,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetAgentLanguage(LSL_Key id) { // This should only return a value if the avatar is in the same region, but eh. idc. -//// m_host.AddScriptLPS(1); if (World.AgentPreferencesService == null) { Error("llGetAgentLanguage", "No AgentPreferencesService present"); @@ -6711,8 +6334,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options) { -//// m_host.AddScriptLPS(1); - // do our bit masks part bool noNPC = (scope & ScriptBaseClass.AGENT_LIST_EXCLUDENPC) !=0; @@ -6794,20 +6415,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAdjustSoundVolume(LSL_Float volume) { -//// m_host.AddScriptLPS(1); m_host.AdjustSoundGain(volume); -//// ScriptSleep(m_sleepMsOnAdjustSoundVolume); } public void llSetSoundRadius(double radius) { -//// m_host.AddScriptLPS(1); m_host.SoundRadius = radius; } public LSL_String llKey2Name(LSL_Key id) { -//// m_host.AddScriptLPS(1); UUID key = new UUID(); if (UUID.TryParse(id,out key)) { @@ -6829,8 +6446,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llName2Key(LSL_String name) { -//// m_host.AddScriptLPS(1); - foreach (ScenePresence sp in World.GetScenePresences()) { if (sp.IsDeleted || sp.IsChildAgent) @@ -6849,15 +6464,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { -//// m_host.AddScriptLPS(1); - SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate); } public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate) { -//// m_host.AddScriptLPS(1); - List parts = GetLinkParts(linknumber); try @@ -6897,7 +6508,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east, LSL_Vector bottom_south_west) { -//// m_host.AddScriptLPS(1); if (m_SoundModule != null) { m_SoundModule.TriggerSoundLimited(m_host.UUID, @@ -6908,7 +6518,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llEjectFromLand(LSL_Key pest) { -//// m_host.AddScriptLPS(1); UUID agentID = new UUID(); if (UUID.TryParse(pest, out agentID)) { @@ -6928,7 +6537,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -//// ScriptSleep(m_sleepMsOnEjectFromLand); } public LSL_List llParseString2List(string str, LSL_List separators, LSL_List in_spacers) @@ -6938,7 +6546,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llOverMyLand(string id) { -//// m_host.AddScriptLPS(1); UUID key = new UUID(); if (UUID.TryParse(id, out key)) { @@ -6967,7 +6574,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetLandOwnerAt(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); ILandObject land = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); if (land == null) return UUID.Zero.ToString(); @@ -6981,7 +6587,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Vector llGetAgentSize(LSL_Key id) { -//// m_host.AddScriptLPS(1); UUID avID; if(!UUID.TryParse(id, out avID)) return ScriptBaseClass.ZERO_VECTOR; @@ -6997,7 +6602,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llSameGroup(string id) { -//// m_host.AddScriptLPS(1); UUID uuid = new UUID(); if (!UUID.TryParse(id, out uuid)) return new LSL_Integer(0); @@ -7045,8 +6649,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llUnSit(string id) { -//// m_host.AddScriptLPS(1); - UUID key = new UUID(); if (UUID.TryParse(id, out key)) { @@ -7086,8 +6688,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGroundSlope(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); - //Get the slope normal. This gives us the equation of the plane tangent to the slope. LSL_Vector vsn = llGroundNormal(offset); @@ -7107,7 +6707,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGroundNormal(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); Vector3 pos = m_host.GetWorldPosition() + (Vector3)offset; // Clamp to valid position if (pos.X < 0) @@ -7157,21 +6756,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGroundContour(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); LSL_Vector x = llGroundSlope(offset); return new LSL_Vector(-x.y, x.x, 0.0); } public LSL_Integer llGetAttached() { -//// m_host.AddScriptLPS(1); return m_host.ParentGroup.AttachmentPoint; } public LSL_List llGetAttachedList(LSL_Key id) { -//// m_host.AddScriptLPS(1); - UUID avID; if(!UUID.TryParse(id, out avID)) return new LSL_List("NOT_FOUND"); @@ -7200,14 +6795,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public virtual LSL_Integer llGetFreeMemory() { -//// m_host.AddScriptLPS(1); // Make scripts designed for Mono happy return 65536; } public LSL_Integer llGetFreeURLs() { -//// m_host.AddScriptLPS(1); if (m_UrlModule != null) return new LSL_Integer(m_UrlModule.GetFreeUrls()); return new LSL_Integer(0); @@ -7216,13 +6809,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetRegionName() { -//// m_host.AddScriptLPS(1); return World.RegionInfo.RegionName; } public LSL_Float llGetRegionTimeDilation() { -//// m_host.AddScriptLPS(1); return (double)World.TimeDilation; } @@ -7231,7 +6822,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Float llGetRegionFPS() { -//// m_host.AddScriptLPS(1); return World.StatsReporter.LastReportedSimFPS; } @@ -7309,8 +6899,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLinkParticleSystem(int linknumber, LSL_List rules) { -//// m_host.AddScriptLPS(1); - List parts = GetLinkParts(linknumber); foreach (SceneObjectPart part in parts) @@ -7321,7 +6909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llParticleSystem(LSL_List rules) { -//// m_host.AddScriptLPS(1); SetParticleSystem(m_host, rules, "llParticleSystem"); } @@ -7738,7 +7325,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llGroundRepel(double height, int water, double tau) { -//// m_host.AddScriptLPS(1); if (m_host.PhysActor != null) { float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); @@ -7763,8 +7349,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llGiveInventoryList(LSL_Key destination, LSL_String category, LSL_List inventory) { -//// m_host.AddScriptLPS(1); - UUID destID; if (!UUID.TryParse(destination, out destID)) return; @@ -7818,8 +7402,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetVehicleType(int type) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleType(type); @@ -7830,8 +7412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //CFK 9/28: so these are not complete yet. public void llSetVehicleFloatParam(int param, LSL_Float value) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleFloatParam(param, (float)value); @@ -7842,8 +7422,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //CFK 9/28: so these are not complete yet. public void llSetVehicleVectorParam(int param, LSL_Vector vec) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleVectorParam(param, vec); @@ -7854,8 +7432,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //CFK 9/28: so these are not complete yet. public void llSetVehicleRotationParam(int param, LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleRotationParam(param, rot); @@ -7864,8 +7440,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetVehicleFlags(int flags) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleFlags(flags, false); @@ -7874,8 +7448,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoveVehicleFlags(int flags) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) { m_host.ParentGroup.RootPart.SetVehicleFlags(flags, true); @@ -7895,13 +7467,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); SitTarget(m_host, offset, rot); } public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot) { -//// m_host.AddScriptLPS(1); if (link == ScriptBaseClass.LINK_ROOT) SitTarget(m_host.ParentGroup.RootPart, offset, rot); else if (link == ScriptBaseClass.LINK_THIS) @@ -7918,14 +7488,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llAvatarOnSitTarget() { -//// m_host.AddScriptLPS(1); return m_host.SitTargetAvatar.ToString(); } // http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget public LSL_Key llAvatarOnLinkSitTarget(LSL_Integer linknum) { -//// m_host.AddScriptLPS(1); if(linknum == ScriptBaseClass.LINK_SET || linknum == ScriptBaseClass.LINK_ALL_CHILDREN || linknum == ScriptBaseClass.LINK_ALL_OTHERS || @@ -7941,7 +7509,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llAddToLandPassList(LSL_Key avatar, LSL_Float hours) { -//// m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); @@ -7978,12 +7545,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); } } -//// ScriptSleep(m_sleepMsOnAddToLandPassList); } public void llSetTouchText(string text) { -//// m_host.AddScriptLPS(1); if(text.Length <= 9) m_host.TouchName = text; else @@ -7992,7 +7557,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetSitText(string text) { -//// m_host.AddScriptLPS(1); if (text.Length <= 9) m_host.SitName = text; else @@ -8001,7 +7565,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraEyeOffset(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); m_host.SetCameraEyeOffset(offset); if (m_host.ParentGroup.RootPart.GetCameraEyeOffset() == Vector3.Zero) @@ -8010,7 +7573,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraAtOffset(LSL_Vector offset) { -//// m_host.AddScriptLPS(1); m_host.SetCameraAtOffset(offset); if (m_host.ParentGroup.RootPart.GetCameraAtOffset() == Vector3.Zero) @@ -8019,8 +7581,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at) { -//// m_host.AddScriptLPS(1); - if (link == ScriptBaseClass.LINK_SET || link == ScriptBaseClass.LINK_ALL_CHILDREN || link == ScriptBaseClass.LINK_ALL_OTHERS) return; @@ -8049,7 +7609,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llDumpList2String(LSL_List src, string seperator) { -//// m_host.AddScriptLPS(1); if (src.Length == 0) { return String.Empty; @@ -8065,7 +7624,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llScriptDanger(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); bool result = World.LSLScriptDanger(m_host, pos); if (result) { @@ -8084,7 +7642,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (dm == null) return; -//// m_host.AddScriptLPS(1); UUID av = new UUID(); if (!UUID.TryParse(avatar,out av)) { @@ -8131,35 +7688,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api dm.SendDialogToUser( av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); - -//// ScriptSleep(m_sleepMsOnDialog); } public void llVolumeDetect(int detect) { -//// m_host.AddScriptLPS(1); - if (!m_host.ParentGroup.IsDeleted) m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0); } public void llRemoteLoadScript(string target, string name, int running, int start_param) { -//// m_host.AddScriptLPS(1); Deprecated("llRemoteLoadScript", "Use llRemoteLoadScriptPin instead"); -//// ScriptSleep(m_sleepMsOnRemoteLoadScript); } public void llSetRemoteScriptAccessPin(int pin) { -//// m_host.AddScriptLPS(1); m_host.ScriptAccessPin = pin; } public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { -//// m_host.AddScriptLPS(1); - UUID destId = UUID.Zero; if (!UUID.TryParse(target, out destId)) @@ -8196,13 +7744,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Inventory.RemoveInventoryItem(item.ItemID); } } -//// // this will cause the delay even if the script pin or permissions were wrong - seems ok -//// ScriptSleep(m_sleepMsOnRemoteLoadScriptPin); } public void llOpenRemoteDataChannel() { -//// m_host.AddScriptLPS(1); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod != null && xmlrpcMod.IsEnabled()) { @@ -8228,14 +7773,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams("remote_data", resobj, new DetectParams[0])); } -//// ScriptSleep(m_sleepMsOnOpenRemoteDataChannel); } public LSL_Key llSendRemoteData(string channel, string dest, int idata, string sdata) { -//// m_host.AddScriptLPS(1); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); -//// ScriptSleep(m_sleepMsOnSendRemoteData); if (xmlrpcMod == null) return ""; return (xmlrpcMod.SendRemoteData(m_host.LocalId, m_item.ItemID, channel, dest, idata, sdata)).ToString(); @@ -8243,17 +7785,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { -//// m_host.AddScriptLPS(1); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod != null) xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); -//// ScriptSleep(m_sleepMsOnRemoteDataReply); } public void llCloseRemoteDataChannel(string channel) { -//// m_host.AddScriptLPS(1); - IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface(); if (xmlRpcRouter != null) { @@ -8263,18 +7801,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface(); if (xmlrpcMod != null) xmlrpcMod.CloseXMLRPCChannel((UUID)channel); -//// ScriptSleep(m_sleepMsOnCloseRemoteDataChannel); } public LSL_String llMD5String(string src, int nonce) { -//// m_host.AddScriptLPS(1); return Util.Md5Hash(String.Format("{0}:{1}", src, nonce.ToString()), Encoding.UTF8); } public LSL_String llSHA1String(string src) { -//// m_host.AddScriptLPS(1); return Util.SHA1Hash(src, Encoding.UTF8).ToLower(); } @@ -8710,25 +8245,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetPrimitiveParams(LSL_List rules) { -//// m_host.AddScriptLPS(1); - SetLinkPrimParams(ScriptBaseClass.LINK_THIS, rules, "llSetPrimitiveParams"); - -//// ScriptSleep(m_sleepMsOnSetPrimitiveParams); } public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules) { -//// m_host.AddScriptLPS(1); - SetLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParams"); -//// ScriptSleep(m_sleepMsOnSetLinkPrimitiveParams); } public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) { -//// m_host.AddScriptLPS(1); - SetLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast"); } @@ -10858,7 +10384,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llStringToBase64(string str) { -//// m_host.AddScriptLPS(1); try { byte[] encData_byte; @@ -10875,7 +10400,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llBase64ToString(string str) { -//// m_host.AddScriptLPS(1); try { byte[] b = Convert.FromBase64String(str); @@ -10894,9 +10418,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -//// ScriptSleep(300); -//// m_host.AddScriptLPS(1); - if (str1 == String.Empty) return String.Empty; if (str2 == String.Empty) @@ -10992,26 +10513,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoteDataSetRegion() { -//// m_host.AddScriptLPS(1); Deprecated("llRemoteDataSetRegion", "Use llOpenRemoteDataChannel instead"); } public LSL_Float llLog10(double val) { -//// m_host.AddScriptLPS(1); return (double)Math.Log10(val); } public LSL_Float llLog(double val) { -//// m_host.AddScriptLPS(1); return (double)Math.Log(val); } public LSL_List llGetAnimationList(LSL_Key id) { -//// m_host.AddScriptLPS(1); - UUID avID; if(!UUID.TryParse(id, out avID)) return new LSL_List(); @@ -11030,21 +10546,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetParcelMusicURL(string url) { -//// m_host.AddScriptLPS(1); - ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (land.LandData.OwnerID != m_host.OwnerID) return; land.SetMusicUrl(url); -//// ScriptSleep(m_sleepMsOnSetParcelMusicURL); } public LSL_String llGetParcelMusicURL() { -//// m_host.AddScriptLPS(1); - ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (land.LandData.OwnerID != m_host.OwnerID) @@ -11055,8 +10566,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetRootPosition() { -//// m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.ParentGroup.AbsolutePosition); } @@ -11071,7 +10580,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Rotation llGetRootRotation() { -//// m_host.AddScriptLPS(1); Quaternion q; if (m_host.ParentGroup.AttachmentPoint != 0) { @@ -11097,26 +10605,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetObjectDesc(string desc) { -//// m_host.AddScriptLPS(1); m_host.Description = desc!=null?desc:String.Empty; } public LSL_Key llGetCreator() { -//// m_host.AddScriptLPS(1); return m_host.CreatorID.ToString(); } public LSL_String llGetTimestamp() { -//// m_host.AddScriptLPS(1); return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); } public LSL_Integer llGetNumberOfPrims() { -//// m_host.AddScriptLPS(1); - return m_host.ParentGroup.PrimCount + m_host.ParentGroup.GetSittingAvatarsCount(); } @@ -11133,7 +10636,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_List llGetBoundingBox(string obj) { -//// m_host.AddScriptLPS(1); UUID objID = UUID.Zero; LSL_List result = new LSL_List(); @@ -11282,8 +10784,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetPrimitiveParams(LSL_List rules) { -//// m_host.AddScriptLPS(1); - LSL_List result = new LSL_List(); LSL_List remaining = GetPrimParams(m_host, rules, ref result); @@ -11304,8 +10804,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules) { -//// m_host.AddScriptLPS(1); - // acording to SL wiki this must indicate a single link number or link_root or link_this. // keep other options as before @@ -11931,15 +11429,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetPrimMediaParams(int face, LSL_List rules) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnGetPrimMediaParams); return GetPrimMediaParams(m_host, face, rules); } public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnGetLinkMedia); if (link == ScriptBaseClass.LINK_ROOT) return GetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules); else if (link == ScriptBaseClass.LINK_THIS) @@ -12058,15 +11552,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnSetPrimMediaParams); return SetPrimMediaParams(m_host, face, rules); } public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnSetLinkMedia); if (link == ScriptBaseClass.LINK_ROOT) return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules); else if (link == ScriptBaseClass.LINK_THIS) @@ -12184,15 +11674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llClearPrimMedia(LSL_Integer face) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnClearPrimMedia); return ClearPrimMedia(m_host, face); } public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face) { -//// m_host.AddScriptLPS(1); -//// ScriptSleep(m_sleepMsOnClearLinkMedia); if (link == ScriptBaseClass.LINK_ROOT) return ClearPrimMedia(m_host.ParentGroup.RootPart, face); else if (link == ScriptBaseClass.LINK_THIS) @@ -12357,8 +11843,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api char[] imdt = new char[8]; -//// m_host.AddScriptLPS(1); - // Manually unroll the loop imdt[7] = '='; @@ -12419,8 +11903,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int number = 0; int digit; -//// m_host.AddScriptLPS(1); - // Require a well-fromed base64 string if (str.Length > 8) @@ -12476,14 +11958,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llGetGMTclock() { -//// m_host.AddScriptLPS(1); return DateTime.UtcNow.TimeOfDay.TotalSeconds; } public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) { -//// m_host.AddScriptLPS(1); - if (m_UrlModule != null) return m_UrlModule.GetHttpHeader(new UUID(request_id), header); return String.Empty; @@ -12492,7 +11971,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetSimulatorHostname() { -//// m_host.AddScriptLPS(1); IUrlModule UrlModule = World.RequestModuleInterface(); return UrlModule.ExternalHostNameForLSL; } @@ -12566,8 +12044,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int i, j; string d; -//// m_host.AddScriptLPS(1); - /* * Convert separator and spacer lists to C# strings. * Also filter out null strings so we don't hang. @@ -12663,8 +12139,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetObjectPermMask(int mask) { -//// m_host.AddScriptLPS(1); - int permmask = 0; if (mask == ScriptBaseClass.MASK_BASE)//0 @@ -12697,8 +12171,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetObjectPermMask(int mask, int value) { -//// m_host.AddScriptLPS(1); - if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) { if (World.Permissions.IsAdministrator(m_host.OwnerID)) @@ -12733,8 +12205,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetInventoryPermMask(string itemName, int mask) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName); if (item == null) @@ -12759,8 +12229,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetInventoryPermMask(string itemName, int mask, int value) { -//// m_host.AddScriptLPS(1); - if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) { if (World.Permissions.IsAdministrator(m_host.OwnerID)) @@ -12794,8 +12262,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetInventoryCreator(string itemName) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName); if (item == null) @@ -12810,8 +12276,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llOwnerSay(string msg) { -//// m_host.AddScriptLPS(1); - World.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); // IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); @@ -12820,7 +12284,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llRequestSecureURL() { -//// m_host.AddScriptLPS(1); if (m_UrlModule != null) return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, null).ToString(); return UUID.Zero.ToString(); @@ -12830,8 +12293,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { try { -//// m_host.AddScriptLPS(1); - string reply = String.Empty; GridRegion info; @@ -12846,7 +12307,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.DATA_SIM_POS: if (info == null) { -//// ScriptSleep(m_sleepMsOnRequestSimulatorData); return UUID.Zero.ToString(); } @@ -12893,7 +12353,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.DATA_SIM_RATING: if (info == null) { -//// ScriptSleep(m_sleepMsOnRequestSimulatorData); return UUID.Zero.ToString(); } int access = info.Maturity; @@ -12910,7 +12369,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api reply = "OpenSim"; break; default: -//// ScriptSleep(m_sleepMsOnRequestSimulatorData); return UUID.Zero.ToString(); // Raise no event } UUID rq = UUID.Random(); @@ -12921,7 +12379,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands. DataserverPlugin.DataserverReply(rq.ToString(), reply); -//// ScriptSleep(m_sleepMsOnRequestSimulatorData); return tid.ToString(); } catch(Exception) @@ -12933,8 +12390,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llRequestURL() { -//// m_host.AddScriptLPS(1); - if (m_UrlModule != null) return m_UrlModule.RequestURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, null).ToString(); return UUID.Zero.ToString(); @@ -12942,13 +12397,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llForceMouselook(int mouselook) { -//// m_host.AddScriptLPS(1); m_host.SetForceMouselook(mouselook != 0); } public LSL_Float llGetObjectMass(LSL_Key id) { -//// m_host.AddScriptLPS(1); UUID key = new UUID(); if (!UUID.TryParse(id, out key)) return 0; @@ -12993,8 +12446,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { LSL_List pref; -//// m_host.AddScriptLPS(1); - // Note that although we have normalized, both // indices could still be negative. if (start < 0) @@ -13064,13 +12515,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoadURL(string avatar_id, string message, string url) { -//// m_host.AddScriptLPS(1); - IDialogModule dm = World.RequestModuleInterface(); if (null != dm) dm.SendUrlToUser( new UUID(avatar_id), m_host.Name, m_host.UUID, m_host.OwnerID, false, message, url); -//// ScriptSleep(m_sleepMsOnLoadURL); } public void llParcelMediaCommandList(LSL_List commandList) @@ -13078,8 +12526,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // TODO: Not implemented yet (missing in libomv?): // PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) -//// m_host.AddScriptLPS(1); - // according to the docs, this command only works if script owner and land owner are the same // lets add estate owners and gods, too, and use the generic permission check. ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition); @@ -13328,12 +12774,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api commandToSend.Value, time); } } -//// ScriptSleep(m_sleepMsOnParcelMediaCommandList); } public LSL_List llParcelMediaQuery(LSL_List aList) { -//// m_host.AddScriptLPS(1); LSL_List list = new LSL_List(); Vector3 pos = m_host.AbsolutePosition; @@ -13380,23 +12824,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -//// ScriptSleep(m_sleepMsOnParcelMediaQuery); return list; } public LSL_Integer llModPow(int a, int b, int c) { -//// m_host.AddScriptLPS(1); Int64 tmp = 0; Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); -//// ScriptSleep(m_sleepMsOnModPow); return Convert.ToInt32(tmp); } public LSL_Integer llGetInventoryType(string name) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); if (item == null) @@ -13407,8 +12846,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetPayPrice(int price, LSL_List quick_pay_buttons) { -//// m_host.AddScriptLPS(1); - if (quick_pay_buttons.Data.Length < 4) { int x; @@ -13429,8 +12866,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetCameraPos() { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter == UUID.Zero) return Vector3.Zero; @@ -13453,8 +12888,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation llGetCameraRot() { -//// m_host.AddScriptLPS(1); - if (m_item.PermsGranter == UUID.Zero) return Quaternion.Identity; @@ -13476,21 +12909,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetPrimURL(string url) { -//// m_host.AddScriptLPS(1); Deprecated("llSetPrimURL", "Use llSetPrimMediaParams instead"); -//// ScriptSleep(m_sleepMsOnSetPrimURL); } public void llRefreshPrimURL() { -//// m_host.AddScriptLPS(1); Deprecated("llRefreshPrimURL"); -//// ScriptSleep(m_sleepMsOnRefreshPrimURL); } public LSL_String llEscapeURL(string url) { -//// m_host.AddScriptLPS(1); try { return Uri.EscapeDataString(url); @@ -13503,7 +12931,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llUnescapeURL(string url) { -//// m_host.AddScriptLPS(1); try { return Uri.UnescapeDataString(url); @@ -13516,7 +12943,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llMapDestination(string simname, LSL_Vector pos, LSL_Vector lookAt) { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, 0); if (detectedParams == null) { @@ -13537,12 +12963,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname, pos, lookAt); } -//// ScriptSleep(m_sleepMsOnMapDestination); } public void llAddToLandBanList(LSL_Key avatar, LSL_Float hours) { -//// m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) @@ -13578,12 +13002,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); } } -//// ScriptSleep(m_sleepMsOnAddToLandBanList); } public void llRemoveFromLandPassList(string avatar) { -//// m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManagePasses, false)) @@ -13605,12 +13027,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -//// ScriptSleep(m_sleepMsOnRemoveFromLandPassList); } public void llRemoveFromLandBanList(string avatar) { -//// m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) @@ -13632,13 +13052,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -//// ScriptSleep(m_sleepMsOnRemoveFromLandBanList); } public void llSetCameraParams(LSL_List rules) { -//// m_host.AddScriptLPS(1); - // the object we are in UUID objectID = m_host.ParentUUID; if (objectID == UUID.Zero) @@ -13764,8 +13181,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llClearCameraParams() { -//// m_host.AddScriptLPS(1); - // the object we are in UUID objectID = m_host.ParentUUID; if (objectID == UUID.Zero) @@ -13791,7 +13206,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llListStatistics(int operation, LSL_List src) { -//// m_host.AddScriptLPS(1); switch (operation) { case ScriptBaseClass.LIST_STAT_RANGE: @@ -13823,19 +13237,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetUnixTime() { -//// m_host.AddScriptLPS(1); return Util.UnixTimeSinceEpoch(); } public LSL_Integer llGetParcelFlags(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); return (int)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).LandData.Flags; } public LSL_Integer llGetRegionFlags() { -//// m_host.AddScriptLPS(1); IEstateModule estate = World.RequestModuleInterface(); if (estate == null) return 67108864; @@ -13844,8 +13255,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llXorBase64StringsCorrect(string str1, string str2) { -//// m_host.AddScriptLPS(1); - if (str1 == String.Empty) return String.Empty; if (str2 == String.Empty) @@ -13908,7 +13317,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llHTTPRequest(string url, LSL_List parameters, string body) { -//// m_host.AddScriptLPS(1); IHttpRequestModule httpScriptMod = m_ScriptEngine.World.RequestModuleInterface(); if(httpScriptMod == null) return ""; @@ -14103,15 +13511,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Partial implementation: support for parameter flags needed // see http://wiki.secondlife.com/wiki/llHTTPResponse -//// m_host.AddScriptLPS(1); - if (m_UrlModule != null) m_UrlModule.HttpResponse(new UUID(id), status,body); } public void llResetLandBanList() { -//// m_host.AddScriptLPS(1); LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData; if (land.OwnerID == m_host.OwnerID && land.ParcelAccessList.Count > 0) { @@ -14124,12 +13529,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (LandAccessEntry entry in todelete) land.ParcelAccessList.Remove(entry); } -//// ScriptSleep(m_sleepMsOnResetLandBanList); } public void llResetLandPassList() { -//// m_host.AddScriptLPS(1); LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition).LandData; if (land.OwnerID == m_host.OwnerID && land.ParcelAccessList.Count > 0) { @@ -14142,13 +13545,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (LandAccessEntry entry in todelete) land.ParcelAccessList.Remove(entry); } -//// ScriptSleep(m_sleepMsOnResetLandPassList); } public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide) { -//// m_host.AddScriptLPS(1); - ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); if (lo == null) @@ -14189,7 +13589,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetParcelPrimOwners(LSL_Vector pos) { -//// m_host.AddScriptLPS(1); LandObject land = (LandObject)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); LSL_List ret = new LSL_List(); if (land != null) @@ -14200,13 +13599,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Integer(detectedParams.Value)); } } -//// ScriptSleep(m_sleepMsOnGetParcelPrimOwners); return ret; } public LSL_Integer llGetObjectPrimCount(LSL_Key object_id) { -//// m_host.AddScriptLPS(1); UUID id; if(!UUID.TryParse(object_id, out id)) return 0; @@ -14220,8 +13617,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide) { -//// m_host.AddScriptLPS(1); - ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); if (lo == null) @@ -14235,7 +13630,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) { -//// m_host.AddScriptLPS(1); LandData land = World.GetLandData(pos); if (land == null) { @@ -14277,7 +13671,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llStringTrim(LSL_String src, LSL_Integer type) { -//// m_host.AddScriptLPS(1); if (type == (int)ScriptBaseClass.STRING_TRIM_HEAD) { return ((string)src).TrimStart(); } if (type == (int)ScriptBaseClass.STRING_TRIM_TAIL) { return ((string)src).TrimEnd(); } if (type == (int)ScriptBaseClass.STRING_TRIM) { return ((string)src).Trim(); } @@ -14286,7 +13679,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetObjectDetails(LSL_Key id, LSL_List args) { -//// m_host.AddScriptLPS(1); LSL_List ret = new LSL_List(); UUID key = new UUID(); if (!UUID.TryParse(id, out key)) @@ -14848,8 +14240,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llGetNumberOfNotecardLines(string name) { -//// m_host.AddScriptLPS(1); - UUID assetID = UUID.Zero; if (!UUID.TryParse(name, out assetID)) @@ -14877,7 +14267,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString()); -//// ScriptSleep(m_sleepMsOnGetNumberOfNotecardLines); return tid.ToString(); } @@ -14893,14 +14282,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands.DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(id).ToString()); }); -//// ScriptSleep(m_sleepMsOnGetNumberOfNotecardLines); return tid.ToString(); } public LSL_Key llGetNotecardLine(string name, int line) { -//// m_host.AddScriptLPS(1); - UUID assetID = UUID.Zero; if (!UUID.TryParse(name, out assetID)) @@ -14929,7 +14315,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AsyncCommands.DataserverPlugin.DataserverReply( reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); -//// ScriptSleep(m_sleepMsOnGetNotecardLine); return tid.ToString(); } @@ -14948,7 +14333,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api reqIdentifier, NotecardCache.GetLine(assetID, line, m_notecardLineReadCharsMax)); }); -//// ScriptSleep(m_sleepMsOnGetNotecardLine); return tid.ToString(); } @@ -15421,8 +14805,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List list = new LSL_List(); -//// m_host.AddScriptLPS(1); - Vector3 rayStart = start; Vector3 rayEnd = end; Vector3 dir = rayEnd - rayStart; @@ -15643,7 +15025,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_List llCastRayV3(LSL_Vector start, LSL_Vector end, LSL_List options) { -//// m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); // Prepare throttle data @@ -16495,7 +15876,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llManageEstateAccess(int action, string avatar) { -//// m_host.AddScriptLPS(1); EstateSettings estate = World.RegionInfo.EstateSettings; bool isAccount = false; bool isGroup = false; @@ -16564,35 +15944,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetMemoryLimit() { -//// m_host.AddScriptLPS(1); // The value returned for Mono scripts in SL return 65536; } public LSL_Integer llSetMemoryLimit(LSL_Integer limit) { -//// m_host.AddScriptLPS(1); // Treat as an LSO script return ScriptBaseClass.FALSE; } public LSL_Integer llGetSPMaxMemory() { -//// m_host.AddScriptLPS(1); // The value returned for Mono scripts in SL return 65536; } public virtual LSL_Integer llGetUsedMemory() { -//// m_host.AddScriptLPS(1); // The value returned for Mono scripts in SL return 65536; } public void llScriptProfiler(LSL_Integer flags) { -//// m_host.AddScriptLPS(1); // This does nothing for LSO scripts in SL } @@ -16604,23 +15979,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetSoundQueueing(int queue) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule != null) m_SoundModule.SetSoundQueueing(m_host.UUID, queue == ScriptBaseClass.TRUE.value); } public void llCollisionSprite(LSL_String impact_sprite) { -//// m_host.AddScriptLPS(1); // Viewer 2.0 broke this and it's likely LL has no intention // of fixing it. Therefore, letting this be a NOP seems appropriate. } public void llGodLikeRezObject(string inventory, LSL_Vector pos) { -//// m_host.AddScriptLPS(1); - if (!World.Permissions.IsGod(m_host.OwnerID)) NotImplemented("llGodLikeRezObject"); @@ -16701,8 +16071,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } -//// m_host.AddScriptLPS(1); - if (item.PermsGranter == UUID.Zero) { replydata = "MISSING_PERMISSION_DEBIT"; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 8d76a2e..d0faf95 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -125,7 +125,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSShoutError("LightShare functions are not enabled."); return new LSL_List(); } -//// m_host.AddScriptLPS(1); RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; LSL_List values = new LSL_List(); @@ -734,7 +733,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } int success = 0; -//// m_host.AddScriptLPS(1); if (LightShareModule.EnableWindlight) { @@ -812,7 +810,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } int success = 0; -//// m_host.AddScriptLPS(1); if (LightShareModule.EnableWindlight) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5f27080..8ca8344 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -304,19 +304,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message); } - // Returns if OSSL is enabled. Throws a script exception if OSSL is not allowed.. - // for safe funtions always active -//// public void CheckThreatLevel() -//// { -//// m_host.AddScriptLPS(1); -//// if (!m_OSFunctionsEnabled) -//// OSSLError("permission denied. All unsafe OSSL funtions disabled"); // throws -//// } - // Returns if the function is allowed. Throws a script exception if not allowed. public void CheckThreatLevel(ThreatLevel level, string function) { -//// m_host.AddScriptLPS(1); if (!m_OSFunctionsEnabled) { if (m_PermissionErrortoOwner) @@ -589,17 +579,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); } -//// protected void ScriptSleep(int delay) -//// { -//// delay = (int)(delay * m_ScriptDelayFactor); -//// if (delay < 10) -//// return; -//// if(m_item != null) -//// m_ScriptEngine.SleepScript(m_item.ItemID, delay); -//// else -//// Thread.Sleep(delay); -//// } - public LSL_Integer osSetTerrainHeight(int x, int y, double val) { CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); @@ -633,13 +612,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetTerrainHeight(int x, int y) { -//// CheckThreatLevel(); return GetTerrainHeight(x, y); } public LSL_Float osTerrainGetHeight(int x, int y) { -//// CheckThreatLevel(); OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); return GetTerrainHeight(x, y); } @@ -778,7 +755,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // if enabled It can be used to destroy // arbitrary builds the user would normally have no rights to - // +//// ???? // CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot"); if (World.Entities.ContainsKey(target)) @@ -801,8 +778,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURL"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -822,8 +797,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, int timer, int alpha) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURLBlend"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -843,8 +816,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, bool blend, int disp, int timer, int alpha, int face) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osSetDynamicTextureURLBlendFace"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -870,8 +841,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureDataFace(string dynamicID, string contentType, string data, string extraParams, int timer, int face) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -899,8 +868,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, int timer, int alpha) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -927,8 +894,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, bool blend, int disp, int timer, int alpha, int face) { -//// CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace"); - if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -968,6 +933,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetPrimFloatOnWater(int floatYN) { +//// ???? CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater"); m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); @@ -1057,7 +1023,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { -//// ScriptSleep(500); return; } @@ -1066,7 +1031,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // should be faster than going to threadpool World.RequestTeleportLocation(presence.ControllingClient, regionName, position, lookat, (uint)TPFlags.ViaLocation); -//// ScriptSleep(500); } else { @@ -1077,7 +1041,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api presence.ControllingClient, regionName, position, lookat, (uint)(TPFlags.ViaLocation | TPFlags.ViaScript)), null, "OSSL_Api.TeleportAgentByRegionCoords"); -//// ScriptSleep(5000); } } } @@ -1106,7 +1069,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { -//// ScriptSleep(500); return; } @@ -1116,7 +1078,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api position, lookat, (uint)TPFlags.ViaLocation), null, "OSSL_Api.TeleportAgentByRegionName"); -//// ScriptSleep(5000); } } @@ -1132,35 +1093,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { -//// ScriptSleep(500); return; } World.RequestTeleportLocation(presence.ControllingClient, World.RegionInfo.RegionName, position, lookat, (uint)TPFlags.ViaLocation); -//// ScriptSleep(500); } } public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { // Threat level None because this is what can already be done with the World Map in the viewer -//// CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); - TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); } public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { -//// CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); - TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat); } public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { -//// CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); - osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); } @@ -1216,10 +1169,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Get a list of all the avatars/agents in the region public LSL_List osGetAgents() { - // threat level is None as we could get this information with an - // in-world script as well, just not as efficient -//// CheckThreatLevel(ThreatLevel.None, "osGetAgents"); - LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate(ScenePresence sp) { @@ -1312,104 +1261,78 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawResetTransform(string drawList) { -//// CheckThreatLevel(); - drawList += "ResetTransf;"; return drawList; } public string osDrawRotationTransform(string drawList, LSL_Float x) { -//// CheckThreatLevel(); - drawList += "RotTransf " + x + ";"; return drawList; } public string osDrawScaleTransform(string drawList, LSL_Float x, LSL_Float y) { -//// CheckThreatLevel(); - drawList += "ScaleTransf " + x + "," + y + ";"; return drawList; } public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) { -//// CheckThreatLevel(); - drawList += "TransTransf " + x + "," + y + ";"; return drawList; } public string osMovePen(string drawList, int x, int y) { -//// CheckThreatLevel(); - drawList += "MoveTo " + x + "," + y + ";"; return drawList; } public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) { -//// CheckThreatLevel(); - drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; return drawList; } public string osDrawLine(string drawList, int endX, int endY) { -//// CheckThreatLevel(); - drawList += "LineTo " + endX + "," + endY + "; "; return drawList; } public string osDrawText(string drawList, string text) { -//// CheckThreatLevel(ThreatLevel.None, "osDrawText"); - drawList += "Text " + text + "; "; return drawList; } public string osDrawEllipse(string drawList, int width, int height) { -//// CheckThreatLevel(); - drawList += "Ellipse " + width + "," + height + "; "; return drawList; } public string osDrawFilledEllipse(string drawList, int width, int height) { -//// CheckThreatLevel(); - drawList += "FillEllipse " + width + "," + height + "; "; return drawList; } public string osDrawRectangle(string drawList, int width, int height) { -//// CheckThreatLevel(); - drawList += "Rectangle " + width + "," + height + "; "; return drawList; } public string osDrawFilledRectangle(string drawList, int width, int height) { -//// CheckThreatLevel(); - drawList += "FillRectangle " + width + "," + height + "; "; return drawList; } public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) { -//// CheckThreatLevel(); - if (x.Length != y.Length || x.Length < 3) { return ""; @@ -1425,8 +1348,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) { -//// CheckThreatLevel(); - if (x.Length != y.Length || x.Length < 3) { return ""; @@ -1442,32 +1363,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetFontSize(string drawList, int fontSize) { -//// CheckThreatLevel(); - drawList += "FontSize "+ fontSize +"; "; return drawList; } public string osSetFontName(string drawList, string fontName) { -//// CheckThreatLevel(); - drawList += "FontName "+ fontName +"; "; return drawList; } public string osSetPenSize(string drawList, int penSize) { -//// CheckThreatLevel(); - drawList += "PenSize " + penSize + "; "; return drawList; } public string osSetPenColor(string drawList, string color) { -//// CheckThreatLevel(); - drawList += "PenColor " + color + "; "; return drawList; } @@ -1475,7 +1388,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Deprecated public string osSetPenColour(string drawList, string colour) { -//// CheckThreatLevel(); OSSLDeprecated("osSetPenColour", "osSetPenColor"); drawList += "PenColour " + colour + "; "; @@ -1484,24 +1396,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenCap(string drawList, string direction, string type) { -//// CheckThreatLevel(); - drawList += "PenCap " + direction + "," + type + "; "; return drawList; } public string osDrawImage(string drawList, int width, int height, string imageUrl) { -//// CheckThreatLevel(); - drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; return drawList; } public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) { -//// CheckThreatLevel(); - LSL_Vector vec = new LSL_Vector(0,0,0); IDynamicTextureManager textureManager = World.RequestModuleInterface(); if (textureManager != null) @@ -1587,8 +1493,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public double osGetCurrentSunHour() { -//// CheckThreatLevel(); - // Must adjust for the fact that Region Sun Settings are still LL offset double sunHour = World.RegionInfo.RegionSettings.SunPosition - 6; @@ -1604,14 +1508,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double osSunGetParam(string param) { -//// CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); OSSLDeprecated("osSunGetParam", "osGetSunParam"); return GetSunParam(param); } public double osGetSunParam(string param) { -//// CheckThreatLevel(); return GetSunParam(param); } @@ -1652,8 +1554,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osWindActiveModelPluginName() { -//// CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName"); - IWindModule module = World.RequestModuleInterface(); if (module != null) { @@ -1680,8 +1580,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetWindParam(string plugin, string param) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); - IWindModule module = World.RequestModuleInterface(); if (module != null) { @@ -1995,8 +1893,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osCheckODE() { -//// CheckThreatLevel(); - LSL_Integer ret = 0; // false if (m_ScriptEngine.World.PhysicsScene != null) { @@ -2020,7 +1916,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // the user does not have permission to see it. This as opposed to // throwing an exception. -//// m_host.AddScriptLPS(1); string ret = String.Empty; //// if (String.IsNullOrEmpty(CheckThreatLevelTest(ThreatLevel.High, "osGetPhysicsEngineType"))) { @@ -2038,8 +1933,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetPhysicsEngineName() { -//// CheckThreatLevel(); - string ret = "NoEngine"; if (m_ScriptEngine.World.PhysicsScene != null) { @@ -2059,8 +1952,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // kiddie) // // Or they could check in the About window. Pfffft -//// CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion"); - return m_ScriptEngine.World.GetSimulatorVersion(); } @@ -2075,8 +1966,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osMessageObject(LSL_Key objectUUID, string message) { -//// CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); - UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead. { @@ -2112,11 +2001,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osDie(LSL_Key objectUUID) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osDie"); - // if this is restricted to objects rezzed by this host level can be reduced - -//// CheckThreatLevel(ThreatLevel.Low, "osDie"); - UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) { @@ -2159,17 +2043,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Write a notecard directly to the prim's inventory. /// - /// - /// This needs ThreatLevel high. It is an excellent griefer tool, - /// In a loop, it can cause asset bloat and DOS levels of asset - /// writes. - /// /// The name of the notecard to write. /// The contents of the notecard. public void osMakeNotecard(string notecardName, LSL_Types.list contents) { -//// CheckThreatLevel(ThreatLevel.High, "osMakeNotecard"); - StringBuilder notecardData = new StringBuilder(); for (int i = 0; i < contents.Length; i++) @@ -2353,8 +2230,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Notecard line public string osGetNotecardLine(string name, int line) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine"); - UUID assetID = CacheNotecard(name); if (assetID == UUID.Zero) @@ -2380,8 +2255,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Notecard text public string osGetNotecard(string name) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard"); - string text = LoadNotecard(name); if (text == null) @@ -2409,8 +2282,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public int osGetNumberOfNotecardLines(string name) { -//// CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines"); - UUID assetID = CacheNotecard(name); if (assetID == UUID.Zero) @@ -2469,8 +2340,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osKey2Name(string id) { -//// CheckThreatLevel(ThreatLevel.Low, "osKey2Name"); - UUID key = new UUID(); if (UUID.TryParse(id, out key)) @@ -2570,16 +2439,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Get the nickname of this grid, as set in the [GridInfo] config section. /// - /// - /// Threat level is Moderate because intentional abuse, for instance - /// scripts that are written to be malicious only on one grid, - /// for instance in a HG scenario, are a distinct possibility. - /// /// public string osGetGridNick() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick"); - string nick = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2594,8 +2456,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridName() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName"); - string name = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2610,8 +2470,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridLoginURI() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI"); - string loginURI = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2626,8 +2484,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridHomeURI() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); - IConfigSource config = m_ScriptEngine.ConfigSource; string HomeURI = Util.GetConfigVarFromSections(config, "HomeURI", new string[] { "Startup", "Hypergrid" }, String.Empty); @@ -2665,8 +2521,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridCustom(string key) { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); - string retval = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2713,15 +2567,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osFormatString(string str, LSL_List strings) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString"); - return String.Format(str, strings.Data); } public LSL_List osMatchString(string src, string pattern, int start) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osMatchString"); - LSL_List result = new LSL_List(); // Normalize indices (if negative). @@ -2761,8 +2611,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osReplaceString"); - // Normalize indices (if negative). // After normlaization they may still be // negative, but that is now relative to @@ -2785,22 +2633,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osLoadedCreationDate() { -//// CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); - return World.RegionInfo.RegionSettings.LoadedCreationDate; } public string osLoadedCreationTime() { -//// CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime"); - return World.RegionInfo.RegionSettings.LoadedCreationTime; } public string osLoadedCreationID() { -//// CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID"); - return World.RegionInfo.RegionSettings.LoadedCreationID; } @@ -2872,8 +2714,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osIsNpc(LSL_Key npc) { -//// CheckThreatLevel(); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -2888,8 +2728,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); - // have to get the npc module also here to set the default Not Owned INPCModule module = World.RequestModuleInterface(); if(module == null) @@ -2902,8 +2740,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); - return NpcCreate( firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, @@ -3045,8 +2881,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// The asset ID of the notecard saved. public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3066,8 +2900,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcLoadAppearance(LSL_Key npc, string notecard) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3097,8 +2929,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcGetOwner(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) { @@ -3118,8 +2948,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osNpcGetPos(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcGetPos"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) { @@ -3141,8 +2969,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3159,8 +2985,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3183,8 +3007,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation osNpcGetRot(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcGetRot"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) { @@ -3206,8 +3028,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcSetRot"); - INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) { @@ -3227,8 +3047,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStopMoveToTarget(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3243,8 +3061,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { -//// CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3261,8 +3077,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileImage(LSL_Key npc, string image) { -//// CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3294,8 +3108,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSay(LSL_Key npc, int channel, string message) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcSay"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3310,8 +3122,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); - INPCModule module = World.RequestModuleInterface(); if (module == null) return; @@ -3341,8 +3151,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcShout(LSL_Key npc, int channel, string message) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcShout"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3357,8 +3165,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSit(LSL_Key npc, LSL_Key target, int options) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcSit"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3373,8 +3179,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStand(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcStand"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3389,8 +3193,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcRemove(LSL_Key npc) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); - try { INPCModule module = World.RequestModuleInterface(); @@ -3409,8 +3211,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcPlayAnimation(LSL_Key npc, string animation) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation"); - INPCModule module = World.RequestModuleInterface(); if (module == null) return; @@ -3449,8 +3249,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStopAnimation(LSL_Key npc, string animation) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation"); - INPCModule module = World.RequestModuleInterface(); if (module == null) return; @@ -3484,8 +3282,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcWhisper(LSL_Key npc, int channel, string message) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); - INPCModule module = World.RequestModuleInterface(); if (module != null) { @@ -3500,8 +3296,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num) { -//// CheckThreatLevel(ThreatLevel.High, "osNpcTouch"); - INPCModule module = World.RequestModuleInterface(); int linkNum = link_num.value; if (module != null || (linkNum < 0 && linkNum != ScriptBaseClass.LINK_THIS)) @@ -3544,8 +3338,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// The asset ID of the notecard saved. public LSL_Key osOwnerSaveAppearance(string notecard) { -//// CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); - return SaveAppearanceToNotecard(m_host.OwnerID, notecard); } @@ -3597,8 +3389,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// "male" or "female" or "unknown" public LSL_String osGetGender(LSL_Key rawAvatarId) { -//// CheckThreatLevel(ThreatLevel.None, "osGetGender"); - UUID avatarId; if (!UUID.TryParse(rawAvatarId, out avatarId)) return new LSL_String("unknown"); @@ -3640,8 +3430,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Key osGetMapTexture() { -//// CheckThreatLevel(); - return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); } @@ -3652,8 +3440,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Key osGetRegionMapTexture(string regionNameOrID) { -//// CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture"); - Scene scene = m_ScriptEngine.World; UUID key = UUID.Zero; GridRegion region; @@ -3673,8 +3459,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (region != null) key = region.TerrainImage; -//// ScriptSleep(1000); - return key.ToString(); } @@ -3687,8 +3471,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// List of floats public LSL_List osGetRegionStats() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); - LSL_List ret = new LSL_List(); float[] stats = World.StatsReporter.LastReportedSimStats; @@ -3701,8 +3483,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osGetRegionSize() { -//// CheckThreatLevel(); - Scene scene = m_ScriptEngine.World; RegionInfo reg = World.RegionInfo; // GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID); @@ -3712,8 +3492,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public int osGetSimulatorMemory() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); - long pws = Util.GetPhysicalMemUse(); if (pws > Int32.MaxValue) @@ -3726,8 +3504,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public int osGetSimulatorMemoryKB() { -//// CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemoryKB"); - long pws = Util.GetPhysicalMemUse(); if ((pws & 0x3FFL) != 0) @@ -3742,8 +3518,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetSpeed(string ID, LSL_Float SpeedModifier) { - CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); - UUID avid; if(!UUID.TryParse(ID, out avid)) return; @@ -3755,8 +3529,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetOwnerSpeed(LSL_Float SpeedModifier) { - //// CheckThreatLevel(ThreatLevel.Moderate, "osSetOwnerSpeed"); - if(SpeedModifier > 4) SpeedModifier = 4; @@ -3805,8 +3577,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetHealth(LSL_Key agentKey) { - //// CheckThreatLevel(ThreatLevel.None, "osGetHealth"); - LSL_Float health = new LSL_Float(-1); UUID id; @@ -3904,8 +3674,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetHealRate(LSL_Key avatar) { -//// CheckThreatLevel(ThreatLevel.None, "osGetHealRate"); - LSL_Float rate = new LSL_Float(0); UUID avatarId; @@ -3928,7 +3696,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimitiveParams"); + CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimitiveParams"); InitLSL(); m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); @@ -3972,8 +3740,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetProjectionParams(LSL_Key prim, LSL_Integer llprojection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb) { -//// CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); - SceneObjectPart obj = null; if (prim == UUID.Zero.ToString()) { @@ -4007,8 +3773,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Strided list of the UUID, position and name of each avatar in the region public LSL_List osGetAvatarList() { -//// CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); - LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) { @@ -4025,8 +3789,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetNPCList() { -//// CheckThreatLevel(ThreatLevel.None, "osGetNPCList"); - LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) { @@ -4049,8 +3811,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_String osUnixTimeToTimestamp(LSL_Integer time) { -//// CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); - long baseTicks = 621355968000000000; long tickResolution = 10000000; long epochTicks = (time * tickResolution) + baseTicks; @@ -4408,8 +4168,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// 1 if thing is a valid UUID, 0 otherwise public LSL_Integer osIsUUID(string thing) { -//// CheckThreatLevel(); - UUID test; return UUID.TryParse(thing, out test) ? 1 : 0; } @@ -4422,8 +4180,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Float osMin(double a, double b) { -//// CheckThreatLevel(); - return Math.Min(a, b); } @@ -4435,15 +4191,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Float osMax(double a, double b) { -//// CheckThreatLevel(); - return Math.Max(a, b); } public LSL_Key osGetRezzingObject() { -//// CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); - UUID rezID = m_host.ParentGroup.RezzerID; if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null) return new LSL_Key(UUID.Zero.ToString()); @@ -4545,8 +4297,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield) { -//// CheckThreatLevel(ThreatLevel.Low, "osListenRegex"); - UUID keyID; UUID.TryParse(ID, out keyID); @@ -4593,8 +4343,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osRegexIsMatch(string input, string pattern) { -//// CheckThreatLevel(ThreatLevel.Low, "osRegexIsMatch"); - try { return Regex.IsMatch(input, pattern) ? 1 : 0; @@ -4642,8 +4390,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osCollisionSound(string impact_sound, double impact_volume) { -//// CheckThreatLevel(); - if(impact_sound == "") { m_host.CollisionSoundVolume = (float)impact_volume; @@ -4674,8 +4420,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // still not very usefull, detector is lost on rez, restarts, etc public void osVolumeDetect(int detect) { -//// CheckThreatLevel(); - if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment) return; @@ -4696,8 +4440,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_List osGetInertiaData() { -//// CheckThreatLevel(); - LSL_List result = new LSL_List(); float TotalMass; Vector3 CenterOfMass; @@ -4743,8 +4485,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot) { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4781,8 +4521,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot) { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4822,8 +4560,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass) { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4861,8 +4597,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot) { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4899,8 +4633,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osClearInertia() { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return; @@ -4957,8 +4689,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Integer osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags) { -//// CheckThreatLevel(ThreatLevel.Severe, "osTeleportObject"); - UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) { @@ -4985,8 +4715,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osGetLinkNumber(LSL_String name) { -//// CheckThreatLevel(); - SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) return -1; @@ -5023,7 +4751,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osAdjustSoundVolume(LSL_Integer linknum, LSL_Float volume) { -//// m_host.AddScriptLPS(1); SceneObjectPart sop = GetSingleLinkPart(linknum); if(sop == null) return; @@ -5032,7 +4759,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetSoundRadius(LSL_Integer linknum, LSL_Float radius) { -//// m_host.AddScriptLPS(1); SceneObjectPart sop = GetSingleLinkPart(linknum); if(sop == null) return; @@ -5041,8 +4767,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osPlaySound(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5060,8 +4784,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osLoopSound(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5078,8 +4800,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osLoopSoundMaster(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5096,8 +4816,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osLoopSoundSlave(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5114,8 +4832,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osPlaySoundSlave(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5133,8 +4849,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTriggerSound(LSL_Integer linknum, LSL_String sound, LSL_Float volume) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5153,8 +4867,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTriggerSoundLimited(LSL_Integer linknum, LSL_String sound, LSL_Float volume, LSL_Vector top_north_east, LSL_Vector bottom_south_west) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5172,8 +4884,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osStopSound(LSL_Integer linknum) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5186,8 +4896,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osPreloadSound(LSL_Integer linknum, LSL_String sound) { -//// m_host.AddScriptLPS(1); - if (m_SoundModule == null) return; @@ -5200,7 +4908,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; m_SoundModule.PreloadSound(sop.UUID, soundID); -//// ScriptSleep(1000); } // get only one part @@ -5238,7 +4945,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osDetectedCountry(LSL_Integer number) { -//// m_host.AddScriptLPS(1); CheckThreatLevel(ThreatLevel.Moderate, "osDetectedCountry"); if (World.UserAccountService == null) @@ -5255,7 +4961,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osGetAgentCountry(LSL_Key id) { -//// m_host.AddScriptLPS(1); CheckThreatLevel(ThreatLevel.Moderate, "osGetAgentCountry"); if (World.UserAccountService == null) @@ -5281,9 +4986,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osStringSubString(LSL_String src, LSL_Integer offset) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return ""; if (offset >= src.Length) @@ -5295,9 +4997,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osStringSubString(LSL_String src, LSL_Integer offset, LSL_Integer length) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return ""; if (length <= 0 || offset >= src.Length) @@ -5315,9 +5014,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringStartsWith(LSL_String src, LSL_String value, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return 0; if (string.IsNullOrEmpty(value)) @@ -5329,9 +5025,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringEndsWith(LSL_String src, LSL_String value, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return 0; if (string.IsNullOrEmpty(value)) @@ -5343,9 +5036,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringIndexOf(LSL_String src, LSL_String value, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return -1; if (string.IsNullOrEmpty(value)) @@ -5359,9 +5049,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringIndexOf(LSL_String src, LSL_String value, LSL_Integer offset, LSL_Integer count, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return -1; if (string.IsNullOrEmpty(value)) @@ -5383,9 +5070,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringLastIndexOf(LSL_String src, LSL_String value, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return -1; if (string.IsNullOrEmpty(value)) @@ -5399,9 +5083,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osStringLastIndexOf(LSL_String src, LSL_String value, LSL_Integer offset, LSL_Integer count, LSL_Integer ignorecase) { -//// m_host.AddScriptLPS(1); -//// CheckThreatLevel(); - if (string.IsNullOrEmpty(src)) return -1; if (string.IsNullOrEmpty(value)) @@ -5553,8 +5234,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osGetInventoryLastOwner(LSL_String itemNameorid) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = null; UUID itemID; if (UUID.TryParse(itemNameorid, out itemID)) @@ -5573,8 +5252,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osGetInventoryItemKey(LSL_String name) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); if (item == null) @@ -5592,8 +5269,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osGetInventoryName(LSL_Key itemId) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = null; UUID itemID; if (UUID.TryParse(itemId, out itemID)) @@ -5607,8 +5282,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osGetInventoryDesc(LSL_String itemNameorid) { -//// m_host.AddScriptLPS(1); - TaskInventoryItem item = null; UUID itemID; if (UUID.TryParse(itemNameorid, out itemID)) @@ -5624,7 +5297,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osGetLastChangedEventKey() { -//// m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, 0); if (detectedParams == null) return String.Empty; @@ -5634,7 +5306,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // returns PST or PDT wall clock public LSL_Float osGetPSTWallclock() { -//// m_host.AddScriptLPS(1); if(PSTTimeZone == null) return DateTime.Now.TimeOfDay.TotalSeconds; -- cgit v1.1