From 8645c7482d39ccc9d72cb4cfc7c68b651b3824d3 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 11 Feb 2009 19:57:45 +0000
Subject: * Change SendBulkUpdateInventory from two methods to one which
accepts an InventoryNode
---
OpenSim/Framework/IClientAPI.cs | 18 ++++++---------
.../Region/ClientStack/LindenUDP/LLClientView.cs | 26 ++++++++++++++--------
.../Region/Examples/SimpleModule/MyNpcCharacter.cs | 6 +----
.../Region/OptionalModules/World/NPC/NPCAvatar.cs | 6 +----
OpenSim/Tests/Common/Mock/TestClient.cs | 6 +----
5 files changed, 27 insertions(+), 35 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 63c09fe..759059f 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -887,18 +887,14 @@ namespace OpenSim.Framework
void SendTaskInventory(UUID taskID, short serial, byte[] fileName);
///
- /// Used by the server to inform the client of new inventory items. Will transfer the contents of the folder
- /// (including all descendent folders) as well as the folder itself.
+ /// Used by the server to inform the client of new inventory items and folders.
///
- ///
- void SendBulkUpdateInventory(InventoryFolderBase folder);
-
- ///
- /// Used by the server to inform the client of a new inventory item. Used when transferring items
- /// between avatars, possibly among other things.
- ///
- ///
- void SendBulkUpdateInventory(InventoryItemBase item);
+ ///
+ /// If the node is a folder then the contents will be transferred
+ /// (including all descendent folders) as well as the folder itself.
+ ///
+ ///
+ void SendBulkUpdateInventory(InventoryNodeBase node);
void SendXferPacket(ulong xferID, uint packet, byte[] data);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index a1263a1..45915db 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1850,9 +1850,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
inventoryReply.Header.Zerocoded = true;
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
}
-
- /// IClientAPI.SendBulkUpdateInventory(InventoryFolderBase)
- public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
+
+ protected void SendBulkUpdateInventoryFolder(InventoryFolderBase folderBase)
{
// XXX: Nasty temporary move that will be resolved shortly
InventoryFolderImpl folder = (InventoryFolderImpl)folderBase;
@@ -1863,7 +1862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
List folderDataBlocks
= new List();
- SendBulkUpdateInventoryRecursive(folder, ref folderDataBlocks, transactionId);
+ SendBulkUpdateInventoryFolderRecursive(folder, ref folderDataBlocks, transactionId);
if (folderDataBlocks.Count > 0)
{
@@ -1888,7 +1887,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
///
///
- private void SendBulkUpdateInventoryRecursive(
+ private void SendBulkUpdateInventoryFolderRecursive(
InventoryFolderImpl folder, ref List folderDataBlocks,
UUID transactionId)
{
@@ -1934,7 +1933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
List subFolders = folder.RequestListOfFolderImpls();
foreach (InventoryFolderImpl subFolder in subFolders)
{
- SendBulkUpdateInventoryRecursive(subFolder, ref folderDataBlocks, transactionId);
+ SendBulkUpdateInventoryFolderRecursive(subFolder, ref folderDataBlocks, transactionId);
}
}
@@ -1997,9 +1996,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return itemBlock;
}
-
- /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase)
- public void SendBulkUpdateInventory(InventoryItemBase item)
+
+ public void SendBulkUpdateInventory(InventoryNodeBase node)
+ {
+ if (node is InventoryItemBase)
+ SendBulkUpdateInventoryItem((InventoryItemBase)node);
+ else if (node is InventoryFolderBase)
+ SendBulkUpdateInventoryFolder((InventoryFolderBase)node);
+ else
+ m_log.ErrorFormat("[CLIENT]: Client for {0} sent unknown inventory node named {1}", Name, node.Name);
+ }
+
+ protected void SendBulkUpdateInventoryItem(InventoryItemBase item)
{
const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index aac5990..1ee4424 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -548,13 +548,9 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
- /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase)
- public virtual void SendBulkUpdateInventory(InventoryItemBase item)
+ public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
{
}
-
- public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
- {}
public UUID GetDefaultAnimation(string name)
{
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 3ba8a97..91518e2 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -636,13 +636,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{
}
- /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase)
- public virtual void SendBulkUpdateInventory(InventoryItemBase item)
+ public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
{
}
-
- public virtual void SendBulkUpdateInventory(InventoryFolderBase folderBase)
- {}
public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
{
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 5f02524..2463b3b 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -627,14 +627,10 @@ namespace OpenSim.Tests.Common.Mock
{
}
- /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase)
- public virtual void SendBulkUpdateInventory(InventoryItemBase item)
+ public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
{
}
- public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
- {}
-
public UUID GetDefaultAnimation(string name)
{
return UUID.Zero;
--
cgit v1.1