aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-19 21:37:12 +0000
committerMelanie Thielker2008-08-19 21:37:12 +0000
commitf2055a35246a991fd73240789f4354d200ac6cc8 (patch)
tree8e7c36cd668420ba571796c76774b186c7494e50 /OpenSim/Region/ScriptEngine
parentAdd the default region texture UUIDS back in that were lost in (diff)
downloadopensim-SC_OLD-f2055a35246a991fd73240789f4354d200ac6cc8.zip
opensim-SC_OLD-f2055a35246a991fd73240789f4354d200ac6cc8.tar.gz
opensim-SC_OLD-f2055a35246a991fd73240789f4354d200ac6cc8.tar.bz2
opensim-SC_OLD-f2055a35246a991fd73240789f4354d200ac6cc8.tar.xz
Mantis #2001
Thank you, nlin, for a patch that implements part of llCreateLink - DotNetEngine implementation by nlin. - Shared/ port by me.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs32
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs32
2 files changed, 62 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 9195063..3823ff8 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -2781,7 +2781,37 @@ namespace OpenSim.Region.ScriptEngine.Common
2781 public void llCreateLink(string target, int parent) 2781 public void llCreateLink(string target, int parent)
2782 { 2782 {
2783 m_host.AddScriptLPS(1); 2783 m_host.AddScriptLPS(1);
2784 NotImplemented("llCreateLink"); 2784 LLUUID invItemID = InventorySelf();
2785 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CHANGE_LINKS) == 0) {
2786 ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
2787 return;
2788 }
2789 IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient;
2790 SceneObjectPart targetPart = World.GetSceneObjectPart(target);
2791 SceneObjectGroup parentPrim = null, childPrim = null;
2792 if (targetPart != null)
2793 {
2794 if (parent == BuiltIn_Commands_BaseClass.TRUE) {
2795 parentPrim = m_host.ParentGroup;
2796 childPrim = targetPart.ParentGroup;
2797 }
2798 else
2799 {
2800 parentPrim = targetPart.ParentGroup;
2801 childPrim = m_host.ParentGroup;
2802 }
2803 byte uf = childPrim.RootPart.UpdateFlag;
2804 childPrim.RootPart.UpdateFlag = 0;
2805 parentPrim.LinkToGroup(childPrim);
2806 childPrim.RootPart.UpdateFlag = uf;
2807 }
2808 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
2809 parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected);
2810 parentPrim.GetProperties(client);
2811
2812 // sleep for 1 second
2813 System.Threading.Thread.Sleep(1000);
2814
2785 } 2815 }
2786 2816
2787 public void llBreakLink(int linknum) 2817 public void llBreakLink(int linknum)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 4de207a..3d68121 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2768,7 +2768,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2768 public void llCreateLink(string target, int parent) 2768 public void llCreateLink(string target, int parent)
2769 { 2769 {
2770 m_host.AddScriptLPS(1); 2770 m_host.AddScriptLPS(1);
2771 NotImplemented("llCreateLink"); 2771 LLUUID invItemID = InventorySelf();
2772 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CHANGE_LINKS) == 0) {
2773 ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
2774 return;
2775 }
2776 IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient;
2777 SceneObjectPart targetPart = World.GetSceneObjectPart(target);
2778 SceneObjectGroup parentPrim = null, childPrim = null;
2779 if (targetPart != null)
2780 {
2781 if (parent == BuiltIn_Commands_BaseClass.TRUE) {
2782 parentPrim = m_host.ParentGroup;
2783 childPrim = targetPart.ParentGroup;
2784 }
2785 else
2786 {
2787 parentPrim = targetPart.ParentGroup;
2788 childPrim = m_host.ParentGroup;
2789 }
2790 byte uf = childPrim.RootPart.UpdateFlag;
2791 childPrim.RootPart.UpdateFlag = 0;
2792 parentPrim.LinkToGroup(childPrim);
2793 childPrim.RootPart.UpdateFlag = uf;
2794 }
2795 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
2796 parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected);
2797 parentPrim.GetProperties(client);
2798
2799 // sleep for 1 second
2800 System.Threading.Thread.Sleep(1000);
2801
2772 } 2802 }
2773 2803
2774 public void llBreakLink(int linknum) 2804 public void llBreakLink(int linknum)