From 1e8e98a07fdad6cff4be780083b3d9ad2360b8e7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Sep 2010 01:36:26 +0100 Subject: Move code that allows llGiveInvetory() to move item into appropriate system folder up from connectors into Scene.Inventory.cs This fixes the problem for all architectures (hg as well as local and grid) and means we don't have to dupe code between connectors. Not ideal in that it becomes non-modular, but methods in Scene.Inventory.cs should eventually be modularized anyway. --- .../RemoteController/RemoteAdminPlugin.cs | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'OpenSim/ApplicationPlugins/RemoteController') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index c713e19..4b5710a 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -1602,8 +1602,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController destinationItem.CreationDate = item.CreationDate; destinationItem.Folder = destinationFolder.ID; - inventoryService.AddItem(destinationItem); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); + m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); // Wear item AvatarWearable newWearable = new AvatarWearable(); @@ -1613,7 +1613,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController } else { - m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", wearable.ItemID, destinationFolder.ID); + m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", wearable.ItemID, destinationFolder.ID); } } } @@ -1655,16 +1655,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController destinationItem.CreationDate = item.CreationDate; destinationItem.Folder = destinationFolder.ID; - inventoryService.AddItem(destinationItem); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); + m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); // Attach item avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); - m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); + m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID); } else { - m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, destinationFolder.ID); + m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", itemID, destinationFolder.ID); } } } @@ -1762,16 +1762,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController destinationItem.CreationDate = item.CreationDate; destinationItem.Folder = extraFolder.ID; - inventoryService.AddItem(destinationItem); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); inventoryMap.Add(item.ID, destinationItem.ID); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID); + m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID); // Attach item, if original is attached int attachpoint = avatarAppearance.GetAttachpoint(item.ID); if (attachpoint != 0) { avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); - m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); + m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID); } } } @@ -1790,7 +1790,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController private bool CreateDefaultAvatars() { // Only load once - if (m_defaultAvatarsLoaded) { return false; @@ -2048,7 +2047,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController inventoryItem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); inventoryItem.Folder = extraFolder.ID; // Parent folder - inventoryService.AddItem(inventoryItem); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem); m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); } -- cgit v1.1