aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs20
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
4 files changed, 26 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 8307467..1992bd4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -27,6 +27,7 @@
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Reflection; 29using System.Reflection;
30using System.Xml;
30using log4net; 31using log4net;
31using Nini.Config; 32using Nini.Config;
32using OpenMetaverse; 33using OpenMetaverse;
@@ -191,8 +192,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
191 192
192 public UUID RezSingleAttachmentFromInventory( 193 public UUID RezSingleAttachmentFromInventory(
193 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) 194 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
195 {
196 return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
197 }
198
199 public UUID RezSingleAttachmentFromInventory(
200 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
194 { 201 {
195 SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt); 202 SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
196 203
197 if (updateInventoryStatus) 204 if (updateInventoryStatus)
198 { 205 {
@@ -211,7 +218,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
211 } 218 }
212 219
213 protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( 220 protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
214 IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 221 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc)
215 { 222 {
216 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); 223 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
217 if (invAccess != null) 224 if (invAccess != null)
@@ -237,6 +244,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
237 if (tainted) 244 if (tainted)
238 objatt.HasGroupChanged = true; 245 objatt.HasGroupChanged = true;
239 246
247 if (doc != null)
248 objatt.LoadScriptState(doc);
249
240 // Fire after attach, so we don't get messy perms dialogs 250 // Fire after attach, so we don't get messy perms dialogs
241 // 3 == AttachedRez 251 // 3 == AttachedRez
242 objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); 252 objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
@@ -318,6 +328,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
318 { 328 {
319 // XXYY!! 329 // XXYY!!
320 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 330 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
331 if (item == null)
332 m_log.Error("[ATTACHMENT]: item == null");
333 if (m_scene == null)
334 m_log.Error("[ATTACHMENT]: m_scene == null");
335 if (m_scene.InventoryService == null)
336 m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null");
321 item = m_scene.InventoryService.GetItem(item); 337 item = m_scene.InventoryService.GetItem(item);
322 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); 338 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
323 339
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 2352ced..c50abb8 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -524,6 +524,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
524 } 524 }
525 else 525 else
526 { 526 {
527 throw new Exception("AttachTracer");
527 group.SetFromItemID(itemID); 528 group.SetFromItemID(itemID);
528 } 529 }
529 530
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index f8af367..958847b 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Xml;
29using OpenMetaverse; 30using OpenMetaverse;
30using OpenMetaverse.Packets; 31using OpenMetaverse.Packets;
31using OpenSim.Framework; 32using OpenSim.Framework;
@@ -82,6 +83,10 @@ namespace OpenSim.Region.Framework.Interfaces
82 UUID RezSingleAttachmentFromInventory( 83 UUID RezSingleAttachmentFromInventory(
83 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); 84 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
84 85
86 // Same as above, but also load script states from a separate doc
87 UUID RezSingleAttachmentFromInventory(
88 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
89
85 /// <summary> 90 /// <summary>
86 /// Rez multiple attachments from a user's inventory 91 /// Rez multiple attachments from a user's inventory
87 /// </summary> 92 /// </summary>
@@ -132,4 +137,4 @@ namespace OpenSim.Region.Framework.Interfaces
132 /// </param> 137 /// </param>
133 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); 138 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
134 } 139 }
135} \ No newline at end of file 140}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c220bf0..a5c0b0d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3984,7 +3984,7 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
3984 { 3984 {
3985 // Rez from inventory 3985 // Rez from inventory
3986 UUID asset 3986 UUID asset
3987 = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p); 3987 = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p, true, null);
3988 3988
3989 m_log.InfoFormat( 3989 m_log.InfoFormat(
3990 "[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})", 3990 "[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})",