From de19dc3024e5359f594d0a32c593d905163c24ea Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Sep 2011 18:58:58 +0100 Subject: refactor: rename SOG/SOP.GetProperties() to SendPropertiesToClient() to reflect what it actually does This also makes it consistent with some other methods that send data to the client. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cf8517d..070cdc0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3591,7 +3591,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api parentPrim.ScheduleGroupForFullUpdate(); if (client != null) - parentPrim.GetProperties(client); + parentPrim.SendPropertiesToClient(client); ScriptSleep(1000); } -- cgit v1.1 From 528fcede6c31c056c3863fd19528558fcbaf475f Mon Sep 17 00:00:00 2001 From: Pixel Tomsen Date: Mon, 26 Sep 2011 20:18:06 +0200 Subject: llAvatarOnLinkSitTarget Implementation http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 ++++++++++++++ .../Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 1 + OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++++ 3 files changed, 20 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 070cdc0..39da563 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6296,6 +6296,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return m_host.GetAvatarOnSitTarget().ToString(); } + // http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget + public LSL_String llAvatarOnLinkSitTarget(int linknum) + { + m_host.AddScriptLPS(1); + if(linknum == ScriptBaseClass.LINK_SET || + linknum == ScriptBaseClass.LINK_ALL_CHILDREN || + linknum == ScriptBaseClass.LINK_ALL_OTHERS) return UUID.Zero.ToString(); + + List parts = GetLinkParts(linknum); + if (parts.Count == 0) return UUID.Zero.ToString(); + return parts[0].SitTargetAvatar.ToString(); + } + + public void llAddToLandPassList(string avatar, double hours) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 4d7d60d..62e2854 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -54,6 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float llAtan2(double x, double y); void llAttachToAvatar(int attachment); LSL_Key llAvatarOnSitTarget(); + LSL_Key llAvatarOnLinkSitTarget(int linknum); LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up); LSL_Rotation llAxisAngle2Rot(LSL_Vector axis, double angle); LSL_Integer llBase64ToInteger(string str); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 96e46fd..508f33b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -129,6 +129,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_LSL_Functions.llAvatarOnSitTarget(); } + public LSL_Key llAvatarOnLinkSitTarget(int linknum) + { + return m_LSL_Functions.llAvatarOnLinkSitTarget(linknum); + } + public LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up) { return m_LSL_Functions.llAxes2Rot(fwd, left, up); -- cgit v1.1 From c7db3df3442657cda398ff2f90d387bce98c718a Mon Sep 17 00:00:00 2001 From: Pixel Tomsen Date: Thu, 29 Sep 2011 21:57:08 +0200 Subject: llGetLinkKey, llGetLinkName Fix for sitting Avatar when an avatar sits on a prim, we get now his key & name ;-) http://opensimulator.org/mantis/view.php?id=4476 --- .../Shared/Api/Implementation/LSL_Api.cs | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39da563..9a26f4b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3704,6 +3704,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetLinkKey(int linknum) { m_host.AddScriptLPS(1); + List keytable = new List(); + // parse for sitting avatare-uuids + World.ForEachScenePresence(delegate(ScenePresence presence) + { + if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) + keytable.Add(presence.UUID); + }); + + int totalprims = m_host.ParentGroup.PrimCount + keytable.Count; + if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims) + { + return keytable[totalprims - linknum].ToString(); + } + + if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && keytable.Count == 1) + { + return m_host.UUID.ToString(); + } + SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); if (part != null) { @@ -3747,6 +3766,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetLinkName(int linknum) { m_host.AddScriptLPS(1); + // parse for sitting avatare-names + List nametable = new List(); + World.ForEachScenePresence(delegate(ScenePresence presence) + { + if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) + nametable.Add(presence.ControllingClient.Name); + }); + + int totalprims = m_host.ParentGroup.PrimCount + nametable.Count; + if (totalprims > m_host.ParentGroup.PrimCount) + { + // sitting Avatar-Name with negativ linknum / SinglePrim + if (linknum < 0 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1) + return nametable[0]; + // Prim-Name / SinglePrim Sitting Avatar + if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1) + return m_host.Name; + // LinkNumber > of Real PrimSet = AvatarName + if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims) + return nametable[totalprims - linknum]; + } // simplest case, this prims link number if (m_host.LinkNum == linknum) @@ -3760,6 +3800,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else return UUID.Zero.ToString(); } + // Link set SceneObjectPart part = null; if (m_host.LinkNum == 1) // this is the Root prim -- cgit v1.1 From 8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Oct 2011 00:07:52 +0100 Subject: For llGetTexture(), if the face texture asset is in the inventory, return the inventory name rather than the asset UUID This is as per http://wiki.secondlife.com/wiki/LlGetTexture Applied patch in http://opensimulator.org/mantis/view.php?id=4552 with an additional break statement if an inventory item is found to exit early. Thanks Michelle Argus! --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9a26f4b..8291105 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1912,11 +1912,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); - return texface.TextureID.ToString(); + string texture = texface.TextureID.ToString(); + + lock (part.TaskInventory) + { + foreach (KeyValuePair inv in part.TaskInventory) + { + if (inv.Value.AssetID == texface.TextureID) + { + texture = inv.Value.Name.ToString(); + break; + } + } + } + + return texture; } else { -- cgit v1.1 From a8af0a5ba873dbb8c447e16b142ba7f5af715bdb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Oct 2011 00:15:48 +0100 Subject: Return NULL_KEY from llGetTexture if a non-existent face is indicated, rather than "" As per http://wiki.secondlife.com/wiki/LlGetTexture --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8291105..5ede801 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1935,7 +1935,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - return String.Empty; + return UUID.Zero.ToString(); } } -- cgit v1.1 From c7d0d71666a92b201d639511d062a7c22726b3c9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Oct 2011 00:37:02 +0100 Subject: trival tweak to trigger the continuous integration system --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5ede801..f8327b9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4240,8 +4240,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionSound(string impact_sound, double impact_volume) { - m_host.AddScriptLPS(1); + // TODO: Parameter check logic required. UUID soundId = UUID.Zero; if (!UUID.TryParse(impact_sound, out soundId)) -- cgit v1.1 From 460946ad62b682c7a942751f192ca9e96b662f0e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Mon, 3 Oct 2011 16:44:32 -0700 Subject: Removed redundant code in AttachmentsModule and simplified interfaces which converted back and forth between ScenePresence and IClientAPI. More to be done still. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9a26f4b..4b2fb51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2966,8 +2966,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) - attachmentsModule.AttachObject(presence.ControllingClient, - grp, (uint)attachment, false); + attachmentsModule.AttachObject(presence, grp, (uint)attachment, false); } } -- cgit v1.1 From 92c88121c72386f85472c6cf4891eca8b62b9867 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 4 Oct 2011 14:40:39 -0700 Subject: Removed all refs to IClientAPI from IAttachmentsModule. Separated client handlers for attachments to call public interface and rearranged module file into sections --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 04762be..42e09fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3023,7 +3023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) - attachmentsModule.DetachSingleAttachmentToInv(itemID, presence.ControllingClient); + attachmentsModule.DetachSingleAttachmentToInv(presence, itemID); } public void llTakeCamera(string avatar) -- cgit v1.1