From 0463a00d34af4752936817e826d735e3f36d33f1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 28 Mar 2012 02:45:50 +0100 Subject: [PATCH 1/3] Start on Bulk inventory update via CAPS. Not functional yet. HG v2 --- CONTRIBUTORS.txt | 2 +- OpenSim/Framework/Client/IClientInventory.cs | 2 + .../ClientStack/Linden/UDP/LLClientView.cs | 48 +++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 31aeda3ab8..089d2f544c 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,4 +1,4 @@ -The following people have contributed to OpenSim (Thank you + <<<>>>>The following people have contributed to OpenSim (Thank you for your effort!) = Current OpenSim Developers (in very rough order of appearance) = diff --git a/OpenSim/Framework/Client/IClientInventory.cs b/OpenSim/Framework/Client/IClientInventory.cs index d59f8b7151..a6e0510464 100644 --- a/OpenSim/Framework/Client/IClientInventory.cs +++ b/OpenSim/Framework/Client/IClientInventory.cs @@ -27,6 +27,7 @@ using System; using OpenMetaverse; +using OpenSim.Framework; namespace OpenSim.Framework.Client { @@ -34,5 +35,6 @@ namespace OpenSim.Framework.Client { void SendRemoveInventoryFolders(UUID[] folders); void SendRemoveInventoryItems(UUID[] folders); + void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items); } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0c1d7f2677..410720963d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12339,5 +12339,53 @@ namespace OpenSim.Region.ClientStack.LindenUDP eq.Enqueue(BuildEvent("RemoveInventoryFolder", llsd), AgentId); } + + public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) + { + IEventQueue eq = Scene.RequestModuleInterface(); + + if (eq == null) + { + m_log.DebugFormat("[LLCLIENT]: Null event queue"); + return; + } + + OSDMap llsd = new OSDMap(3); + + OSDMap AgentDataMap = new OSDMap(1); + AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); + AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); + + OSDArray AgentData = new OSDArray(1); + AgentData.Add(AgentDataMap); + + llsd.Add("AgentData", AgentData); + + OSDArray FolderData = new OSDArray(); + + foreach (UUID InventoryFolderBase in folders) + { + OSDMap FolderDataMap = new OSDMap(5); + FolderDataMap.Add("FolderID", OSD.FromUUID(folder.ID)); + FolderDataMap.Add("AgentID", OSD.FromUUID(AgentId)); + FolderDataMap.Add("ParentID", OSD.FromUUID(folder.ParentID)); + FolderDataMap.Add("Type", OSD.FromInteger(folder.Type)); + FolderDataMap.Add("Name", OSD.FromString(folder.Name)); + + FolderData.Add(FolderDataMap); + } + + llsd.Add("FolderData", FolderData); + + OSDArray ItemData = new OSDArray(); + + foreach (UUID InventoryItemBase in items) + { + OSDMap ItemDataMap = new OSDMap(); + ItemData.Add(DataMap); + } + + llsd.Add("ItemData", ItemData); + } } } From b24605d5262cb4ff18436d8cff21063be83a39ef Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 28 Mar 2012 02:55:29 +0100 Subject: [PATCH 2/3] Fix typos --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 410720963d..82a76a215c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12363,7 +12363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSDArray FolderData = new OSDArray(); - foreach (UUID InventoryFolderBase in folders) + foreach (InventoryFolderBase folder in folders) { OSDMap FolderDataMap = new OSDMap(5); FolderDataMap.Add("FolderID", OSD.FromUUID(folder.ID)); @@ -12379,7 +12379,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSDArray ItemData = new OSDArray(); - foreach (UUID InventoryItemBase in items) + foreach (InventoryItemBase item in items) { OSDMap ItemDataMap = new OSDMap(); ItemData.Add(DataMap); From 614c40492369778a9b13a31f1e052b2836f8e449 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 28 Mar 2012 02:33:15 +0200 Subject: [PATCH 3/3] Typo fix --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 82a76a215c..cd81df5e68 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12382,7 +12382,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (InventoryItemBase item in items) { OSDMap ItemDataMap = new OSDMap(); - ItemData.Add(DataMap); + ItemData.Add(ItemDataMap); } llsd.Add("ItemData", ItemData);