diff options
author | Justin Clark-Casey (justincc) | 2010-04-16 22:54:25 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-04-16 22:54:25 +0100 |
commit | 17d023ba5bb54f832adc8c0d4ba79b2a0e67c434 (patch) | |
tree | 3a5668b3cbd8af6b31405e242db3fcf9ba00e7ab /OpenSim/Region | |
parent | minor: use the static ascii and utf8 encodings instead of instantiating our own (diff) | |
download | opensim-SC-17d023ba5bb54f832adc8c0d4ba79b2a0e67c434.zip opensim-SC-17d023ba5bb54f832adc8c0d4ba79b2a0e67c434.tar.gz opensim-SC-17d023ba5bb54f832adc8c0d4ba79b2a0e67c434.tar.bz2 opensim-SC-17d023ba5bb54f832adc8c0d4ba79b2a0e67c434.tar.xz |
refactor: crudely move the RezMultipleAttachments() method into the AttachmentsModule
Diffstat (limited to 'OpenSim/Region')
4 files changed, 28 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 23828ef..37f790d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -30,6 +30,7 @@ using System.Reflection; | |||
30 | using log4net; | 30 | using log4net; |
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenMetaverse.Packets; | ||
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework; | 35 | using OpenSim.Region.Framework; |
35 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
@@ -169,6 +170,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
169 | return true; | 170 | return true; |
170 | } | 171 | } |
171 | 172 | ||
173 | public void RezMultipleAttachmentsFromInventory( | ||
174 | IClientAPI remoteClient, | ||
175 | RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | ||
176 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) | ||
177 | { | ||
178 | foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) | ||
179 | { | ||
180 | RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt); | ||
181 | } | ||
182 | } | ||
183 | |||
172 | public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 184 | public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) |
173 | { | 185 | { |
174 | m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); | 186 | m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 0222b02..77e9a7e 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenMetaverse.Packets; | ||
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
32 | 33 | ||
@@ -82,6 +83,17 @@ namespace OpenSim.Region.Framework.Interfaces | |||
82 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); | 83 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); |
83 | 84 | ||
84 | /// <summary> | 85 | /// <summary> |
86 | /// Rez multiple attachments from a user's inventory | ||
87 | /// </summary> | ||
88 | /// <param name="remoteClient"></param> | ||
89 | /// <param name="header"></param> | ||
90 | /// <param name="objects"></param> | ||
91 | void RezMultipleAttachmentsFromInventory( | ||
92 | IClientAPI remoteClient, | ||
93 | RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | ||
94 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); | ||
95 | |||
96 | /// <summary> | ||
85 | /// Update the user inventory to the attachment of an item | 97 | /// Update the user inventory to the attachment of an item |
86 | /// </summary> | 98 | /// </summary> |
87 | /// <param name="att"></param> | 99 | /// <param name="att"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7c68ef4..4a286ac 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -35,7 +35,6 @@ using OpenMetaverse; | |||
35 | using OpenMetaverse.Packets; | 35 | using OpenMetaverse.Packets; |
36 | using log4net; | 36 | using log4net; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | |||
39 | using OpenSim.Region.Framework; | 38 | using OpenSim.Region.Framework; |
40 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes.Serialization; | 40 | using OpenSim.Region.Framework.Scenes.Serialization; |
@@ -1875,15 +1874,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1875 | EventManager.TriggerOnAttach(localID, itemID, avatarID); | 1874 | EventManager.TriggerOnAttach(localID, itemID, avatarID); |
1876 | } | 1875 | } |
1877 | 1876 | ||
1878 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | ||
1879 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) | ||
1880 | { | ||
1881 | foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) | ||
1882 | { | ||
1883 | AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt); | ||
1884 | } | ||
1885 | } | ||
1886 | |||
1887 | public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) | 1877 | public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) |
1888 | { | 1878 | { |
1889 | SceneObjectPart part = GetSceneObjectPart(itemID); | 1879 | SceneObjectPart part = GetSceneObjectPart(itemID); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 685a678..d4da2cb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2769,13 +2769,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2769 | } | 2769 | } |
2770 | 2770 | ||
2771 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) | 2771 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) |
2772 | { | 2772 | { |
2773 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; | ||
2774 | client.OnObjectDetach += m_sceneGraph.DetachObject; | 2773 | client.OnObjectDetach += m_sceneGraph.DetachObject; |
2775 | 2774 | ||
2776 | if (AttachmentsModule != null) | 2775 | if (AttachmentsModule != null) |
2777 | { | 2776 | { |
2778 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; | 2777 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; |
2778 | client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
2779 | client.OnObjectAttach += AttachmentsModule.AttachObject; | 2779 | client.OnObjectAttach += AttachmentsModule.AttachObject; |
2780 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; | 2780 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; |
2781 | } | 2781 | } |
@@ -2926,12 +2926,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2926 | 2926 | ||
2927 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) | 2927 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) |
2928 | { | 2928 | { |
2929 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; | ||
2930 | client.OnObjectDetach -= m_sceneGraph.DetachObject; | 2929 | client.OnObjectDetach -= m_sceneGraph.DetachObject; |
2931 | 2930 | ||
2932 | if (AttachmentsModule != null) | 2931 | if (AttachmentsModule != null) |
2933 | { | 2932 | { |
2934 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; | 2933 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; |
2934 | client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
2935 | client.OnObjectAttach -= AttachmentsModule.AttachObject; | 2935 | client.OnObjectAttach -= AttachmentsModule.AttachObject; |
2936 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; | 2936 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; |
2937 | } | 2937 | } |