aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-09 23:08:41 +0100
committerJustin Clark-Casey (justincc)2012-07-09 23:08:41 +0100
commitc8af20f966e005fb512869299d80be6b83cb70bf (patch)
treecdab2bc5b186b55c0ce8fcf51919eaca5f3bb5a1 /OpenSim/Region/ScriptEngine/Shared/Api
parentDon't allow a prim to be sat upon if its part of an attachment (diff)
downloadopensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.zip
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.gz
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.bz2
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.xz
This script allows an object to be attached directly from prim inventory to another avatar in the scene.
Very useful in serious game/environment scenarios where its only allowed for trusted creators. Threat level Severe
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 43 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 61394af..e90f577 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3190,13 +3190,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3190 { 3190 {
3191 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory"); 3191 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory");
3192 3192
3193 m_host.AddScriptLPS(1);
3194
3195 ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint);
3196 }
3197
3198 public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)
3199 {
3200 CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory");
3201
3202 m_host.AddScriptLPS(1);
3203
3204 UUID avatarId;
3205
3206 if (!UUID.TryParse(rawAvatarId, out avatarId))
3207 return;
3208
3209 ForceAttachToAvatarFromInventory(avatarId, itemName, attachmentPoint);
3210 }
3211
3212 public void ForceAttachToAvatarFromInventory(UUID avatarId, string itemName, int attachmentPoint)
3213 {
3193 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 3214 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
3194 3215
3195 if (attachmentsModule == null) 3216 if (attachmentsModule == null)
3196 return; 3217 return;
3197 3218
3198 m_host.AddScriptLPS(1);
3199
3200 InitLSL(); 3219 InitLSL();
3201 3220
3202 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName); 3221 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
@@ -3219,7 +3238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3219 return; 3238 return;
3220 } 3239 }
3221 3240
3222 ScenePresence sp = World.GetScenePresence(m_host.OwnerID); 3241 ScenePresence sp = World.GetScenePresence(avatarId);
3223 3242
3224 if (sp == null) 3243 if (sp == null)
3225 return; 3244 return;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index d38709e..b5416c8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -101,19 +101,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
101 // Attachment commands 101 // Attachment commands
102 102
103 /// <summary> 103 /// <summary>
104 /// Attach the object containing this script to the avatar that owns it without checking for PERMISSION_ATTACH 104 /// Attach the object containing this script to the avatar that owns it without asking for PERMISSION_ATTACH
105 /// </summary> 105 /// </summary>
106 /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param> 106 /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param>
107 void osForceAttachToAvatar(int attachment); 107 void osForceAttachToAvatar(int attachment);
108 108
109 /// <summary> 109 /// <summary>
110 /// Attach the inventory item in the object containing this script to the avatar that owns it without checking for PERMISSION_ATTACH 110 /// Attach an inventory item in the object containing this script to the avatar that owns it without asking for PERMISSION_ATTACH
111 /// </summary> 111 /// </summary>
112 /// <remarks>
113 /// Nothing happens if the owner is not in the region.
114 /// </remarks>
112 /// <param name='itemName'>Tha name of the item. If this is not found then a warning is said to the owner</param> 115 /// <param name='itemName'>Tha name of the item. If this is not found then a warning is said to the owner</param>
113 /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param> 116 /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param>
114 void osForceAttachToAvatarFromInventory(string itemName, int attachment); 117 void osForceAttachToAvatarFromInventory(string itemName, int attachment);
115 118
116 /// <summary> 119 /// <summary>
120 /// Attach an inventory item in the object containing this script to any avatar in the region without asking for PERMISSION_ATTACH
121 /// </summary>
122 /// <remarks>
123 /// Nothing happens if the avatar is not in the region.
124 /// </remarks>
125 /// <param name='rawAvatarId'>The UUID of the avatar to which to attach. Nothing happens if this is not a UUID</para>
126 /// <param name='itemName'>The name of the item. If this is not found then a warning is said to the owner</param>
127 /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param>
128 void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint);
129
130 /// <summary>
117 /// Detach the object containing this script from the avatar it is attached to without checking for PERMISSION_ATTACH 131 /// Detach the object containing this script from the avatar it is attached to without checking for PERMISSION_ATTACH
118 /// </summary> 132 /// </summary>
119 /// <remarks>Nothing happens if the object is not attached.</remarks> 133 /// <remarks>Nothing happens if the object is not attached.</remarks>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 692bb0a..b40bdf0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -301,6 +301,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
301 m_OSSL_Functions.osForceAttachToAvatarFromInventory(itemName, attachmentPoint); 301 m_OSSL_Functions.osForceAttachToAvatarFromInventory(itemName, attachmentPoint);
302 } 302 }
303 303
304 public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)
305 {
306 m_OSSL_Functions.osForceAttachToOtherAvatarFromInventory(rawAvatarId, itemName, attachmentPoint);
307 }
308
304 public void osForceDetachFromAvatar() 309 public void osForceDetachFromAvatar()
305 { 310 {
306 m_OSSL_Functions.osForceDetachFromAvatar(); 311 m_OSSL_Functions.osForceDetachFromAvatar();