From 17d023ba5bb54f832adc8c0d4ba79b2a0e67c434 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 16 Apr 2010 22:54:25 +0100
Subject: refactor: crudely move the RezMultipleAttachments() method into the
AttachmentsModule
---
.../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 12 ++++++++++++
OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 12 ++++++++++++
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 10 ----------
OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++++----
4 files changed, 28 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region')
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;
using log4net;
using Nini.Config;
using OpenMetaverse;
+using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
@@ -169,6 +170,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
return true;
}
+ public void RezMultipleAttachmentsFromInventory(
+ IClientAPI remoteClient,
+ RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
+ RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
+ {
+ foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects)
+ {
+ RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt);
+ }
+ }
+
public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{
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 @@
using System;
using OpenMetaverse;
+using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
@@ -82,6 +83,17 @@ namespace OpenSim.Region.Framework.Interfaces
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
///
+ /// Rez multiple attachments from a user's inventory
+ ///
+ ///
+ ///
+ ///
+ void RezMultipleAttachmentsFromInventory(
+ IClientAPI remoteClient,
+ RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
+ RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects);
+
+ ///
/// Update the user inventory to the attachment of an item
///
///
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;
using OpenMetaverse.Packets;
using log4net;
using OpenSim.Framework;
-
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Serialization;
@@ -1875,15 +1874,6 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerOnAttach(localID, itemID, avatarID);
}
- public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
- RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
- {
- foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects)
- {
- AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt);
- }
- }
-
public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient)
{
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
}
public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
- {
- client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
+ {
client.OnObjectDetach += m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
+ client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach += AttachmentsModule.AttachObject;
client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
}
@@ -2926,12 +2926,12 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
{
- client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
client.OnObjectDetach -= m_sceneGraph.DetachObject;
if (AttachmentsModule != null)
{
- client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
+ client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
+ client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory;
client.OnObjectAttach -= AttachmentsModule.AttachObject;
client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
}
--
cgit v1.1