From f7b88d1c40ba06c62491d8d32809fe6c1c4d360d Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sun, 2 Sep 2012 13:43:16 +0100 Subject: [PATCH 01/13] made setting rotation match Second Life --- .../Shared/Api/Implementation/LSL_Api.cs | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index be22cb4fee..9f952d10a9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,23 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); - - // try to let this work as in SL... - if (m_host.ParentID == 0) - { - // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); - } - 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); - } - } - ScriptSleep(200); } @@ -7292,22 +7276,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_ROTATION: + case (int)ScriptBaseClass.PRIM_ROT_LOCAL: if (remain < 1) return null; LSL_Rotation q = rules.GetQuaternionItem(idx++); - // try to let this work as in SL... - if (part.ParentID == 0) - { - // special case: If we are root, rotate complete SOG to new rotation SetRot(part, q); - } - 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 = part.ParentGroup.RootPart; - SetRot(part, rootPart.RotationOffset * (Quaternion)q); - } break; @@ -7614,11 +7588,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string primDesc = rules.GetLSLStringItem(idx++); part.Description = primDesc; break; - case (int)ScriptBaseClass.PRIM_ROT_LOCAL: - if (remain < 1) - return null; - SetRot(part, rules.GetQuaternionItem(idx++)); - break; case (int)ScriptBaseClass.PRIM_OMEGA: if (remain < 3) return null; From a3d140b57c5e2ae0f3334d59b82e116d40199b49 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sun, 2 Sep 2012 13:45:42 +0100 Subject: [PATCH 02/13] no need to assign rotation to a variable now --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 +-- 1 file changed, 1 insertion(+), 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 9f952d10a9..6f4bc8b1ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7280,8 +7280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - LSL_Rotation q = rules.GetQuaternionItem(idx++); - SetRot(part, q); + SetRot(part, rules.GetQuaternionItem(idx++)); break; From fb211c64fd9d335f4879549023870b1e28416f74 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sun, 2 Sep 2012 13:47:18 +0100 Subject: [PATCH 03/13] formatting --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 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 6f4bc8b1ea..1d2ef40367 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,7 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); - SetRot(m_host, rot); + SetRot(m_host, rot); ScriptSleep(200); } @@ -7280,7 +7280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - SetRot(part, rules.GetQuaternionItem(idx++)); + SetRot(part, rules.GetQuaternionItem(idx++)); break; From 359f9efc768d701460491b64b75660bf3c145419 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:51:54 +0100 Subject: [PATCH 04/13] Revert "formatting" This reverts commit fb211c64fd9d335f4879549023870b1e28416f74. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 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 1d2ef40367..6f4bc8b1ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,7 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); - SetRot(m_host, rot); + SetRot(m_host, rot); ScriptSleep(200); } @@ -7280,7 +7280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - SetRot(part, rules.GetQuaternionItem(idx++)); + SetRot(part, rules.GetQuaternionItem(idx++)); break; From 29218cdb3169b70e047acc372433769ece3ffae1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:52:03 +0100 Subject: [PATCH 05/13] Revert "no need to assign rotation to a variable now" This reverts commit a3d140b57c5e2ae0f3334d59b82e116d40199b49. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 ++- 1 file changed, 2 insertions(+), 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 6f4bc8b1ea..9f952d10a9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7280,7 +7280,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (remain < 1) return null; - SetRot(part, rules.GetQuaternionItem(idx++)); + LSL_Rotation q = rules.GetQuaternionItem(idx++); + SetRot(part, q); break; From d297eb39e57f9dc70abe43839e263af19b5777e2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Sep 2012 21:52:12 +0100 Subject: [PATCH 06/13] Revert "made setting rotation match Second Life" Second Life seems to have introduced a bug, as we have confirmation that SL behavior changed recently and changed in contradiction to their stated intention This appears to be another of the bugs SL is notorious for. Signpost and I have decided to back this out until SL's intention becomes clear. This reverts commit f7b88d1c40ba06c62491d8d32809fe6c1c4d360d. --- .../Shared/Api/Implementation/LSL_Api.cs | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 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 9f952d10a9..be22cb4fee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2083,7 +2083,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetRot(LSL_Rotation rot) { m_host.AddScriptLPS(1); + + // try to let this work as in SL... + if (m_host.ParentID == 0) + { + // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); + } + 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); + } + } + ScriptSleep(200); } @@ -7276,12 +7292,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_ROTATION: - case (int)ScriptBaseClass.PRIM_ROT_LOCAL: if (remain < 1) return null; LSL_Rotation q = rules.GetQuaternionItem(idx++); + // try to let this work as in SL... + if (part.ParentID == 0) + { + // special case: If we are root, rotate complete SOG to new rotation SetRot(part, q); + } + 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 = part.ParentGroup.RootPart; + SetRot(part, rootPart.RotationOffset * (Quaternion)q); + } break; @@ -7588,6 +7614,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string primDesc = rules.GetLSLStringItem(idx++); part.Description = primDesc; break; + case (int)ScriptBaseClass.PRIM_ROT_LOCAL: + if (remain < 1) + return null; + SetRot(part, rules.GetQuaternionItem(idx++)); + break; case (int)ScriptBaseClass.PRIM_OMEGA: if (remain < 3) return null; From 663bfbb372218af6e2a854a011152c9efdb82eaa Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:18:36 +0100 Subject: [PATCH 07/13] although the attachmentPoint argument is a uint, zero is not a valid attachment point --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5bf69ad64e..22d3289b13 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3418,7 +3418,9 @@ namespace OpenSim.Region.Framework.Scenes public List GetAttachments(uint attachmentPoint) { List attachments = new List(); - + + if (attachmentPoint >= 0) + { lock (m_attachments) { foreach (SceneObjectGroup so in m_attachments) @@ -3427,6 +3429,7 @@ namespace OpenSim.Region.Framework.Scenes attachments.Add(so); } } + } return attachments; } From 8d431c63594b7576fe295d50658531e81df2ac4e Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:20:07 +0100 Subject: [PATCH 08/13] formatting --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 22d3289b13..1222ac6bcf 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3421,15 +3421,15 @@ namespace OpenSim.Region.Framework.Scenes if (attachmentPoint >= 0) { - lock (m_attachments) - { - foreach (SceneObjectGroup so in m_attachments) + lock (m_attachments) { - if (attachmentPoint == so.AttachmentPoint) - attachments.Add(so); + foreach (SceneObjectGroup so in m_attachments) + { + if (attachmentPoint == so.AttachmentPoint) + attachments.Add(so); + } } } - } return attachments; } From a858c5daee64223355de04b77746142be0f5795f Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:39:49 +0100 Subject: [PATCH 09/13] implementing a function to get the number of attachments worn --- .../Shared/Api/Implementation/OSSL_Api.cs | 38 +++++++++++++++++++ .../Shared/Api/Interface/IOSSL_Api.cs | 10 +++++ .../Shared/Api/Runtime/OSSL_Stub.cs | 7 ++++ 3 files changed, 55 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e245684a43..57f1e65b06 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3313,6 +3313,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ((LSL_Api)m_LSL_Api).DetachFromAvatar(); } + public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints) + { + CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments"); + + m_host.AddScriptLPS(1); + + UUID targetUUID; + ScenePresence target; + LSL_List resp = new LSL_List(); + + if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target)) + { + foreach (object point in attachmentPoints.Data) + { + LSL_Integer ipoint = new LSL_Integer( + (point is LSL_Integer || point is int || point is uint) ? + (int)point : + 0 + ); + resp.Add(ipoint); + if (ipoint == 0) + { + // indicates zero attachments + resp.Add(new LSL_Integer(0)); + } + else + { + // gets the number of attachments on the attachment point + resp.Add(new LSL_Integer(target.GetAttachments((uint)ipoint).Count)); + } + } + } + + return resp; + } + + #endregion + /// /// Checks if thing is a UUID. /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 06729abe36..6db6443d56 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -192,6 +192,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces /// Nothing happens if the object is not attached. void osForceDetachFromAvatar(); + /// + /// Returns a strided list of the specified attachment points and the number of attachments on those points. + /// + /// avatar UUID + /// list of ATTACH_* constants + /// + LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints); + + #endregion + //texture draw functions string osMovePen(string drawList, int x, int y); string osDrawLine(string drawList, int startX, int startY, int endX, int endY); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index ba1ade2285..230c378586 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -311,6 +311,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osForceDetachFromAvatar(); } + public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints) + { + return m_OSSL_Functions.osGetNumberOfAttachments(avatar, attachmentPoints); + } + + #endregion + // Texture Draw functions public string osMovePen(string drawList, int x, int y) From d4b8a13a1d63c950feba694eca53df06f2cc5792 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:43:04 +0100 Subject: [PATCH 10/13] refactoring the grunt work of MessageObject into a private method with a UUID argument --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 57f1e65b06..82114b3690 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1673,6 +1673,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } + MessageObject(objUUID, message); + } + + private void MessageObject(UUID objUUID, string message) + { object[] resobj = new object[] { new LSL_Types.LSLString(m_host.UUID.ToString()), new LSL_Types.LSLString(message) }; SceneObjectPart sceneOP = World.GetSceneObjectPart(objUUID); From ff867b59cf59fdab19413cd46f3dd04058fbf3c7 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:44:11 +0100 Subject: [PATCH 11/13] Implementing functing to send messages directly to attachments --- .../Shared/Api/Implementation/OSSL_Api.cs | 131 ++++++++++++++++++ .../Shared/Api/Interface/IOSSL_Api.cs | 13 ++ .../Shared/Api/Runtime/LSL_Constants.cs | 52 +++++++ .../Shared/Api/Runtime/OSSL_Stub.cs | 5 + 4 files changed, 201 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 82114b3690..8e80b4c61d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3354,6 +3354,137 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return resp; } + public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options) + { + CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments"); + m_host.AddScriptLPS(1); + + UUID targetUUID; + ScenePresence target; + + if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target)) + { + List aps = new List(); + foreach (object point in attachmentPoints.Data) + { + int ipoint; + if (int.TryParse(point.ToString(), out ipoint)) + { + aps.Add(ipoint); + } + } + + List attachments = new List(); + + bool msgAll = aps.Contains(ScriptBaseClass.OS_ATTACH_MSG_ALL); + bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0; + + if (msgAll && invertPoints) + { + return; + } + else if (msgAll || invertPoints) + { + attachments = target.GetAttachments(); + } + else + { + foreach (int point in aps) + { + if (point > 0) + { + attachments.AddRange(target.GetAttachments((uint)point)); + } + } + } + + // if we have no attachments at this point, exit now + if (attachments.Count == 0) + { + return; + } + + List ignoreThese = new List(); + + if (invertPoints) + { + foreach (SceneObjectGroup attachment in attachments) + { + if (aps.Contains((int)attachment.AttachmentPoint)) + { + ignoreThese.Add(attachment); + } + } + } + + foreach (SceneObjectGroup attachment in ignoreThese) + { + attachments.Remove(attachment); + } + ignoreThese.Clear(); + + // if inverting removed all attachments to check, exit now + if (attachments.Count < 1) + { + return; + } + + if ((options & ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0) + { + foreach (SceneObjectGroup attachment in attachments) + { + if (attachment.RootPart.CreatorID != m_host.CreatorID) + { + ignoreThese.Add(attachment); + } + } + + foreach (SceneObjectGroup attachment in ignoreThese) + { + attachments.Remove(attachment); + } + ignoreThese.Clear(); + + // if filtering by same object creator removed all + // attachments to check, exit now + if (attachments.Count == 0) + { + return; + } + } + + if ((options & ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0) + { + foreach (SceneObjectGroup attachment in attachments) + { + if (attachment.RootPart.CreatorID != m_item.CreatorID) + { + ignoreThese.Add(attachment); + } + } + + foreach (SceneObjectGroup attachment in ignoreThese) + { + attachments.Remove(attachment); + } + ignoreThese.Clear(); + + // if filtering by object creator must match originating + // script creator removed all attachments to check, + // exit now + if (attachments.Count == 0) + { + return; + } + } + + foreach (SceneObjectGroup attachment in attachments) + { + MessageObject(attachment.RootPart.UUID, message); + } + } + } + #endregion /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 6db6443d56..bde7a8eecc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -200,6 +200,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces /// LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints); + /// + /// Sends a specified message to the specified avatar's attachments on + /// the specified attachment points. + /// + /// + /// Behaves as osMessageObject(), without the sending script needing to know the attachment keys in advance. + /// + /// avatar UUID + /// message string + /// list of ATTACH_* constants, or -1 for all attachments. If -1 is specified and OS_ATTACH_MSG_INVERT_POINTS is present in flags, no action is taken. + /// flags further constraining the attachments to deliver the message to. + void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int flags); + #endregion //texture draw functions diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index cad8518473..60a7e1433f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -237,6 +237,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int ATTACH_HUD_BOTTOM = 37; public const int ATTACH_HUD_BOTTOM_RIGHT = 38; + #region osMessageAttachments constants + + /// + /// Instructs osMessageAttachements to send the message to attachments + /// on every point. + /// + /// + /// One might expect this to be named OS_ATTACH_ALL, but then one might + /// also expect functions designed to attach or detach or get + /// attachments to work with it too. Attaching a no-copy item to + /// many attachments could be dangerous. + /// when combined with OS_ATTACH_MSG_INVERT_POINTS, will prevent the + /// message from being sent. + /// if combined with OS_ATTACH_MSG_OBJECT_CREATOR or + /// OS_ATTACH_MSG_SCRIPT_CREATOR, could result in no message being + /// sent- this is expected behaviour. + /// + public const int OS_ATTACH_MSG_ALL = -65535; + + /// + /// Instructs osMessageAttachements to invert how the attachment points + /// list should be treated (e.g. go from inclusive operation to + /// exclusive operation). + /// + /// + /// This might be used if you want to deliver a message to one set of + /// attachments and a different message to everything else. With + /// this flag, you only need to build one explicit list for both calls. + /// + public const int OS_ATTACH_MSG_INVERT_POINTS = 1; + + /// + /// Instructs osMessageAttachments to only send the message to + /// attachments with a CreatorID that matches the host object CreatorID + /// + /// + /// This would be used if distributed in an object vendor/updater server. + /// + public const int OS_ATTACH_MSG_OBJECT_CREATOR = 2; + + /// + /// Instructs osMessageAttachments to only send the message to + /// attachments with a CreatorID that matches the sending script CreatorID + /// + /// + /// This might be used if the script is distributed independently of a + /// containing object. + /// + public const int OS_ATTACH_MSG_SCRIPT_CREATOR = 4; + + #endregion + public const int LAND_LEVEL = 0; public const int LAND_RAISE = 1; public const int LAND_LOWER = 2; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 230c378586..08ebfd6318 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -316,6 +316,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetNumberOfAttachments(avatar, attachmentPoints); } + public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int flags) + { + m_OSSL_Functions.osMessageAttachments(avatar, message, attachmentPoints, flags); + } + #endregion // Texture Draw functions From 07dbe46ba3c2b949c9da34eaa80d7e1afd68fece Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 1 Sep 2012 02:45:07 +0100 Subject: [PATCH 12/13] wrapping attachment functions in a region --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 ++ OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 8e80b4c61d..2e1e5b669d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3229,6 +3229,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + #region Attachment commands + public void osForceAttachToAvatar(int attachmentPoint) { CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index bde7a8eecc..3985e6629c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -157,7 +157,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osAvatarPlayAnimation(string avatar, string animation); void osAvatarStopAnimation(string avatar, string animation); - // Attachment commands + #region Attachment commands /// /// Attach the object containing this script to the avatar that owns it without asking for PERMISSION_ATTACH diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 08ebfd6318..52ca3da154 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -289,7 +289,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osAvatarStopAnimation(avatar, animation); } - // Avatar functions + #region Attachment commands public void osForceAttachToAvatar(int attachmentPoint) { From 15d5f3d09d140a0850d968fd3b738afc0b1f3985 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Sep 2012 00:11:14 +0100 Subject: [PATCH 13/13] Bump master code up to 0.7.5 now that 0.7.4 is out. --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 5f01788b62..c9d977008c 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -29,7 +29,7 @@ namespace OpenSim { public class VersionInfo { - private const string VERSION_NUMBER = "0.7.4"; + private const string VERSION_NUMBER = "0.7.5"; private const Flavour VERSION_FLAVOUR = Flavour.Dev; public enum Flavour