aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-04-16 22:54:25 +0100
committerJustin Clark-Casey (justincc)2010-04-16 22:54:25 +0100
commit17d023ba5bb54f832adc8c0d4ba79b2a0e67c434 (patch)
tree3a5668b3cbd8af6b31405e242db3fcf9ba00e7ab /OpenSim/Region
parentminor: use the static ascii and utf8 encodings instead of instantiating our own (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs12
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
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;
30using log4net; 30using log4net;
31using Nini.Config; 31using Nini.Config;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenMetaverse.Packets;
33using OpenSim.Framework; 34using OpenSim.Framework;
34using OpenSim.Region.Framework; 35using OpenSim.Region.Framework;
35using OpenSim.Region.Framework.Interfaces; 36using 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
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenMetaverse.Packets;
30using OpenSim.Framework; 31using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes; 32using 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;
35using OpenMetaverse.Packets; 35using OpenMetaverse.Packets;
36using log4net; 36using log4net;
37using OpenSim.Framework; 37using OpenSim.Framework;
38
39using OpenSim.Region.Framework; 38using OpenSim.Region.Framework;
40using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Region.Framework.Scenes.Serialization; 40using 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 }