aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie Thielker2010-04-24 16:45:25 +0200
committerMelanie Thielker2010-04-24 16:45:25 +0200
commit71f42f185a48ef96391b39fa0197c1a8b793e969 (patch)
treeddd8def5eed77423b4541201f06aa2b4be4b6eaa /OpenSim/Region/CoreModules
parentAdd an additional serialization call do the detach procedure. This call is (diff)
downloadopensim-SC_OLD-71f42f185a48ef96391b39fa0197c1a8b793e969.zip
opensim-SC_OLD-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.gz
opensim-SC_OLD-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.bz2
opensim-SC_OLD-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.xz
Plumb a data path to initialize an attachment from an alternate source
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs20
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs1
2 files changed, 19 insertions, 2 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