diff options
author | Melanie Thielker | 2010-04-24 16:45:25 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-04-24 16:45:25 +0200 |
commit | 71f42f185a48ef96391b39fa0197c1a8b793e969 (patch) | |
tree | ddd8def5eed77423b4541201f06aa2b4be4b6eaa | |
parent | Add an additional serialization call do the detach procedure. This call is (diff) | |
download | opensim-SC-71f42f185a48ef96391b39fa0197c1a8b793e969.zip opensim-SC-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.gz opensim-SC-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.bz2 opensim-SC-71f42f185a48ef96391b39fa0197c1a8b793e969.tar.xz |
Plumb a data path to initialize an attachment from an alternate source
Diffstat (limited to '')
5 files changed, 57 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 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Xml; | ||
30 | using log4net; | 31 | using log4net; |
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenMetaverse; | 33 | using 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 | ||
28 | using System; | 28 | using System; |
29 | using System.Xml; | ||
29 | using OpenMetaverse; | 30 | using OpenMetaverse; |
30 | using OpenMetaverse.Packets; | 31 | using OpenMetaverse.Packets; |
31 | using OpenSim.Framework; | 32 | using 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})", |
diff --git a/OpenSim/Services/Interfaces/IAttachmentsService.cs b/OpenSim/Services/Interfaces/IAttachmentsService.cs new file mode 100644 index 0000000..3b9f2f2 --- /dev/null +++ b/OpenSim/Services/Interfaces/IAttachmentsService.cs | |||
@@ -0,0 +1,31 @@ | |||
1 | //////////////////////////////////////////////////////////////// | ||
2 | // | ||
3 | // (c) 2009, 2010 Careminster Limited and Melanie Thielker | ||
4 | // | ||
5 | // All rights reserved | ||
6 | // | ||
7 | using System; | ||
8 | using System.Diagnostics; | ||
9 | using System.Collections.Generic; | ||
10 | using System.IO; | ||
11 | using System.Text; | ||
12 | using System.Threading; | ||
13 | using System.Reflection; | ||
14 | using OpenSim.Framework; | ||
15 | using OpenSim.Framework.Console; | ||
16 | using OpenSim.Server.Base; | ||
17 | using OpenSim.Services.Base; | ||
18 | using OpenSim.Services.Interfaces; | ||
19 | using Nini.Config; | ||
20 | using log4net; | ||
21 | using Careminster; | ||
22 | using OpenMetaverse; | ||
23 | |||
24 | namespace Careminster | ||
25 | { | ||
26 | public interface IAttachmentsService | ||
27 | { | ||
28 | string Get(string id); | ||
29 | void Store(string id, string data); | ||
30 | } | ||
31 | } | ||