From 397aa74777bc0c54ecd9e1b286e59e9de0a4f3c2 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 1 Jan 2013 23:07:37 -0500 Subject: [PATCH 01/10] * Fixes the attachment scripted rotation bug. The problem is the code was relying on m_host.ParentId = 0 to determine if the attachment should be rotated against root prim offset. To fix it for attachments, we also need to check if the host's localID == RootPart's localID. otherwise we are cumulatively rotating against the host's root part rotation offset (which in this case, is it's own rotation) --- .../Shared/Api/Implementation/LSL_Api.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7ff30ca844..a559683d51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2353,8 +2353,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); + + SceneObjectPart rootPart = m_host.ParentGroup.RootPart; + + + // Teravus: if (m_host.ParentID == 0) is bug code because the ParentID for the Avatar will cause this to be nonzero for root prim attachments + // which is then treated like a child prim rotation and it's offset gets cumulatively multiplied against. + // to fix the scripted rotations we also have to check to see if the root part localid is the same as the host's localid. + // RootPart != null should shortcircuit + // try to let this work as in SL... - if (m_host.ParentID == 0) + if (m_host.ParentID == 0 ) //|| (rootPart != null && m_host.LocalId == rootPart.LocalId)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); @@ -2362,7 +2371,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. - SceneObjectPart rootPart = m_host.ParentGroup.RootPart; + if (rootPart != null) // better safe than sorry { SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); From f9148e5fc7178fe24323a67d8e26ba4a04a4a9e3 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 1 Jan 2013 23:11:46 -0500 Subject: [PATCH 02/10] * This is actually the fix described the last commit.. I had commented it out to see if the problem had affected all attachments or just HUD attachments. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a559683d51..1fe095ba9e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2363,7 +2363,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // RootPart != null should shortcircuit // try to let this work as in SL... - if (m_host.ParentID == 0 ) //|| (rootPart != null && m_host.LocalId == rootPart.LocalId)) + if (m_host.ParentID == 0 || (rootPart != null && m_host.LocalId == rootPart.LocalId)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); From 92c26e49947040a212db85ac4f59e5ba7f395856 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 1 Jan 2013 23:55:24 -0500 Subject: [PATCH 03/10] * ubit pointed out another place where that check needed to be updated and I normalized it. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1fe095ba9e..7e77b0f9f4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2354,16 +2354,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); - SceneObjectPart rootPart = m_host.ParentGroup.RootPart; - - // Teravus: if (m_host.ParentID == 0) is bug code because the ParentID for the Avatar will cause this to be nonzero for root prim attachments // which is then treated like a child prim rotation and it's offset gets cumulatively multiplied against. // to fix the scripted rotations we also have to check to see if the root part localid is the same as the host's localid. // RootPart != null should shortcircuit // try to let this work as in SL... - if (m_host.ParentID == 0 || (rootPart != null && m_host.LocalId == rootPart.LocalId)) + if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); @@ -2371,7 +2368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. - + SceneObjectPart rootPart = m_host.ParentGroup.RootPart; if (rootPart != null) // better safe than sorry { SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); @@ -7920,7 +7917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Rotation q = rules.GetQuaternionItem(idx++); // try to let this work as in SL... - if (part.ParentID == 0) + if (part.ParentID == 0 || (part.ParentGroup != null && part == part.ParentGroup.RootPart)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(part, q); From 0a393b317dd6449e5a4ebbfc41dd3c8f4d9b2092 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 22:32:39 +0100 Subject: [PATCH 04/10] Add the new UpdateAgentInformation cap to make maturity on more recent viewers work. --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index f6146a9171..b06788b199 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -103,6 +103,7 @@ namespace OpenSim.Region.ClientStack.Linden private static readonly string m_getObjectPhysicsDataPath = "0101/"; private static readonly string m_getObjectCostPath = "0102/"; private static readonly string m_ResourceCostSelectedPath = "0103/"; + private static readonly string m_UpdateAgentInformationPath = "0500/"; // These are callbacks which will be setup by the scene so that we can update scene data when we @@ -287,6 +288,8 @@ namespace OpenSim.Region.ClientStack.Linden m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler); IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected); m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler); + IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler("POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation); + m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); m_HostCapsObj.RegisterHandler( "CopyInventoryFromNotecard", @@ -1438,6 +1441,22 @@ namespace OpenSim.Region.ClientStack.Linden string response = OSDParser.SerializeLLSDXmlString(resp); return response; } + + public string UpdateAgentInformation(string request, string path, + string param, IOSHttpRequest httpRequest, + IOSHttpResponse httpResponse) + { + OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); + OSDMap resp = new OSDMap(); + + OSDMap accessPrefs = new OSDMap(); + accessPrefs["max"] = "A"; + + resp["access_prefs"] = accessPrefs; + + string response = OSDParser.SerializeLLSDXmlString(resp); + return response; + } } public class AssetUploader From ab053df706055b0aa8fe2d10f89488be97d36841 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 23:01:09 +0100 Subject: [PATCH 05/10] Prevent empty Anim Packs --- .../Framework/Scenes/Animation/AnimationSet.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 65ae445950..d2fc7f1273 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -164,7 +164,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation { int defaultSize = 0; if (m_defaultAnimation.AnimID != UUID.Zero) + { defaultSize++; + } + else if (m_animations.Count == 0) + { + defaultSize++; + } animIDs = new UUID[m_animations.Count + defaultSize]; sequenceNums = new int[m_animations.Count + defaultSize]; @@ -176,6 +182,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_defaultAnimation.ObjectID; } + else if (m_animations.Count == 0) + { + animIDs[0] = m_implicitDefaultAnimation.AnimID; + sequenceNums[0] = m_defaultAnimation.SequenceNum; + objectIDs[0] = m_implicitDefaultAnimation.ObjectID; + } for (int i = 0; i < m_animations.Count; ++i) { From 8f37f2ca7edd408f30165fef9817375a9813ce90 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 8 Jan 2013 23:24:34 +0100 Subject: [PATCH 06/10] Fix sequence id fr default anim --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index d2fc7f1273..64c31f88b2 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation else if (m_animations.Count == 0) { animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_defaultAnimation.SequenceNum; + sequenceNums[0] = m_implicitDefaultAnimation.SequenceNum; objectIDs[0] = m_implicitDefaultAnimation.ObjectID; } From be844030ce75907a85ff00cdac4d9b706ccc3101 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jan 2013 00:10:57 +0100 Subject: [PATCH 07/10] Revert "Fix sequence id fr default anim" This reverts commit 8f37f2ca7edd408f30165fef9817375a9813ce90. --- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 64c31f88b2..d2fc7f1273 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation else if (m_animations.Count == 0) { animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_implicitDefaultAnimation.SequenceNum; + sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_implicitDefaultAnimation.ObjectID; } From 92db4ef0686d0cce11cf23de926352ace0104bb7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jan 2013 00:11:08 +0100 Subject: [PATCH 08/10] Revert "Prevent empty Anim Packs" This reverts commit ab053df706055b0aa8fe2d10f89488be97d36841. --- .../Framework/Scenes/Animation/AnimationSet.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index d2fc7f1273..65ae445950 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -164,13 +164,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation { int defaultSize = 0; if (m_defaultAnimation.AnimID != UUID.Zero) - { defaultSize++; - } - else if (m_animations.Count == 0) - { - defaultSize++; - } animIDs = new UUID[m_animations.Count + defaultSize]; sequenceNums = new int[m_animations.Count + defaultSize]; @@ -182,12 +176,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation sequenceNums[0] = m_defaultAnimation.SequenceNum; objectIDs[0] = m_defaultAnimation.ObjectID; } - else if (m_animations.Count == 0) - { - animIDs[0] = m_implicitDefaultAnimation.AnimID; - sequenceNums[0] = m_defaultAnimation.SequenceNum; - objectIDs[0] = m_implicitDefaultAnimation.ObjectID; - } for (int i = 0; i < m_animations.Count; ++i) { From 27b0914681f715d2dd270030ac1bfa5f726bf787 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jan 2013 16:01:00 +0100 Subject: [PATCH 09/10] Prevent a null ref in llGetLinkPrimiteveParams. Still not a fix for the real issue. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7e77b0f9f4..267a175c93 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8750,7 +8750,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api remaining = GetPrimParams(avatar, rules, ref res); } - if (remaining != null && remaining.Length > 0) + if ((object)remaining != null && remaining.Length > 0) { linknumber = remaining.GetLSLIntegerItem(0); rules = remaining.GetSublist(1, -1); From b5282810180a548d0c29892a38388c379105c13b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 9 Jan 2013 17:01:09 +0000 Subject: [PATCH 10/10] stop endless loop in lGetLinkPrimitiveParams --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 267a175c93..faa92dcd8f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8755,6 +8755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api linknumber = remaining.GetLSLIntegerItem(0); rules = remaining.GetSublist(1, -1); } + else + break; } return res;