From 60553e62a3f576b8bf6ab88a83b2d4550bd69d2b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Mar 2010 23:18:47 +0000 Subject: refactor: begin to move attachments code into a region module --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5f3cd8c..474fba9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1903,21 +1903,6 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Attach an object. - /// - /// - /// - /// - /// - /// - /// - /// true if the object was successfully attached, false otherwise - public bool AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) - { - return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); - } - - /// /// This registers the item as attached in a user's inventory /// /// -- cgit v1.1 From b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Mar 2010 23:29:24 +0000 Subject: refactor: move user inventory side of RezSingleAttachment to module --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 30 +--------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 474fba9..6a5dc56 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1862,35 +1862,7 @@ namespace OpenSim.Region.Framework.Scenes return UUID.Zero; } - return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); - } - - /// - /// Update the user inventory to reflect an attachment - /// - /// - /// - /// - /// - /// - public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) - { - m_log.DebugFormat( - "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", - remoteClient.Name, att.Name, itemID); - - if (!att.IsDeleted) - AttachmentPt = att.RootPart.AttachmentPoint; - - ScenePresence presence; - if (TryGetAvatar(remoteClient.AgentId, out presence)) - { - InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); - item = InventoryService.GetItem(item); - - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); - } - return att.UUID; + return AttachmentsModule.SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt); } public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, -- cgit v1.1 From 71797af540bfa1ccb1ccfe856b42350844531607 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Mar 2010 23:35:49 +0000 Subject: refactor: move another AttachObject method --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 44 ---------------------- 1 file changed, 44 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6a5dc56..bd3b433 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1874,50 +1874,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// This registers the item as attached in a user's inventory - /// - /// - /// - /// - /// - public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) - { -// m_log.DebugFormat( -// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}", -// att.Name, remoteClient.Name, AttachmentPt, itemID); - - if (UUID.Zero == itemID) - { - m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); - return; - } - - if (0 == AttachmentPt) - { - m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error attachment point."); - return; - } - - if (null == att.RootPart) - { - m_log.Error("[SCENE INVENTORY]: Unable to save attachment for a prim without the rootpart!"); - return; - } - - ScenePresence presence; - if (TryGetAvatar(remoteClient.AgentId, out presence)) - { - // XXYY!! - InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); - item = InventoryService.GetItem(item); - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); - - if (m_AvatarFactory != null) - m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - } - } - public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) { SceneObjectPart part = GetSceneObjectPart(itemID); -- cgit v1.1 From 395f343498bc429c0360201991147c6e089b0730 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 6 Mar 2010 00:07:47 +0000 Subject: refactor: Move DetachSingleAttachmentToInv to region module need to rationalize method names later --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index bd3b433..dad0efd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1858,7 +1858,7 @@ namespace OpenSim.Region.Framework.Scenes if (att == null) { - DetachSingleAttachmentToInv(itemID, remoteClient); + AttachmentsModule.ShowDetachInUserInventory(itemID, remoteClient); return UUID.Zero; } @@ -1904,24 +1904,6 @@ namespace OpenSim.Region.Framework.Scenes SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); } - public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) - { - ScenePresence presence; - if (TryGetAvatar(remoteClient.AgentId, out presence)) - { - presence.Appearance.DetachAttachment(itemID); - - // Save avatar attachment information - if (m_AvatarFactory != null) - { - m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID); - m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - } - } - - m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); - } - public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) { EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID); -- cgit v1.1