From 07d6a0385fdbb0559a878f0884505459e08e7867 Mon Sep 17 00:00:00 2001 From: Talun Date: Tue, 10 Sep 2013 10:56:34 +0100 Subject: 6762: llList2Key fails to convert a string in a list to a key llGetPrimitiveParams changed to return the sculpty key as an LSL_String so that type checking in llList2Key will work --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 34e2b4d..924f4d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8483,7 +8483,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case ScriptBaseClass.PRIM_TYPE_SCULPT: - res.Add(Shape.SculptTexture.ToString()); + res.Add(new LSL_String(Shape.SculptTexture.ToString())); res.Add(new LSL_Integer(Shape.SculptType)); break; -- cgit v1.1 From 60cf42cb8dda3931c87267c989eb7bb9abe5da2f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Sep 2013 22:56:08 +0100 Subject: Make llGetLinkPrimitiveParams() abort and return existing list of params when it encounters an invalid link number, rather than throwing an exception Addresses http://opensimulator.org/mantis/view.php?id=6768 Thanks to talun for the patch on that commit - in the end I took a different approach that also deals with invalid PRIM_LINK_TARGET However, not yet generating the same warning on invalid PRIM_LINK_TARGET as seen on LL grid This commit also adds regression tests for some cases of llGetLinkPrimitiveParams() --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 924f4d9..bd451a5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8190,6 +8190,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api while (true) { +// m_log.DebugFormat( +// "[LSL API]: GetEntityParams has {0} rules with scene entity named {1}", +// rules.Length, entity != null ? entity.Name : "NULL"); + + if (entity == null) + return result; + if (entity is SceneObjectPart) remaining = GetPrimParams((SceneObjectPart)entity, rules, ref result); else @@ -8400,7 +8407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api while (idx < rules.Length) { int code = (int)rules.GetLSLIntegerItem(idx++); - int remain = rules.Length-idx; + int remain = rules.Length - idx; switch (code) { @@ -8777,7 +8784,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api )); break; case (int)ScriptBaseClass.PRIM_LINK_TARGET: - if(remain < 3) + + // TODO: Should be issuing a runtime script warning in this case. + if (remain < 3) return null; return rules.GetSublist(idx, -1); -- cgit v1.1 From f99dae03cb1f5ab7215de1f7741befc3f0856840 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Sep 2013 23:00:40 +0100 Subject: Fix bug where using PRIM_LINK_TARGET with only two remaining list items (e.g. link number then PRIM_ROTATION) would not return the parameter Extended regression test for this case --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bd451a5..975bf2d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8202,7 +8202,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else remaining = GetAgentParams((ScenePresence)entity, rules, ref result); - if (remaining == null || remaining.Length <= 2) + if (remaining == null || remaining.Length < 2) return result; int linknumber = remaining.GetLSLIntegerItem(0); @@ -8786,7 +8786,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_LINK_TARGET: // TODO: Should be issuing a runtime script warning in this case. - if (remain < 3) + if (remain < 2) return null; return rules.GetSublist(idx, -1); -- cgit v1.1 From b16bc7b01ca0691758e66f85238d657f02271082 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Sep 2013 19:14:21 +0100 Subject: refactor: rename Scene.IncomingCloseAgent() to CloseAgent() in order to make it clear that all non-clientstack callers should be using this rather than RemoveClient() in order to step through the ScenePresence state machine properly. Adds IScene.CloseAgent() to replace RemoveClient() --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 415166a..f4d5562 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2964,7 +2964,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api sp.ControllingClient.Kick(alert); // ...and close on our side - sp.Scene.IncomingCloseAgent(sp.UUID, false); + sp.Scene.CloseAgent(sp.UUID, false); } }); } -- cgit v1.1