From d95d3b949bc5c8a9425ea096fb721a9cc0111e67 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 18 Aug 2009 07:05:22 -0700
Subject: Fixes mantis #4020 (http://opensimulator.org/mantis/view.php?id=4020)
---
.../Framework/Scenes/Scene.PacketHandlers.cs | 26 ++++++++++------------
1 file changed, 12 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2bf4ea8..fde922f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -517,21 +517,19 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
- CachedUserInfo userProfile = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
-
- if (null == userProfile)
- {
- m_log.ErrorFormat(
- "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
- remoteClient.Name, remoteClient.AgentId);
- return;
- }
-
- if (!userProfile.UpdateFolder(name, folderID, type, parentID))
+ InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ folder = InventoryService.GetFolder(folder);
+ if (folder != null)
{
- m_log.ErrorFormat(
- "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
- remoteClient.Name, remoteClient.AgentId);
+ folder.Name = name;
+ folder.Type = (short)type;
+ folder.ParentID = parentID;
+ if (!InventoryService.UpdateFolder(folder))
+ {
+ m_log.ErrorFormat(
+ "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
+ remoteClient.Name, remoteClient.AgentId);
+ }
}
}
--
cgit v1.1
From 124f66bfc25984a01491b8447fa97bea2633281c Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 18 Aug 2009 22:17:47 -0700
Subject: jhurliman's patch in http://opensimulator.org/mantis/view.php?id=4024
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index fde922f..1bbca49 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -404,7 +404,8 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = InventoryService.GetItem(item);
if (item != null)
{
--
cgit v1.1
From c5af39239f7f2a1725d9c08bea80522de8835e0f Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 00:13:51 -0700
Subject: A better purge of trash folder.
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 1bbca49..a2414e5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -560,7 +560,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
if (InventoryService.PurgeFolder(folder))
m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
--
cgit v1.1
From 4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 19 Aug 2009 00:33:02 -0700
Subject: Async purge so that the client thread doesn't wait.
---
.../Framework/Scenes/Scene.PacketHandlers.cs | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index a2414e5..77b980c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
using System.Collections.Generic;
using System.Threading;
using OpenMetaverse;
@@ -558,15 +559,34 @@ namespace OpenSim.Region.Framework.Scenes
///
///
+ delegate void PurgeFolderDelegate(UUID userID, UUID folder);
+
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
+ PurgeFolderDelegate d = PurgeFolderAsync;
+ try
+ {
+ d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d);
+ }
+ catch (Exception e)
+ {
+ m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message);
+ }
+ }
+
+
+ private void PurgeFolderAsync(UUID userID, UUID folderID)
+ {
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, userID);
if (InventoryService.PurgeFolder(folder))
m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
else
m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID);
- }
+ }
+ private void PurgeFolderCompleted(IAsyncResult iar)
+ {
+ }
}
}
--
cgit v1.1
From 1604c9d19e12602608dbb402382cde8302185efd Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 20 Aug 2009 10:14:53 -0700
Subject: One more place fixed for setting the inventory folder owner. Thanks
jhurliman.
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 77b980c..d722e23 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = InventoryService.GetFolder(folder);
if (folder != null)
{
--
cgit v1.1
From e4f64dd7147001e1e0ac9bd4a51efec086727b29 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 20 Aug 2009 22:36:47 -0700
Subject: Made HandleFetchInventoryDescendents async, so that the client thread
doesn't wait for the download of the entire inventory.
---
.../Region/Framework/Scenes/Scene.PacketHandlers.cs | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index d722e23..2b815a2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -441,9 +441,24 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+ // We're going to send the reply async, because there may be
+ // an enormous quantity of packets -- basically the entire inventory!
+ // We don't want to block the client thread while all that is happening.
+ SendInventoryDelegate d = SendInventoryAsync;
+ d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d);
+ }
+
+ delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
+
+ void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
+ {
SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems);
- }
-
+ }
+
+ void SendInventoryComplete(IAsyncResult iar)
+ {
+ }
+
///
/// Handle the caps inventory descendents fetch.
///
--
cgit v1.1
From b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 22 Aug 2009 10:24:26 -0700
Subject: * Fixes mantis http://opensimulator.org/mantis/view.php?id=4044.
Turns out folders were never being removed from trash when they were singled
out for purging in trash. They were being removed when Trash was purged as a
whole. That behavior is now fixed for the new InventoryService set. * Removed
left-overs from AssetInventoryServer.
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2b815a2..d3e414f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -552,7 +552,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
{
- InventoryFolderBase folder = new InventoryFolderBase(folderID);
+ InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = InventoryService.GetFolder(folder);
if (folder != null)
{
--
cgit v1.1