From c3dbf91152692734e46850036aae451d87eb9bae Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 03:21:23 +0100 Subject: osDrawFilledEllipse or string comand FillEllipse identical do Ellipse one --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 +++++++++ OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 15 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e51a078..37f8970 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1191,6 +1191,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } + public string osDrawFilledEllipse(string drawList, int width, int height) + { + CheckThreatLevel(ThreatLevel.None, "osDrawFilledEllipse"); + + m_host.AddScriptLPS(1); + drawList += "FillEllipse " + width + "," + height + "; "; + return drawList; + } + public string osDrawRectangle(string drawList, int width, int height) { CheckThreatLevel(ThreatLevel.None, "osDrawRectangle"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index bd5d008..da3d6de 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -222,6 +222,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osDrawLine(string drawList, int endX, int endY); string osDrawText(string drawList, string text); string osDrawEllipse(string drawList, int width, int height); + string osDrawFilledEllipse(string drawList, int width, int height); string osDrawRectangle(string drawList, int width, int height); string osDrawFilledRectangle(string drawList, int width, int height); string osDrawPolygon(string drawList, LSL_List x, LSL_List y); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 9eac114..1451efc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -355,6 +355,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawEllipse(drawList, width, height); } + public string osDrawFilledEllipse(string drawList, int width, int height) + { + return m_OSSL_Functions.osDrawFilledEllipse(drawList, width, height); + } + public string osDrawRectangle(string drawList, int width, int height) { return m_OSSL_Functions.osDrawRectangle(drawList, width, height); -- cgit v1.1 From ae4266916cc3b75e1e897c9250b47390340eab72 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 04:23:13 +0100 Subject: add string osSetDynamicTextureDataFace(string dynamicID, string contentType, string data, string extraParams, int timer, int face) to easy only setting a prim face --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 ++++++++- OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 37f8970..d782ee6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -736,6 +736,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer) { + return osSetDynamicTextureDataFace(dynamicID, contentType, data, extraParams, timer, -1); + } + + public string osSetDynamicTextureDataFace(string dynamicID, string contentType, string data, string extraParams, + int timer, int face) + { CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData"); m_host.AddScriptLPS(1); @@ -750,7 +756,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, - extraParams, timer); + extraParams, timer, false, 3, 255, face); + return createdTexture.ToString(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index da3d6de..c12490c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -123,6 +123,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, bool blend, int disp, int timer, int alpha, int face); string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer); + string osSetDynamicTextureDataFace(string dynamicID, string contentType, string data, string extraParams, int timer, int face); string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, int timer, int alpha); string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 1451efc..9bc3159 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -153,6 +153,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSetDynamicTextureData(dynamicID, contentType, data, extraParams, timer); } + public string osSetDynamicTextureDataFace(string dynamicID, string contentType, string data, string extraParams, + int timer, int face) + { + return m_OSSL_Functions.osSetDynamicTextureDataFace(dynamicID, contentType, data, extraParams, timer, face); + } + public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, int timer, int alpha) { -- cgit v1.1 From ed8fc359f3853bab07ec3f5d6fd533da8d3797be Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 06:11:10 +0100 Subject: change thread level of osSetDynamicTextureDataBlendFace to VeryHigh --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d782ee6..7371fc5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -801,7 +801,7 @@ 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"); + CheckThreatLevel(ThreatLevel.VeryHigh , "osSetDynamicTextureDataBlendFace"); m_host.AddScriptLPS(1); if (dynamicID == String.Empty) -- cgit v1.1 From 1a8a77c41e4061b75ff97fcf89e39717550bfa25 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 09:24:56 +0100 Subject: revert the thread level change; remove unused dynamic texture timer from internal code; let blend alpha work if < 255; let blend work with the selected face; etc --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7371fc5..3a0884f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -678,7 +678,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IDynamicTextureManager textureManager = World.RequestModuleInterface(); UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, - extraParams, timer); + extraParams); return createdTexture.ToString(); } else @@ -700,7 +700,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IDynamicTextureManager textureManager = World.RequestModuleInterface(); UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, - extraParams, timer, true, (byte) alpha); + extraParams, true, (byte) alpha); return createdTexture.ToString(); } else @@ -722,7 +722,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IDynamicTextureManager textureManager = World.RequestModuleInterface(); UUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, - extraParams, timer, blend, disp, (byte) alpha, face); + extraParams, blend, disp, (byte) alpha, face); return createdTexture.ToString(); } else @@ -756,7 +756,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, - extraParams, timer, false, 3, 255, face); + extraParams, false, 3, 255, face); return createdTexture.ToString(); } @@ -786,7 +786,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, - extraParams, timer, true, (byte) alpha); + extraParams, true, (byte) alpha); return createdTexture.ToString(); } } @@ -801,7 +801,7 @@ 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.VeryHigh , "osSetDynamicTextureDataBlendFace"); + CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace"); m_host.AddScriptLPS(1); if (dynamicID == String.Empty) @@ -815,7 +815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } UUID createdTexture = textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, - extraParams, timer, blend, disp, (byte) alpha, face); + extraParams, blend, disp, (byte) alpha, face); return createdTexture.ToString(); } } -- cgit v1.1 From cb8975e56729c6fd077a69df3a7fa06cba285f82 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 23:04:37 +0100 Subject: add string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y), string osDrawRotationTransform(string drawList, LSL_Float x) and string osDrawResetTransform(string drawList) helper functions for the new vector renderer comands. Removed ThreadLevel check of similar funtions that had it None, and actually only set strings --- .../Shared/Api/Implementation/OSSL_Api.cs | 58 ++++++++++++++++------ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 3 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 15 ++++++ 3 files changed, 60 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3a0884f..e93a7d7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1153,9 +1153,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } //Texture draw functions + + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + CheckThreatLevel(); + + m_host.AddScriptLPS(1); + drawList += "TransTransf " + x + "," + y + ";"; + return drawList; + } + + public string osDrawRotationTransform(string drawList, LSL_Float x) + { + CheckThreatLevel(); + m_host.AddScriptLPS(1); + drawList += "RotTransf " + x + ";"; + return drawList; + } + + public string osDrawResetTransform(string drawList) + { + CheckThreatLevel(); + m_host.AddScriptLPS(1); + drawList += "ResetTransf;"; + return drawList; + } + public string osMovePen(string drawList, int x, int y) { - CheckThreatLevel(ThreatLevel.None, "osMovePen"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "MoveTo " + x + "," + y + ";"; @@ -1164,7 +1190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) { - CheckThreatLevel(ThreatLevel.None, "osDrawLine"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; @@ -1173,7 +1199,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawLine(string drawList, int endX, int endY) { - CheckThreatLevel(ThreatLevel.None, "osDrawLine"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "LineTo " + endX + "," + endY + "; "; @@ -1191,7 +1217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawEllipse(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawEllipse"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "Ellipse " + width + "," + height + "; "; @@ -1200,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledEllipse(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledEllipse"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FillEllipse " + width + "," + height + "; "; @@ -1209,7 +1235,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawRectangle(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawRectangle"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "Rectangle " + width + "," + height + "; "; @@ -1218,7 +1244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledRectangle(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledRectangle"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FillRectangle " + width + "," + height + "; "; @@ -1227,7 +1253,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); + CheckThreatLevel(); m_host.AddScriptLPS(1); @@ -1246,7 +1272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) { - CheckThreatLevel(ThreatLevel.None, "osDrawPolygon"); + CheckThreatLevel(); m_host.AddScriptLPS(1); @@ -1265,7 +1291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetFontSize(string drawList, int fontSize) { - CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FontSize "+ fontSize +"; "; @@ -1274,7 +1300,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetFontName(string drawList, string fontName) { - CheckThreatLevel(ThreatLevel.None, "osSetFontName"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FontName "+ fontName +"; "; @@ -1283,7 +1309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenSize(string drawList, int penSize) { - CheckThreatLevel(ThreatLevel.None, "osSetPenSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenSize " + penSize + "; "; @@ -1292,7 +1318,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenColor(string drawList, string color) { - CheckThreatLevel(ThreatLevel.None, "osSetPenColor"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenColor " + color + "; "; @@ -1302,7 +1328,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Deprecated public string osSetPenColour(string drawList, string colour) { - CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); + CheckThreatLevel(); OSSLDeprecated("osSetPenColour", "osSetPenColor"); m_host.AddScriptLPS(1); @@ -1312,7 +1338,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenCap(string drawList, string direction, string type) { - CheckThreatLevel(ThreatLevel.None, "osSetPenCap"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenCap " + direction + "," + type + "; "; @@ -1321,7 +1347,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawImage(string drawList, int width, int height, string imageUrl) { - CheckThreatLevel(ThreatLevel.None, "osDrawImage"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c12490c..19cfcc1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -228,6 +228,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osDrawFilledRectangle(string drawList, int width, int height); string osDrawPolygon(string drawList, LSL_List x, LSL_List y); string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); + string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y); + string osDrawRotationTransform(string drawList, LSL_Float x); + string osDrawResetTransform(string drawList); string osSetFontName(string drawList, string fontName); string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 9bc3159..4b1f6d3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -386,6 +386,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); } + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + return m_OSSL_Functions.osDrawTranslationTransform(drawList, x, y); + } + + public string osDrawRotationTransform(string drawList, LSL_Float x) + { + return m_OSSL_Functions.osDrawRotationTransform(drawList, x); + } + + public string osDrawResetTransform(string drawList) + { + return m_OSSL_Functions.osDrawResetTransform(drawList); + } + public string osSetFontSize(string drawList, int fontSize) { return m_OSSL_Functions.osSetFontSize(drawList, fontSize); -- cgit v1.1 From 84abdf866a26401e48eff5b25a1ec7f7bf19dc3c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 25 Jun 2017 02:26:36 +0100 Subject: add respective ossl helper funtion osDrawScaleTransform(string drawList, LSL_Float x, LSL_Float y) --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 ++++++++++++++----- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 5 +++-- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 13 +++++++++---- 3 files changed, 26 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e93a7d7..dee195a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1154,12 +1154,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Texture draw functions - public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + public string osDrawResetTransform(string drawList) { CheckThreatLevel(); - m_host.AddScriptLPS(1); - drawList += "TransTransf " + x + "," + y + ";"; + drawList += "ResetTransf;"; return drawList; } @@ -1171,11 +1170,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } - public string osDrawResetTransform(string drawList) + public string osDrawScaleTransform(string drawList, LSL_Float x, LSL_Float y) { CheckThreatLevel(); + m_host.AddScriptLPS(1); - drawList += "ResetTransf;"; + drawList += "ScaleTransf " + x + "," + y + ";"; + return drawList; + } + + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + CheckThreatLevel(); + + m_host.AddScriptLPS(1); + drawList += "TransTransf " + x + "," + y + ";"; return drawList; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 19cfcc1..f7857da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -228,9 +228,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osDrawFilledRectangle(string drawList, int width, int height); string osDrawPolygon(string drawList, LSL_List x, LSL_List y); string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); - string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y); - string osDrawRotationTransform(string drawList, LSL_Float x); string osDrawResetTransform(string drawList); + string osDrawRotationTransform(string drawList, LSL_Float x); + string osDrawScaleTransform(string drawList, LSL_Float x, LSL_Float y); + string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y); string osSetFontName(string drawList, string fontName); string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 4b1f6d3..d6af32b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -386,9 +386,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); } - public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + public string osDrawResetTransform(string drawList) { - return m_OSSL_Functions.osDrawTranslationTransform(drawList, x, y); + return m_OSSL_Functions.osDrawResetTransform(drawList); } public string osDrawRotationTransform(string drawList, LSL_Float x) @@ -396,9 +396,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawRotationTransform(drawList, x); } - public string osDrawResetTransform(string drawList) + public string osDrawScaleTransform(string drawList, LSL_Float x, LSL_Float y) { - return m_OSSL_Functions.osDrawResetTransform(drawList); + return m_OSSL_Functions.osDrawScaleTransform(drawList, x, y); + } + + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + return m_OSSL_Functions.osDrawTranslationTransform(drawList, x, y); } public string osSetFontSize(string drawList, int fontSize) -- cgit v1.1 From 041854234429800d6ca10c4987c5d99185552fd6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 00:18:46 +0100 Subject: some shortcuts on local osTeleport, reduce its time penalty, do it with script thread --- .../Shared/Api/Implementation/OSSL_Api.cs | 102 ++++++++++----------- 1 file changed, 49 insertions(+), 53 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index dee195a..5339fc3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -859,41 +859,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionName, position, lookat, false); + TeleportAgent(agent, regionName, position, lookat); } private void TeleportAgent(string agent, string regionName, - LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) + LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { m_host.AddScriptLPS(1); - UUID agentId = new UUID(); + if(String.IsNullOrWhiteSpace(regionName)) + return; + + UUID agentId; if (UUID.TryParse(agent, out agentId)) { ScenePresence presence = World.GetScenePresence(agentId); - if (presence != null) - { - // For osTeleportAgent, agent must be over owners land to avoid abuse - // For osTeleportOwner, this restriction isn't necessary - - // commented out because its redundant and uneeded please remove eventually. - // if (relaxRestrictions || - // m_host.OwnerID - // == World.LandChannel.GetLandObject( - // presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) - // { - - // We will launch the teleport on a new thread so that when the script threads are terminated - // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting. - Util.FireAndForget( - o => World.RequestTeleportLocation( - presence.ControllingClient, regionName, position, - lookat, (uint)TPFlags.ViaLocation), - null, "OSSL_Api.TeleportAgentByRegionCoords"); - - ScriptSleep(5000); - - // } + if (presence == null || presence.IsDeleted || presence.IsInTransit) + return; + if(regionName == World.RegionInfo.RegionName) + { + // should be faster than going to threadpool + World.RequestTeleportLocation(presence.ControllingClient, regionName, position, + lookat, (uint)TPFlags.ViaLocation); + ScriptSleep(500); + } + else + { + // We will launch the teleport on a new thread so that when the script threads are terminated + // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting. + Util.FireAndForget( + o => World.RequestTeleportLocation( + presence.ControllingClient, regionName, position, + lookat, (uint)TPFlags.ViaLocation), + null, "OSSL_Api.TeleportAgentByRegionCoords"); + ScriptSleep(5000); } } } @@ -913,41 +912,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY); m_host.AddScriptLPS(1); - UUID agentId = new UUID(); + UUID agentId; if (UUID.TryParse(agent, out agentId)) { ScenePresence presence = World.GetScenePresence(agentId); - if (presence != null) - { - // For osTeleportAgent, agent must be over owners land to avoid abuse - // For osTeleportOwner, this restriction isn't necessary - - // commented out because its redundant and uneeded please remove eventually. - // if (relaxRestrictions || - // m_host.OwnerID - // == World.LandChannel.GetLandObject( - // presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) - // { - - // We will launch the teleport on a new thread so that when the script threads are terminated - // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting. - Util.FireAndForget( - o => World.RequestTeleportLocation( - presence.ControllingClient, regionHandle, - position, lookat, (uint)TPFlags.ViaLocation), - null, "OSSL_Api.TeleportAgentByRegionName"); - - ScriptSleep(5000); + if (presence == null || presence.IsDeleted || presence.IsInTransit) + return; - // } + Util.FireAndForget( + o => World.RequestTeleportLocation( + presence.ControllingClient, regionHandle, + position, lookat, (uint)TPFlags.ViaLocation), + null, "OSSL_Api.TeleportAgentByRegionName"); - } + ScriptSleep(5000); } } public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); + m_host.AddScriptLPS(1); + + UUID agentId; + if (UUID.TryParse(agent, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence == null || presence.IsDeleted || presence.IsInTransit) + 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) @@ -955,12 +951,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 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, true); + TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); } public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - osTeleportOwner(World.RegionInfo.RegionName, position, lookat); + osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); } public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) -- cgit v1.1 From 0c5f412ed40663689aad2aadf9313e0dd782f4ac Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 02:49:20 +0100 Subject: put back restriction that on osTeleport the target must be on land owned by the script owner or this is a estate manager/owner, or target did gave script permission. --- .../Shared/Api/Implementation/OSSL_Api.cs | 93 ++++++++++++++++++---- 1 file changed, 78 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5339fc3..ce48e63 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -852,6 +852,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); } + private bool checkAllowAgentTPbyLandOwner(UUID agentId, Vector3 pos) + { + if (m_item.PermsGranter == agentId) + { + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) + return true; + } + + ILandObject land = World.LandChannel.GetLandObject(pos); + if(land == null) + return true; + + LandData landdata = land.LandData; + if(landdata == null) + return true; + + UUID hostOwner = m_host.OwnerID; + + if(landdata.OwnerID == hostOwner) + return true; + + if(World.RegionInfo.EstateSettings != null && World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(hostOwner)) + return true; + + if(!landdata.IsGroupOwned) + return false; + + UUID landGroup = landdata.GroupID; + if(landGroup == UUID.Zero) + return false; + + if(landGroup == m_host.GroupID) + return true; + + return false; + } + // Teleport functions public void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { @@ -859,15 +896,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionName, position, lookat); + TeleportAgent(agent, regionName, position, lookat, true); } private void TeleportAgent(string agent, string regionName, - LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) { m_host.AddScriptLPS(1); - if(String.IsNullOrWhiteSpace(regionName)) - return; + if(String.IsNullOrEmpty(regionName)) + regionName = World.RegionInfo.RegionName; UUID agentId; if (UUID.TryParse(agent, out agentId)) @@ -876,6 +913,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null || presence.IsDeleted || presence.IsInTransit) return; + Vector3 pos = presence.AbsolutePosition; + if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + { + ScriptSleep(500); + return; + } + if(regionName == World.RegionInfo.RegionName) { // should be faster than going to threadpool @@ -903,15 +947,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionGridX, regionGridY, position, lookat, false); + TeleportAgent(agent, regionGridX, regionGridY, position, lookat, true); } private void TeleportAgent(string agent, int regionGridX, int regionGridY, - LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) + LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) { + m_host.AddScriptLPS(1); + ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY); - m_host.AddScriptLPS(1); UUID agentId; if (UUID.TryParse(agent, out agentId)) { @@ -919,6 +964,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null || presence.IsDeleted || presence.IsInTransit) return; + Vector3 pos = presence.AbsolutePosition; + if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + { + ScriptSleep(500); + return; + } + Util.FireAndForget( o => World.RequestTeleportLocation( presence.ControllingClient, regionHandle, @@ -931,8 +983,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - m_host.AddScriptLPS(1); + TeleportAgent(agent, position, lookat, true); + } + private void TeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) + { + m_host.AddScriptLPS(1); UUID agentId; if (UUID.TryParse(agent, out agentId)) { @@ -940,6 +996,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null || presence.IsDeleted || presence.IsInTransit) return; + Vector3 pos = presence.AbsolutePosition; + if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + { + ScriptSleep(500); + return; + } + World.RequestTeleportLocation(presence.ControllingClient, World.RegionInfo.RegionName, position, lookat, (uint)TPFlags.ViaLocation); ScriptSleep(500); @@ -951,19 +1014,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 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(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) - { - osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); + TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, false); } 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, true); + TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat, false); + } + + public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + TeleportAgent(m_host.OwnerID.ToString(), position, lookat, false); } /// -- cgit v1.1 From cbd0af3cab4c12aab0e149802d2b62aa35bd561b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 18:26:45 +0100 Subject: let osTeleport* always work on script prim owner --- .../Shared/Api/Implementation/OSSL_Api.cs | 32 ++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ce48e63..d665f69 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -854,6 +854,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private bool checkAllowAgentTPbyLandOwner(UUID agentId, Vector3 pos) { + UUID hostOwner = m_host.OwnerID; + + if(hostOwner == agentId) + return true; + if (m_item.PermsGranter == agentId) { if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) @@ -868,8 +873,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if(landdata == null) return true; - UUID hostOwner = m_host.OwnerID; - if(landdata.OwnerID == hostOwner) return true; @@ -896,11 +899,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionName, position, lookat, true); + TeleportAgent(agent, regionName, position, lookat); } private void TeleportAgent(string agent, string regionName, - LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) + LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { m_host.AddScriptLPS(1); if(String.IsNullOrEmpty(regionName)) @@ -914,7 +917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; Vector3 pos = presence.AbsolutePosition; - if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { ScriptSleep(500); return; @@ -947,11 +950,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionGridX, regionGridY, position, lookat, true); + TeleportAgent(agent, regionGridX, regionGridY, position, lookat); } private void TeleportAgent(string agent, int regionGridX, int regionGridY, - LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) + LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { m_host.AddScriptLPS(1); @@ -965,7 +968,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; Vector3 pos = presence.AbsolutePosition; - if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { ScriptSleep(500); return; @@ -983,11 +986,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - TeleportAgent(agent, position, lookat, true); - } - - private void TeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) - { m_host.AddScriptLPS(1); UUID agentId; if (UUID.TryParse(agent, out agentId)) @@ -997,7 +995,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; Vector3 pos = presence.AbsolutePosition; - if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) + if(!checkAllowAgentTPbyLandOwner(agentId, pos)) { ScriptSleep(500); return; @@ -1014,19 +1012,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 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, false); + 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, false); + TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat); } public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - TeleportAgent(m_host.OwnerID.ToString(), position, lookat, false); + osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); } /// -- cgit v1.1 From f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 19:40:20 +0100 Subject: add similar restrictions to osObjectTeleport :( --- .../Shared/Api/Implementation/OSSL_Api.cs | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d665f69..1a88529 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -876,7 +876,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if(landdata.OwnerID == hostOwner) return true; - if(World.RegionInfo.EstateSettings != null && World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(hostOwner)) + EstateSettings es = World.RegionInfo.EstateSettings; + if(es != null && es.IsEstateManagerOrOwner(hostOwner)) return true; if(!landdata.IsGroupOwned) @@ -4756,6 +4757,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero ); } + private bool checkAllowObjectTPbyLandOwner(Vector3 pos) + { + ILandObject land = World.LandChannel.GetLandObject(pos); + if(land == null) + return true; + + LandData landdata = land.LandData; + if(landdata == null) + return true; + + UUID hostOwner = m_host.OwnerID; + if(landdata.OwnerID == hostOwner) + return true; + + EstateSettings es = World.RegionInfo.EstateSettings; + if(es != null && es.IsEstateManagerOrOwner(hostOwner)) + return true; + + if(!landdata.IsGroupOwned) + return false; + + UUID landGroup = landdata.GroupID; + if(landGroup == UUID.Zero) + return false; + + if(landGroup == m_host.GroupID) + return true; + + return false; + } + /// /// teleports a object (full linkset) /// @@ -4785,9 +4817,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID); - if(sog== null || sog.IsDeleted) + if(sog== null || sog.IsDeleted || sog.inTransit) return -1; + if(sog.OwnerID != m_host.OwnerID) + { + Vector3 pos = sog.AbsolutePosition; + if(!checkAllowObjectTPbyLandOwner(pos)) + return -1; + } + UUID myid = m_host.ParentGroup.UUID; return sog.TeleportObject(myid, targetPos, rotation, flags); -- cgit v1.1 From b59ce7c96889d72ddad6babb75cf7b68c885e26c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 20:28:16 +0100 Subject: also on the actual source file --- .../Shared/Api/Implementation/OSSL_Api.cs | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1a88529..823a4e5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -517,13 +517,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetTerrainHeight(int x, int y) { - CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight"); + CheckThreatLevel(); return GetTerrainHeight(x, y); } public LSL_Float osTerrainGetHeight(int x, int y) { - CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); + CheckThreatLevel(); OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); return GetTerrainHeight(x, y); } @@ -1518,7 +1518,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public double osGetCurrentSunHour() { - CheckThreatLevel(ThreatLevel.None, "osGetCurrentSunHour"); + CheckThreatLevel(); m_host.AddScriptLPS(1); @@ -1544,7 +1544,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double osGetSunParam(string param) { - CheckThreatLevel(ThreatLevel.None, "osGetSunParam"); + CheckThreatLevel(); return GetSunParam(param); } @@ -1743,7 +1743,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // is not allowed to contain any. // This really should be removed. // - CheckThreatLevel(ThreatLevel.None, "osList2Double"); + CheckThreatLevel(); m_host.AddScriptLPS(1); if (index < 0) @@ -2818,7 +2818,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osIsNpc(LSL_Key npc) { - CheckThreatLevel(ThreatLevel.None, "osIsNpc"); + CheckThreatLevel(); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); @@ -3539,7 +3539,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Key osGetMapTexture() { - CheckThreatLevel(ThreatLevel.None, "osGetMapTexture"); +// CheckThreatLevel(ThreatLevel.None, "osGetMapTexture"); + CheckThreatLevel(); m_host.AddScriptLPS(1); return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); @@ -3597,7 +3598,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osGetRegionSize() { - CheckThreatLevel(ThreatLevel.None, "osGetRegionSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); Scene scene = m_ScriptEngine.World; @@ -3859,6 +3860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Item description public LSL_String osGetInventoryDesc(string item) { + CheckThreatLevel(); m_host.AddScriptLPS(1); lock (m_host.TaskInventory) @@ -4239,7 +4241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// 1 if thing is a valid UUID, 0 otherwise public LSL_Integer osIsUUID(string thing) { - CheckThreatLevel(ThreatLevel.None, "osIsUUID"); + CheckThreatLevel(); m_host.AddScriptLPS(1); UUID test; @@ -4254,7 +4256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Float osMin(double a, double b) { - CheckThreatLevel(ThreatLevel.None, "osMin"); + CheckThreatLevel(); m_host.AddScriptLPS(1); return Math.Min(a, b); @@ -4268,7 +4270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Float osMax(double a, double b) { - CheckThreatLevel(ThreatLevel.None, "osMax"); + CheckThreatLevel(); m_host.AddScriptLPS(1); return Math.Max(a, b); -- cgit v1.1 From e53f4399812224939e4ebec6790a9addb38cca95 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 20:42:49 +0100 Subject: add osGetNPCList() --- .../Shared/Api/Implementation/OSSL_Api.cs | 19 +++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 25 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 823a4e5..fa7ee21 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3835,6 +3835,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } + public LSL_List osGetNPCList() + { + CheckThreatLevel(ThreatLevel.None, "osGetNPCList"); + m_host.AddScriptLPS(1); + + LSL_List result = new LSL_List(); + World.ForEachRootScenePresence(delegate (ScenePresence avatar) + { + if (avatar != null && avatar.IsNPC) + { + result.Add(new LSL_String(avatar.UUID.ToString())); + result.Add(new LSL_Vector(avatar.AbsolutePosition)); + result.Add(new LSL_String(avatar.Name)); + } + }); + + return result; + } + /// /// Convert a unix time to a llGetTimestamp() like string /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index f7857da..6e6a0be 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -395,6 +395,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb); LSL_List osGetAvatarList(); + LSL_List osGetNPCList(); LSL_String osUnixTimeToTimestamp(long time); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index d6af32b..43113b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1041,6 +1041,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetAvatarList(); } + public LSL_List osGetNPCList() + { + return m_OSSL_Functions.osGetNPCList(); + } + public LSL_String osUnixTimeToTimestamp(long time) { return m_OSSL_Functions.osUnixTimeToTimestamp(time); -- cgit v1.1 From b319977a3f114442a0b8c93349f7d654745dc386 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 20:51:16 +0100 Subject: dont list deleted ones, that still don't know they are gone --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fa7ee21..ef511aa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3843,7 +3843,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) { - if (avatar != null && avatar.IsNPC) + // npcs are not childagents but that is now. + if (avatar != null && avatar.IsNPC && !avatar.IsDeleted && !avatar.IsChildAgent) { result.Add(new LSL_String(avatar.UUID.ToString())); result.Add(new LSL_Vector(avatar.AbsolutePosition)); -- cgit v1.1 From 5242853d684e2fbe81a28401809a19e3d57e1e51 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Jun 2017 20:55:44 +0100 Subject: dont list deleted ones, that still don't know they are gone --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ef511aa..f41f011 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3824,7 +3824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) { - if (avatar != null && avatar.UUID != m_host.OwnerID) + if (avatar != null && !avatar.IsDeleted && avatar.UUID != m_host.OwnerID ) { result.Add(new LSL_String(avatar.UUID.ToString())); result.Add(new LSL_Vector(avatar.AbsolutePosition)); @@ -3844,7 +3844,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.ForEachRootScenePresence(delegate (ScenePresence avatar) { // npcs are not childagents but that is now. - if (avatar != null && avatar.IsNPC && !avatar.IsDeleted && !avatar.IsChildAgent) + if (avatar != null && avatar.IsNPC && !avatar.IsDeleted && !avatar.IsChildAgent && !avatar.IsInTransit) { result.Add(new LSL_String(avatar.UUID.ToString())); result.Add(new LSL_Vector(avatar.AbsolutePosition)); -- cgit v1.1 From 936aee412d67edc0e143ab13213c5ee1cb1c2a0e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 27 Jun 2017 01:41:06 +0100 Subject: remove osGetAgentIP() this was not a good idea to have :( --- .../Shared/Api/Implementation/OSSL_Api.cs | 26 +--------------------- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 - .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 7 +----- 3 files changed, 2 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f41f011..a1fd7cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1080,31 +1080,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api targetID, part.SitTargetPosition); } - - // Functions that get information from the agent itself. - // - // osGetAgentIP - this is used to determine the IP address of - //the client. This is needed to help configure other in world - //resources based on the IP address of the clients connected. - //I think High is a good risk level for this, as it is an - //information leak. - public string osGetAgentIP(string agent) - { - CheckThreatLevel(ThreatLevel.High, "osGetAgentIP"); - - UUID avatarID = (UUID)agent; - - m_host.AddScriptLPS(1); - if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) - { - ScenePresence target = (ScenePresence)World.Entities[avatarID]; - return target.ControllingClient.RemoteEndPoint.Address.ToString(); - } - - // fall through case, just return nothing - return ""; - } - + // Get a list of all the avatars/agents in the region public LSL_List osGetAgents() { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6e6a0be..6be3c3f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -144,7 +144,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetParcelSIPAddress(string SIPAddress); // Avatar Info Commands - string osGetAgentIP(string agent); LSL_List osGetAgents(); // Teleport commands diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 43113b8..f5d2a3a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -277,12 +277,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osTeleportOwner(position, lookat); } - // Avatar info functions - public string osGetAgentIP(string agent) - { - return m_OSSL_Functions.osGetAgentIP(agent); - } - public LSL_List osGetAgents() { return m_OSSL_Functions.osGetAgents(); @@ -430,6 +424,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osSetPenColor(drawList, color); } + // Deprecated public string osSetPenColour(string drawList, string colour) { -- cgit v1.1 From e243dd05193a1edcb16f52b2514c41de70ff8006 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 28 Jun 2017 02:19:27 +0100 Subject: put back getAgentIP bug restricted, script owner must be a Administrator (god) --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 18 ++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 24 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a1fd7cd..b84065f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1097,6 +1097,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } + public string osGetAgentIP(string agent) + { + CheckThreatLevel(); // user god is the restriction + if(!(World.Permissions.IsGod(m_host.OwnerID))) + return ""; + + UUID avatarID = (UUID)agent; + + m_host.AddScriptLPS(1); + if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) + { + ScenePresence target = (ScenePresence)World.Entities[avatarID]; + return target.ControllingClient.RemoteEndPoint.Address.ToString(); + } + + // fall through case, just return nothing + return ""; + } // Adam's super super custom animation functions public void osAvatarPlayAnimation(string avatar, string animation) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6be3c3f..8f863af 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -145,6 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces // Avatar Info Commands LSL_List osGetAgents(); + string osGetAgentIP(string agent); // Teleport commands void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index f5d2a3a..42e7bfb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -282,6 +282,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetAgents(); } + public string osGetAgentIP(string agent) + { + return m_OSSL_Functions.osGetAgentIP(agent); + } + // Animation Functions public void osAvatarPlayAnimation(string avatar, string animation) -- cgit v1.1 From 6b0a3e981cc06e7935960a5a806222a2aa2126d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 30 Jun 2017 22:04:56 +0100 Subject: put osGetAgentIP() in threat control with level Severe so it can be disabled even for inworld administrators as needed on some grids. rearrage the osslEnable.ini file segregating the funtions only listed for information --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b84065f..1139579 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -452,7 +452,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID)) return( String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", @@ -1099,8 +1098,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetAgentIP(string agent) { - CheckThreatLevel(); // user god is the restriction - if(!(World.Permissions.IsGod(m_host.OwnerID))) + CheckThreatLevel(ThreatLevel.Severe, "osGetAgentIP"); + if(!(World.Permissions.IsGod(m_host.OwnerID))) // user god always needed return ""; UUID avatarID = (UUID)agent; @@ -1115,6 +1114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // fall through case, just return nothing return ""; } + // Adam's super super custom animation functions public void osAvatarPlayAnimation(string avatar, string animation) { @@ -1131,13 +1131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if(!UUID.TryParse(avatar, out avatarID)) return; - if(!World.Entities.ContainsKey(avatarID)) - return; - - ScenePresence target = null; - if ((World.Entities[avatarID] is ScenePresence)) - target = (ScenePresence)World.Entities[avatarID]; - + ScenePresence target = World.GetScenePresence(avatarID); if (target == null) return; @@ -1417,7 +1411,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) { - CheckThreatLevel(ThreatLevel.VeryLow, "osGetDrawStringSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); LSL_Vector vec = new LSL_Vector(0,0,0); -- cgit v1.1 From 965d004fbe2f3753ea915bab00c5ab08a54648ca Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 30 Jun 2017 22:39:19 +0100 Subject: do calls to m_host.AddScriptLPS() on the right place on osslm this stat is of course still wrong LPS does not mean api function calls --- .../Shared/Api/Implementation/OSSL_Api.cs | 224 ++------------------- 1 file changed, 16 insertions(+), 208 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1139579..22d247d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -264,6 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // for safe funtions always active public void CheckThreatLevel() { + m_host.AddScriptLPS(1); if (!m_OSFunctionsEnabled) OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws } @@ -271,6 +272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 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) OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws @@ -498,8 +500,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private LSL_Integer SetTerrainHeight(int x, int y, double val) { - m_host.AddScriptLPS(1); - if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) OSSLError("osSetTerrainHeight: Coordinate out of bounds"); @@ -529,7 +529,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private LSL_Float GetTerrainHeight(int x, int y) { - m_host.AddScriptLPS(1); if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) OSSLError("osGetTerrainHeight: Coordinate out of bounds"); @@ -539,7 +538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTerrainFlush() { CheckThreatLevel(ThreatLevel.VeryLow, "osTerrainFlush"); - m_host.AddScriptLPS(1); ITerrainModule terrainModule = World.RequestModuleInterface(); if (terrainModule != null) terrainModule.TaintTerrain(); @@ -556,7 +554,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); IRestartModule restartModule = World.RequestModuleInterface(); - m_host.AddScriptLPS(1); if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) { if (seconds < 15) @@ -579,7 +576,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); IRestartModule restartModule = World.RequestModuleInterface(); - m_host.AddScriptLPS(1); if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) { if (seconds < 15) @@ -630,8 +626,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); - m_host.AddScriptLPS(1); - IDialogModule dm = World.RequestModuleInterface(); if (dm != null) @@ -645,7 +639,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.VeryHigh, "osSetRot"); - m_host.AddScriptLPS(1); if (World.Entities.ContainsKey(target)) { EntityBase entity; @@ -671,7 +664,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURL"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -693,7 +685,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlend"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -715,7 +706,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -743,7 +733,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureData"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -773,7 +762,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlend"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -802,7 +790,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow , "osSetDynamicTextureDataBlendFace"); - m_host.AddScriptLPS(1); if (dynamicID == String.Empty) { IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -830,8 +817,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand"); - m_host.AddScriptLPS(1); - // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) { @@ -846,8 +831,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osSetPrimFloatOnWater"); - m_host.AddScriptLPS(1); - m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); } @@ -905,7 +888,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - m_host.AddScriptLPS(1); if(String.IsNullOrEmpty(regionName)) regionName = World.RegionInfo.RegionName; @@ -956,8 +938,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void TeleportAgent(string agent, int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - m_host.AddScriptLPS(1); - ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY); UUID agentId; @@ -986,7 +966,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { - m_host.AddScriptLPS(1); UUID agentId; if (UUID.TryParse(agent, out agentId)) { @@ -1024,6 +1003,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { + CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); + osTeleportAgent(m_host.OwnerID.ToString(), position, lookat); } @@ -1038,8 +1019,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); - m_host.AddScriptLPS(1); - ForceSit(avatar, m_host.UUID); } @@ -1053,8 +1032,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryHigh, "osForceOtherSit"); - m_host.AddScriptLPS(1); - UUID targetID = new UUID(target); ForceSit(avatar, targetID); @@ -1086,7 +1063,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // 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"); - m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate(ScenePresence sp) @@ -1104,7 +1080,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID avatarID = (UUID)agent; - m_host.AddScriptLPS(1); if (World.Entities.ContainsKey((UUID)agent) && World.Entities[avatarID] is ScenePresence) { ScenePresence target = (ScenePresence)World.Entities[avatarID]; @@ -1125,8 +1100,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void AvatarPlayAnimation(string avatar, string animation) { - m_host.AddScriptLPS(1); - UUID avatarID; if(!UUID.TryParse(avatar, out avatarID)) return; @@ -1167,8 +1140,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { UUID avatarID = (UUID)avatar; - m_host.AddScriptLPS(1); - // FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common // method (though see that doesn't do the is animation check, which is probably a bug) and have both // these functions call that common code. However, this does mean navigating the brain-dead requirement @@ -1203,7 +1174,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawResetTransform(string drawList) { CheckThreatLevel(); - m_host.AddScriptLPS(1); + drawList += "ResetTransf;"; return drawList; } @@ -1211,7 +1182,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawRotationTransform(string drawList, LSL_Float x) { CheckThreatLevel(); - m_host.AddScriptLPS(1); + drawList += "RotTransf " + x + ";"; return drawList; } @@ -1220,7 +1191,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "ScaleTransf " + x + "," + y + ";"; return drawList; } @@ -1229,7 +1199,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "TransTransf " + x + "," + y + ";"; return drawList; } @@ -1238,7 +1207,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "MoveTo " + x + "," + y + ";"; return drawList; } @@ -1247,7 +1215,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; return drawList; } @@ -1256,7 +1223,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "LineTo " + endX + "," + endY + "; "; return drawList; } @@ -1265,7 +1231,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.None, "osDrawText"); - m_host.AddScriptLPS(1); drawList += "Text " + text + "; "; return drawList; } @@ -1274,7 +1239,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "Ellipse " + width + "," + height + "; "; return drawList; } @@ -1283,7 +1247,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "FillEllipse " + width + "," + height + "; "; return drawList; } @@ -1292,7 +1255,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "Rectangle " + width + "," + height + "; "; return drawList; } @@ -1301,7 +1263,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "FillRectangle " + width + "," + height + "; "; return drawList; } @@ -1310,8 +1271,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); - if (x.Length != y.Length || x.Length < 3) { return ""; @@ -1329,8 +1288,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); - if (x.Length != y.Length || x.Length < 3) { return ""; @@ -1348,7 +1305,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "FontSize "+ fontSize +"; "; return drawList; } @@ -1357,7 +1313,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "FontName "+ fontName +"; "; return drawList; } @@ -1366,7 +1321,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "PenSize " + penSize + "; "; return drawList; } @@ -1375,7 +1329,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "PenColor " + color + "; "; return drawList; } @@ -1386,7 +1339,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api CheckThreatLevel(); OSSLDeprecated("osSetPenColour", "osSetPenColor"); - m_host.AddScriptLPS(1); drawList += "PenColour " + colour + "; "; return drawList; } @@ -1395,7 +1347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList += "PenCap " + direction + "," + type + "; "; return drawList; } @@ -1404,7 +1355,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; return drawList; } @@ -1412,7 +1362,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) { CheckThreatLevel(); - m_host.AddScriptLPS(1); LSL_Vector vec = new LSL_Vector(0,0,0); IDynamicTextureManager textureManager = World.RequestModuleInterface(); @@ -1435,7 +1384,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // should be removed // CheckThreatLevel(ThreatLevel.High, "osSetStateEvents"); - m_host.AddScriptLPS(1); m_host.SetScriptEvents(m_item.ItemID, events); } @@ -1444,8 +1392,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetRegionWaterHeight"); - m_host.AddScriptLPS(1); - World.EventManager.TriggerRequestChangeWaterHeight((float)height); } @@ -1459,8 +1405,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetRegionSunSettings"); - m_host.AddScriptLPS(1); - while (sunHour > 24.0) sunHour -= 24.0; @@ -1484,8 +1428,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetEstateSunSettings"); - m_host.AddScriptLPS(1); - while (sunHour > 24.0) sunHour -= 24.0; @@ -1508,8 +1450,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(); - m_host.AddScriptLPS(1); - // Must adjust for the fact that Region Sun Settings are still LL offset double sunHour = World.RegionInfo.RegionSettings.SunPosition - 6; @@ -1538,8 +1478,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private double GetSunParam(string param) { - m_host.AddScriptLPS(1); - double value = 0.0; ISunModule module = World.RequestModuleInterface(); @@ -1566,8 +1504,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetSunParam(string param, double value) { - m_host.AddScriptLPS(1); - ISunModule module = World.RequestModuleInterface(); if (module != null) { @@ -1578,7 +1514,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osWindActiveModelPluginName() { CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName"); - m_host.AddScriptLPS(1); IWindModule module = World.RequestModuleInterface(); if (module != null) @@ -1592,7 +1527,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetWindParam(string plugin, string param, LSL_Float value) { CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); - m_host.AddScriptLPS(1); IWindModule module = World.RequestModuleInterface(); if (module != null) @@ -1608,7 +1542,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetWindParam(string plugin, string param) { CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); - m_host.AddScriptLPS(1); IWindModule module = World.RequestModuleInterface(); if (module != null) @@ -1623,7 +1556,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2) { CheckThreatLevel(ThreatLevel.High, "osParcelJoin"); - m_host.AddScriptLPS(1); int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); @@ -1636,7 +1568,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) { CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide"); - m_host.AddScriptLPS(1); int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); @@ -1663,8 +1594,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName) { - m_host.AddScriptLPS(1); - // Get a reference to the land data and make sure the owner of the script // can modify it @@ -1733,7 +1662,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(); - m_host.AddScriptLPS(1); if (index < 0) { index = src.Length + index; @@ -1751,8 +1679,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); - m_host.AddScriptLPS(1); - ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (land.LandData.OwnerID != m_host.OwnerID) @@ -1767,8 +1693,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress"); - m_host.AddScriptLPS(1); - ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); if (land.LandData.OwnerID != m_host.OwnerID) @@ -1795,8 +1719,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.High, "osGetScriptEngineName"); - m_host.AddScriptLPS(1); - int scriptEngineNameIndex = 0; if (!String.IsNullOrEmpty(m_ScriptEngine.ScriptEngineName)) @@ -1822,7 +1744,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osCheckODE() { CheckThreatLevel(); - m_host.AddScriptLPS(1); LSL_Integer ret = 0; // false if (m_ScriptEngine.World.PhysicsScene != null) @@ -1846,6 +1767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // about the physics engine, this function returns an empty string if // 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"))) @@ -1865,7 +1787,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetPhysicsEngineName() { CheckThreatLevel(); - m_host.AddScriptLPS(1); string ret = "NoEngine"; if (m_ScriptEngine.World.PhysicsScene != null) @@ -1886,7 +1807,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // kiddie) // CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion"); - m_host.AddScriptLPS(1); return m_ScriptEngine.World.GetSimulatorVersion(); } @@ -1932,8 +1852,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); - m_host.AddScriptLPS(1); - try { OSD decoded = OSDParser.DeserializeJson(JSON); @@ -1950,8 +1868,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.None, "osParseJSON"); - m_host.AddScriptLPS(1); - Object decoded = osParseJSONNew(JSON); if ( decoded is Hashtable ) { @@ -1982,7 +1898,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osMessageObject(LSL_Key objectUUID, string message) { CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); - m_host.AddScriptLPS(1); UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead. @@ -2023,7 +1938,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // if this is restricted to objects rezzed by this host level can be reduced CheckThreatLevel(ThreatLevel.Low, "osDie"); - m_host.AddScriptLPS(1); UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) @@ -2073,7 +1987,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osMakeNotecard(string notecardName, LSL_Types.list contents) { CheckThreatLevel(ThreatLevel.High, "osMakeNotecard"); - m_host.AddScriptLPS(1); StringBuilder notecardData = new StringBuilder(); @@ -2259,7 +2172,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetNotecardLine(string name, int line) { CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine"); - m_host.AddScriptLPS(1); UUID assetID = CacheNotecard(name); @@ -2287,7 +2199,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetNotecard(string name) { CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard"); - m_host.AddScriptLPS(1); string text = LoadNotecard(name); @@ -2317,7 +2228,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public int osGetNumberOfNotecardLines(string name) { CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines"); - m_host.AddScriptLPS(1); UUID assetID = CacheNotecard(name); @@ -2333,7 +2243,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osAvatarName2Key(string firstname, string lastname) { CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); - m_host.AddScriptLPS(1); IUserManagement userManager = World.RequestModuleInterface(); if (userManager == null) @@ -2385,7 +2294,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osKey2Name(string id) { CheckThreatLevel(ThreatLevel.Low, "osKey2Name"); - m_host.AddScriptLPS(1); UUID key = new UUID(); @@ -2495,7 +2403,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridNick() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick"); - m_host.AddScriptLPS(1); string nick = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2512,7 +2419,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridName() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName"); - m_host.AddScriptLPS(1); string name = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2529,7 +2435,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridLoginURI() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI"); - m_host.AddScriptLPS(1); string loginURI = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2546,7 +2451,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridHomeURI() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); - m_host.AddScriptLPS(1); IConfigSource config = m_ScriptEngine.ConfigSource; string HomeURI = Util.GetConfigVarFromSections(config, "HomeURI", @@ -2568,7 +2472,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridGatekeeperURI() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI"); - m_host.AddScriptLPS(1); IConfigSource config = m_ScriptEngine.ConfigSource; string gatekeeperURI = Util.GetConfigVarFromSections(config, "GatekeeperURI", @@ -2587,7 +2490,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetGridCustom(string key) { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); - m_host.AddScriptLPS(1); string retval = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; @@ -2604,7 +2506,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osGetAvatarHomeURI(string uuid) { CheckThreatLevel(ThreatLevel.Low, "osGetAvatarHomeURI"); - m_host.AddScriptLPS(1); IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface(); string returnValue = ""; @@ -2637,7 +2538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osFormatString(string str, LSL_List strings) { CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString"); - m_host.AddScriptLPS(1); return String.Format(str, strings.Data); } @@ -2645,7 +2545,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osMatchString(string src, string pattern, int start) { CheckThreatLevel(ThreatLevel.VeryLow, "osMatchString"); - m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); @@ -2687,7 +2586,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"); - m_host.AddScriptLPS(1); // Normalize indices (if negative). // After normlaization they may still be @@ -2712,7 +2610,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osLoadedCreationDate() { CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); - m_host.AddScriptLPS(1); return World.RegionInfo.RegionSettings.LoadedCreationDate; } @@ -2720,7 +2617,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osLoadedCreationTime() { CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationTime"); - m_host.AddScriptLPS(1); return World.RegionInfo.RegionSettings.LoadedCreationTime; } @@ -2728,7 +2624,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osLoadedCreationID() { CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationID"); - m_host.AddScriptLPS(1); return World.RegionInfo.RegionSettings.LoadedCreationID; } @@ -2749,7 +2644,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules) { CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams"); - m_host.AddScriptLPS(1); + InitLSL(); // One needs to cast m_LSL_Api because we're using functions not // on the ILSL_Api interface. @@ -2778,8 +2673,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink"); - m_host.AddScriptLPS(1); - InitLSL(); ((LSL_Api)m_LSL_Api).CreateLink(target, parent); } @@ -2788,8 +2681,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink"); - m_host.AddScriptLPS(1); - InitLSL(); ((LSL_Api)m_LSL_Api).BreakLink(linknum); } @@ -2798,8 +2689,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks"); - m_host.AddScriptLPS(1); - InitLSL(); ((LSL_Api)m_LSL_Api).BreakAllLinks(); } @@ -2807,7 +2696,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osIsNpc(LSL_Key npc) { CheckThreatLevel(); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -2824,7 +2712,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) { CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); - m_host.AddScriptLPS(1); // have to get the npc module also here to set the default Not Owned INPCModule module = World.RequestModuleInterface(); @@ -2839,7 +2726,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"); - m_host.AddScriptLPS(1); return NpcCreate( firstname, lastname, position, notecard, @@ -2982,7 +2868,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) { CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); @@ -3004,7 +2889,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcLoadAppearance(LSL_Key npc, string notecard) { CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); @@ -3036,7 +2920,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcGetOwner(LSL_Key npc) { CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3058,7 +2941,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osNpcGetPos(LSL_Key npc) { CheckThreatLevel(ThreatLevel.High, "osNpcGetPos"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3082,7 +2964,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) { CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3101,7 +2982,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options) { CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3126,7 +3006,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Rotation osNpcGetRot(LSL_Key npc) { CheckThreatLevel(ThreatLevel.High, "osNpcGetRot"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3150,7 +3029,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) { CheckThreatLevel(ThreatLevel.High, "osNpcSetRot"); - m_host.AddScriptLPS(1); INPCModule npcModule = World.RequestModuleInterface(); if (npcModule != null) @@ -3172,7 +3050,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStopMoveToTarget(LSL_Key npc) { CheckThreatLevel(ThreatLevel.High, "osNpcStopMoveToTarget"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3189,7 +3066,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3208,7 +3084,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileImage(LSL_Key npc, string image) { CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3242,7 +3117,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSay(LSL_Key npc, int channel, string message) { CheckThreatLevel(ThreatLevel.High, "osNpcSay"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3259,7 +3133,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcShout(LSL_Key npc, int channel, string message) { CheckThreatLevel(ThreatLevel.High, "osNpcShout"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3276,7 +3149,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSit(LSL_Key npc, LSL_Key target, int options) { CheckThreatLevel(ThreatLevel.High, "osNpcSit"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3293,7 +3165,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStand(LSL_Key npc) { CheckThreatLevel(ThreatLevel.High, "osNpcStand"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3310,7 +3181,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcRemove(LSL_Key npc) { CheckThreatLevel(ThreatLevel.High, "osNpcRemove"); - m_host.AddScriptLPS(1); try { @@ -3331,7 +3201,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcPlayAnimation(LSL_Key npc, string animation) { CheckThreatLevel(ThreatLevel.High, "osNpcPlayAnimation"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3346,7 +3215,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcStopAnimation(LSL_Key npc, string animation) { CheckThreatLevel(ThreatLevel.High, "osNpcStopAnimation"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3361,7 +3229,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcWhisper(LSL_Key npc, int channel, string message) { CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); if (module != null) @@ -3378,7 +3245,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"); - m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); int linkNum = link_num.value; @@ -3423,7 +3289,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osOwnerSaveAppearance(string notecard) { CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); - m_host.AddScriptLPS(1); return SaveAppearanceToNotecard(m_host.OwnerID, notecard); } @@ -3431,7 +3296,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) { CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); - m_host.AddScriptLPS(1); return SaveAppearanceToNotecard(avatarId, notecard); } @@ -3484,7 +3348,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osGetGender(LSL_Key rawAvatarId) { CheckThreatLevel(ThreatLevel.None, "osGetGender"); - m_host.AddScriptLPS(1); UUID avatarId; if (!UUID.TryParse(rawAvatarId, out avatarId)) @@ -3527,9 +3390,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public LSL_Key osGetMapTexture() { -// CheckThreatLevel(ThreatLevel.None, "osGetMapTexture"); CheckThreatLevel(); - m_host.AddScriptLPS(1); return m_ScriptEngine.World.RegionInfo.RegionSettings.TerrainImageID.ToString(); } @@ -3542,7 +3403,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osGetRegionMapTexture(string regionName) { CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture"); - m_host.AddScriptLPS(1); Scene scene = m_ScriptEngine.World; UUID key = UUID.Zero; @@ -3573,7 +3433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetRegionStats() { CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); - m_host.AddScriptLPS(1); + LSL_List ret = new LSL_List(); float[] stats = World.StatsReporter.LastReportedSimStats; @@ -3587,7 +3447,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector osGetRegionSize() { CheckThreatLevel(); - m_host.AddScriptLPS(1); Scene scene = m_ScriptEngine.World; RegionInfo reg = World.RegionInfo; @@ -3599,7 +3458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public int osGetSimulatorMemory() { CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); - m_host.AddScriptLPS(1); + long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; if (pws > Int32.MaxValue) @@ -3613,7 +3472,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetSpeed(string UUID, LSL_Float SpeedModifier) { CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); - m_host.AddScriptLPS(1); + ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); if (avatar != null) @@ -3623,7 +3482,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osKickAvatar(string FirstName, string SurName, string alert) { CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); - m_host.AddScriptLPS(1); World.ForEachRootScenePresence(delegate(ScenePresence sp) { @@ -3642,7 +3500,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetHealth(string avatar) { CheckThreatLevel(ThreatLevel.None, "osGetHealth"); - m_host.AddScriptLPS(1); LSL_Float health = new LSL_Float(-1); ScenePresence presence = World.GetScenePresence(new UUID(avatar)); @@ -3654,7 +3511,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osCauseDamage(string avatar, double damage) { CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); - m_host.AddScriptLPS(1); UUID avatarId = new UUID(avatar); Vector3 pos = m_host.GetWorldPosition(); @@ -3682,7 +3538,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osCauseHealing(string avatar, double healing) { CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); - m_host.AddScriptLPS(1); UUID avatarId = new UUID(avatar); ScenePresence presence = World.GetScenePresence(avatarId); @@ -3702,7 +3557,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetHealth(string avatar, double health) { CheckThreatLevel(ThreatLevel.High, "osSetHealth"); - m_host.AddScriptLPS(1); UUID avatarId = new UUID(avatar); ScenePresence presence = World.GetScenePresence(avatarId); @@ -3721,7 +3575,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetHealRate(string avatar, double healrate) { CheckThreatLevel(ThreatLevel.High, "osSetHealRate"); - m_host.AddScriptLPS(1); UUID avatarId = new UUID(avatar); ScenePresence presence = World.GetScenePresence(avatarId); @@ -3733,7 +3586,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osGetHealRate(string avatar) { CheckThreatLevel(ThreatLevel.None, "osGetHealRate"); - m_host.AddScriptLPS(1); LSL_Float rate = new LSL_Float(0); ScenePresence presence = World.GetScenePresence(new UUID(avatar)); @@ -3745,18 +3597,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) { CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); - m_host.AddScriptLPS(1); - InitLSL(); + InitLSL(); return m_LSL_Api.GetPrimitiveParamsEx(prim, rules); } public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) { CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); - m_host.AddScriptLPS(1); - InitLSL(); + InitLSL(); m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); } @@ -3765,8 +3615,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) { - CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); - osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb); } @@ -3776,7 +3624,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) { CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); - m_host.AddScriptLPS(1); SceneObjectPart obj = null; if (prim == UUID.Zero.ToString()) @@ -3807,7 +3654,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetAvatarList() { CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); - m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) @@ -3826,7 +3672,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetNPCList() { CheckThreatLevel(ThreatLevel.None, "osGetNPCList"); - m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); World.ForEachRootScenePresence(delegate (ScenePresence avatar) @@ -3851,7 +3696,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osUnixTimeToTimestamp(long time) { CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); - m_host.AddScriptLPS(1); long baseTicks = 621355968000000000; long tickResolution = 10000000; @@ -3869,7 +3713,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osGetInventoryDesc(string item) { CheckThreatLevel(); - m_host.AddScriptLPS(1); lock (m_host.TaskInventory) { @@ -3893,7 +3736,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osInviteToGroup(LSL_Key agentId) { CheckThreatLevel(ThreatLevel.VeryLow, "osInviteToGroup"); - m_host.AddScriptLPS(1); UUID agent = new UUID(agentId); @@ -3928,7 +3770,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osEjectFromGroup(LSL_Key agentId) { CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup"); - m_host.AddScriptLPS(1); UUID agent = new UUID(agentId); @@ -3964,7 +3805,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture"); - m_host.AddScriptLPS(1); //Check to make sure that the script's owner is the estate manager/master //World.Permissions.GenericEstatePermission( if (World.Permissions.IsGod(m_host.OwnerID)) @@ -3994,7 +3834,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight"); - m_host.AddScriptLPS(1); //Check to make sure that the script's owner is the estate manager/master //World.Permissions.GenericEstatePermission( if (World.Permissions.IsGod(m_host.OwnerID)) @@ -4015,8 +3854,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); - m_host.AddScriptLPS(1); - InitLSL(); ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint); } @@ -4025,8 +3862,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory"); - m_host.AddScriptLPS(1); - ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint); } @@ -4034,8 +3869,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.VeryHigh, "osForceAttachToOtherAvatarFromInventory"); - m_host.AddScriptLPS(1); - UUID avatarId; if (!UUID.TryParse(rawAvatarId, out avatarId)) @@ -4095,8 +3928,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); - m_host.AddScriptLPS(1); - InitLSL(); ((LSL_Api)m_LSL_Api).DetachFromAvatar(); } @@ -4105,8 +3936,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments"); - m_host.AddScriptLPS(1); - UUID targetUUID; ScenePresence target; LSL_List resp = new LSL_List(); @@ -4140,7 +3969,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options) { CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments"); - m_host.AddScriptLPS(1); UUID targetUUID; if(!UUID.TryParse(avatar.ToString(), out targetUUID)) @@ -4250,7 +4078,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osIsUUID(string thing) { CheckThreatLevel(); - m_host.AddScriptLPS(1); UUID test; return UUID.TryParse(thing, out test) ? 1 : 0; @@ -4265,7 +4092,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osMin(double a, double b) { CheckThreatLevel(); - m_host.AddScriptLPS(1); return Math.Min(a, b); } @@ -4279,7 +4105,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float osMax(double a, double b) { CheckThreatLevel(); - m_host.AddScriptLPS(1); return Math.Max(a, b); } @@ -4287,7 +4112,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osGetRezzingObject() { CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); - m_host.AddScriptLPS(1); + UUID rezID = m_host.ParentGroup.RezzerID; if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null) return new LSL_Key(UUID.Zero.ToString()); @@ -4312,7 +4137,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// boolean indicating whether an error was shouted. protected bool ShoutErrorOnLackingOwnerPerms(int perms, string errorPrefix) { - m_host.AddScriptLPS(1); bool fail = false; if (m_item.PermsGranter != m_host.OwnerID) { @@ -4363,7 +4187,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osDropAttachment() { CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); - m_host.AddScriptLPS(1); DropAttachment(true); } @@ -4371,7 +4194,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osForceDropAttachment() { CheckThreatLevel(ThreatLevel.High, "osForceDropAttachment"); - m_host.AddScriptLPS(1); DropAttachment(false); } @@ -4379,7 +4201,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) { CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachmentAt"); - m_host.AddScriptLPS(1); DropAttachmentAt(true, pos, rot); } @@ -4387,7 +4208,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) { CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt"); - m_host.AddScriptLPS(1); DropAttachmentAt(false, pos, rot); } @@ -4395,7 +4215,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield) { CheckThreatLevel(ThreatLevel.Low, "osListenRegex"); - m_host.AddScriptLPS(1); + UUID keyID; UUID.TryParse(ID, out keyID); @@ -4443,7 +4263,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osRegexIsMatch(string input, string pattern) { CheckThreatLevel(ThreatLevel.Low, "osRegexIsMatch"); - m_host.AddScriptLPS(1); + try { return Regex.IsMatch(input, pattern) ? 1 : 0; @@ -4458,7 +4278,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osRequestURL(LSL_List options) { CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL"); - m_host.AddScriptLPS(1); Hashtable opts = new Hashtable(); for (int i = 0 ; i < options.Length ; i++) @@ -4476,7 +4295,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String osRequestSecureURL(LSL_List options) { CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL"); - m_host.AddScriptLPS(1); Hashtable opts = new Hashtable(); for (int i = 0 ; i < options.Length ; i++) @@ -4494,7 +4312,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osCollisionSound(string impact_sound, double impact_volume) { CheckThreatLevel(); - m_host.AddScriptLPS(1); if(impact_sound == "") { @@ -4527,7 +4344,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osVolumeDetect(int detect) { CheckThreatLevel(); - m_host.AddScriptLPS(1); if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment) return; @@ -4550,7 +4366,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List osGetInertiaData() { CheckThreatLevel(); - m_host.AddScriptLPS(1); LSL_List result = new LSL_List(); float TotalMass; @@ -4598,7 +4413,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot) { CheckThreatLevel(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) @@ -4637,7 +4451,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot) { CheckThreatLevel(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) @@ -4679,7 +4492,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass) { CheckThreatLevel(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) @@ -4719,7 +4531,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(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) @@ -4758,7 +4569,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osClearInertia() { CheckThreatLevel(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) @@ -4817,7 +4627,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"); - m_host.AddScriptLPS(1); UUID objUUID; if (!UUID.TryParse(objectUUID, out objUUID)) @@ -4846,7 +4655,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer osGetLinkNumber(LSL_String name) { CheckThreatLevel(); - m_host.AddScriptLPS(1); SceneObjectGroup sog = m_host.ParentGroup; if(sog== null || sog.IsDeleted) -- cgit v1.1 From 72bce8c4b41406e8f19e263be634f2434bc54765 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 11 Jul 2017 02:33:48 +0100 Subject: do lsl object rez checks on script thread before wasting time possible creating a new poll thread --- .../Shared/Api/Implementation/LSL_Api.cs | 40 ++++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index af88e4f..f4b7aa3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3534,32 +3534,34 @@ 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 (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) + return; - Util.FireAndForget(x => - { - if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) - return; + float dist = (float)llVecDist(llGetPos(), pos); - float dist = (float)llVecDist(llGetPos(), pos); + if (dist > m_ScriptDistanceFactor * 10.0f) + return; - if (dist > m_ScriptDistanceFactor * 10.0f) - return; + TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory); - TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory); + if (item == null) + { + Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); + return; + } - if (item == null) - { - Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); - return; - } + if (item.InvType != (int)InventoryType.Object) + { + Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); + return; + } - if (item.InvType != (int)InventoryType.Object) - { - Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); - return; - } + Util.FireAndForget(x => + { - List new_groups = World.RezObject(m_host, item, pos, rot, vel, param, atRoot); + Quaternion wrot = rot; + wrot.Normalize(); + List new_groups = World.RezObject(m_host, item, pos, wrot, vel, param, atRoot); // If either of these are null, then there was an unknown error. if (new_groups == null) -- cgit v1.1 From f5324833eeff9d99caf437fc47b920e616699de1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 11 Jul 2017 02:47:37 +0100 Subject: remove wrong comment on lsl object rez. we can't add delays on async process --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f4b7aa3..c13e8b2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3598,9 +3598,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } - // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) - } - + } }, null, "LSL_Api.doObjectRez"); //ScriptSleep((int)((groupmass * velmag) / 10)); -- cgit v1.1 From c8a9b0321f1e3ea724d8230ea1106b8bfd682fc3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 01:44:34 +0100 Subject: osSetParcelDetails: place hard restrictions on change owner,claimdate (both estate owner or manager) and group (same plus parcel owner that also needes to be a member of the new group); add PARCEL_DETAILS_SEE_AVATARS, PARCEL_DETAILS_ANY_AVATAR_SOUNDS and PARCEL_DETAILS_GROUP_SOUNDS --- .../Shared/Api/Implementation/OSSL_Api.cs | 115 ++++++++++++++++++--- .../Shared/Api/Runtime/LSL_Constants.cs | 4 +- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 3 +- 3 files changed, 103 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 22d247d..4bf8729 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1606,13 +1606,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions, false)) { - OSSLShoutError("You do not have permission to modify the parcel"); + OSSLShoutError("script owner does not have permission to modify the parcel"); return; } // Create a new land data object we can modify LandData newLand = startLandObject.LandData.Copy(); UUID uuid; + EstateSettings es = World.RegionInfo.EstateSettings; + + bool changed = false; // Process the rules, not sure what the impact would be of changing owner or group for (int idx = 0; idx < rules.Length;) @@ -1622,35 +1625,115 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api switch (code) { case ScriptBaseClass.PARCEL_DETAILS_NAME: - newLand.Name = arg; + if(newLand.Name != arg) + { + newLand.Name = arg; + changed = true; + } break; case ScriptBaseClass.PARCEL_DETAILS_DESC: - newLand.Description = arg; + if(newLand.Description != arg) + { + newLand.Description = arg; + changed = true; + } break; case ScriptBaseClass.PARCEL_DETAILS_OWNER: - CheckThreatLevel(ThreatLevel.VeryHigh, functionName); - if (UUID.TryParse(arg, out uuid)) - newLand.OwnerID = uuid; + if(es != null && !es.IsEstateManagerOrOwner(m_host.OwnerID)) + { + OSSLError("script owner does not have permission to modify the parcel owner"); + } + else + { + if (UUID.TryParse(arg, out uuid)) + { + if(newLand.OwnerID != uuid) + { + changed = true; + newLand.OwnerID = uuid; + newLand.GroupID = UUID.Zero; + } + } + } break; case ScriptBaseClass.PARCEL_DETAILS_GROUP: - CheckThreatLevel(ThreatLevel.VeryHigh, functionName); - if (UUID.TryParse(arg, out uuid)) - newLand.GroupID = uuid; + if(m_host.OwnerID == newLand.OwnerID || es == null || es.IsEstateManagerOrOwner(m_host.OwnerID)) + { + if (UUID.TryParse(arg, out uuid)) + { + if(newLand.GroupID != uuid) + { + IGroupsModule groupsModule = m_ScriptEngine.World.RequestModuleInterface(); + GroupMembershipData member = null; + if (groupsModule != null) + member = groupsModule.GetMembershipData(uuid, newLand.OwnerID); + if (member == null) + OSSLError(string.Format("land owner is not member of the new group for parcel")); + else + { + changed = true; + newLand.GroupID = uuid; + } + } + } + } + else + { + OSSLError("script owner does not have permission to modify the parcel group"); + } break; case ScriptBaseClass.PARCEL_DETAILS_CLAIMDATE: - CheckThreatLevel(ThreatLevel.VeryHigh, functionName); - newLand.ClaimDate = Convert.ToInt32(arg); - if (newLand.ClaimDate == 0) - newLand.ClaimDate = Util.UnixTimeSinceEpoch(); + if(es != null && !es.IsEstateManagerOrOwner(m_host.OwnerID)) + { + OSSLError("script owner does not have permission to modify the parcel CLAIM DATE"); + } + else + { + int date = Convert.ToInt32(arg); + if (date == 0) + date = Util.UnixTimeSinceEpoch(); + if(newLand.ClaimDate != date) + { + changed = true; + newLand.ClaimDate = date; + } + } break; - } - } - World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); + case ScriptBaseClass.PARCEL_DETAILS_SEE_AVATARS: + bool newavs = (Convert.ToInt32(arg) != 0); + if(newLand.SeeAVs != newavs) + { + changed = true; + newLand.SeeAVs = newavs; + } + break; + + case ScriptBaseClass.PARCEL_DETAILS_ANY_AVATAR_SOUNDS: + bool newavsounds = (Convert.ToInt32(arg) != 0); + if(newLand.AnyAVSounds != newavsounds) + { + changed = true; + newLand.AnyAVSounds = newavsounds; + } + break; + + case ScriptBaseClass.PARCEL_DETAILS_GROUP_SOUNDS: + bool newgrpsounds = (Convert.ToInt32(arg) != 0); + if(newLand.GroupAVSounds != newgrpsounds) + { + changed = true; + newLand.GroupAVSounds = newgrpsounds; + } + break; + } + } + if(changed) + World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); } public double osList2Double(LSL_Types.list src, int index) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index a277f6c..e4c1ca0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -697,7 +697,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PARCEL_DETAILS_GROUP = 3; public const int PARCEL_DETAILS_AREA = 4; public const int PARCEL_DETAILS_ID = 5; - public const int PARCEL_DETAILS_SEE_AVATARS = 6; // not implemented + public const int PARCEL_DETAILS_SEE_AVATARS = 6; + public const int PARCEL_DETAILS_ANY_AVATAR_SOUNDS = 7; + public const int PARCEL_DETAILS_GROUP_SOUNDS = 8; //osSetParcelDetails public const int PARCEL_DETAILS_CLAIMDATE = 10; diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 4d7a698..8780e49 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -39,7 +39,6 @@ using OMV_Quaternion = OpenMetaverse.Quaternion; namespace OpenSim.Region.ScriptEngine.Shared { - [Serializable] public partial class LSL_Types { // Types are kept is separate .dll to avoid having to add whatever .dll it is in it to script AppDomain @@ -526,7 +525,7 @@ namespace OpenSim.Region.ScriptEngine.Shared } [Serializable] - public class list + public class list: MarshalByRefObject { private object[] m_data; -- cgit v1.1 From 3847f861e39a6792b7b6063289dabb9911580d71 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 01:52:01 +0100 Subject: osSetParcelDetails: allow parcel group to be cleared also --- .../Shared/Api/Implementation/OSSL_Api.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4bf8729..4aac9a0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1666,17 +1666,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if(newLand.GroupID != uuid) { - IGroupsModule groupsModule = m_ScriptEngine.World.RequestModuleInterface(); - GroupMembershipData member = null; - if (groupsModule != null) - member = groupsModule.GetMembershipData(uuid, newLand.OwnerID); - if (member == null) - OSSLError(string.Format("land owner is not member of the new group for parcel")); - else + if(uuid == UUID.Zero) { changed = true; newLand.GroupID = uuid; } + else + { + IGroupsModule groupsModule = m_ScriptEngine.World.RequestModuleInterface(); + GroupMembershipData member = null; + if (groupsModule != null) + member = groupsModule.GetMembershipData(uuid, newLand.OwnerID); + if (member == null) + OSSLError(string.Format("land owner is not member of the new group for parcel")); + else + { + changed = true; + newLand.GroupID = uuid; + } + } } } } -- cgit v1.1 From a069ed09a82bfe07ef84a78202f502ed3b312134 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 03:47:34 +0100 Subject: osSetParcelDetails: make seeAVs send updates. This is a temporary patch, this function does need to call a framework land function that deos issue proper updates about all fields to all cleints. ( sounds will not stop/start also for now) --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4aac9a0..f274cd3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1616,6 +1616,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api EstateSettings es = World.RegionInfo.EstateSettings; bool changed = false; + bool changedSeeAvs = false; // Process the rules, not sure what the impact would be of changing owner or group for (int idx = 0; idx < rules.Length;) @@ -1717,6 +1718,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if(newLand.SeeAVs != newavs) { changed = true; + changedSeeAvs = true; newLand.SeeAVs = newavs; } break; @@ -1741,7 +1743,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } if(changed) + { World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); + + if(changedSeeAvs) + { + UUID parcelID= newLand.GlobalID; + World.ForEachScenePresence(delegate (ScenePresence avatar) + { + if (avatar != null && !avatar.IsDeleted && avatar.currentParcelUUID == parcelID ) + avatar.currentParcelUUID = parcelID; // force parcel flags review + }); + } + } + } public double osList2Double(LSL_Types.list src, int index) -- cgit v1.1 From aff9c345dddfa290222ceaf42b6c452a590a2276 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 07:27:21 +0100 Subject: osSetParcelDetails: add more land update code --- .../Shared/Api/Implementation/OSSL_Api.cs | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f274cd3..79367fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1617,6 +1617,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool changed = false; bool changedSeeAvs = false; + bool changedoverlay = false; + bool changedneedupdate = false; // Process the rules, not sure what the impact would be of changing owner or group for (int idx = 0; idx < rules.Length;) @@ -1719,6 +1721,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { changed = true; changedSeeAvs = true; + changedoverlay = true; + changedneedupdate = true; newLand.SeeAVs = newavs; } break; @@ -1744,19 +1748,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if(changed) { - World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); + World.LandChannel.UpdateLandObject(newLand.LocalID, newLand); - if(changedSeeAvs) + if(changedneedupdate) { UUID parcelID= newLand.GlobalID; - World.ForEachScenePresence(delegate (ScenePresence avatar) + World.ForEachRootScenePresence(delegate (ScenePresence avatar) { - if (avatar != null && !avatar.IsDeleted && avatar.currentParcelUUID == parcelID ) + if (avatar == null || avatar.IsDeleted || avatar.IsInTransit) + return; + + if(changedSeeAvs && avatar.currentParcelUUID == parcelID ) avatar.currentParcelUUID = parcelID; // force parcel flags review + + if(avatar.ControllingClient == null) + return; + + // this will be needed for some things like damage etc +// if(avatar.currentParcelUUID == parcelID) +// startLandObject.SendLandUpdateToClient(avatar.ControllingClient); + + if(changedoverlay && !avatar.IsNPC) + World.LandChannel.SendParcelsOverlay(avatar.ControllingClient); }); } } - } public double osList2Double(LSL_Types.list src, int index) -- cgit v1.1