* Change SendBulkUpdateInventory from two methods to one which accepts an InventoryNode

0.6.3-post-fixes
Justin Clarke Casey 2009-02-11 19:57:45 +00:00
parent e12981ef1b
commit 8645c7482d
5 changed files with 27 additions and 35 deletions

View File

@ -887,18 +887,14 @@ namespace OpenSim.Framework
void SendTaskInventory(UUID taskID, short serial, byte[] fileName); void SendTaskInventory(UUID taskID, short serial, byte[] fileName);
/// <summary> /// <summary>
/// Used by the server to inform the client of new inventory items. Will transfer the contents of the folder /// Used by the server to inform the client of new inventory items and folders.
/// </summary>
///
/// If the node is a folder then the contents will be transferred
/// (including all descendent folders) as well as the folder itself. /// (including all descendent folders) as well as the folder itself.
/// </summary> ///
/// <param name="folder"></param> /// <param name="node"></param>
void SendBulkUpdateInventory(InventoryFolderBase folder); void SendBulkUpdateInventory(InventoryNodeBase node);
/// <summary>
/// Used by the server to inform the client of a new inventory item. Used when transferring items
/// between avatars, possibly among other things.
/// </summary>
/// <param name="item"></param>
void SendBulkUpdateInventory(InventoryItemBase item);
void SendXferPacket(ulong xferID, uint packet, byte[] data); void SendXferPacket(ulong xferID, uint packet, byte[] data);

View File

@ -1851,8 +1851,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(inventoryReply, ThrottleOutPacketType.Asset); OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
} }
/// <see>IClientAPI.SendBulkUpdateInventory(InventoryFolderBase)</see> protected void SendBulkUpdateInventoryFolder(InventoryFolderBase folderBase)
public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
{ {
// XXX: Nasty temporary move that will be resolved shortly // XXX: Nasty temporary move that will be resolved shortly
InventoryFolderImpl folder = (InventoryFolderImpl)folderBase; InventoryFolderImpl folder = (InventoryFolderImpl)folderBase;
@ -1863,7 +1862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks
= new List<BulkUpdateInventoryPacket.FolderDataBlock>(); = new List<BulkUpdateInventoryPacket.FolderDataBlock>();
SendBulkUpdateInventoryRecursive(folder, ref folderDataBlocks, transactionId); SendBulkUpdateInventoryFolderRecursive(folder, ref folderDataBlocks, transactionId);
if (folderDataBlocks.Count > 0) if (folderDataBlocks.Count > 0)
{ {
@ -1888,7 +1887,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="folder"></param> /// <param name="folder"></param>
/// <param name="folderDataBlocks"></param> /// <param name="folderDataBlocks"></param>
/// <param name="transactionId"></param> /// <param name="transactionId"></param>
private void SendBulkUpdateInventoryRecursive( private void SendBulkUpdateInventoryFolderRecursive(
InventoryFolderImpl folder, ref List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks, InventoryFolderImpl folder, ref List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks,
UUID transactionId) UUID transactionId)
{ {
@ -1934,7 +1933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls();
foreach (InventoryFolderImpl subFolder in subFolders) foreach (InventoryFolderImpl subFolder in subFolders)
{ {
SendBulkUpdateInventoryRecursive(subFolder, ref folderDataBlocks, transactionId); SendBulkUpdateInventoryFolderRecursive(subFolder, ref folderDataBlocks, transactionId);
} }
} }
@ -1998,8 +1997,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return itemBlock; return itemBlock;
} }
/// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> public void SendBulkUpdateInventory(InventoryNodeBase node)
public void SendBulkUpdateInventory(InventoryItemBase item) {
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; const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;

View File

@ -548,14 +548,10 @@ namespace OpenSim.Region.Examples.SimpleModule
{ {
} }
/// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
public virtual void SendBulkUpdateInventory(InventoryItemBase item)
{ {
} }
public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
{}
public UUID GetDefaultAnimation(string name) public UUID GetDefaultAnimation(string name)
{ {
return UUID.Zero; return UUID.Zero;

View File

@ -636,14 +636,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{ {
} }
/// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
public virtual void SendBulkUpdateInventory(InventoryItemBase item)
{ {
} }
public virtual void SendBulkUpdateInventory(InventoryFolderBase folderBase)
{}
public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
{ {
} }

View File

@ -627,14 +627,10 @@ namespace OpenSim.Tests.Common.Mock
{ {
} }
/// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
public virtual void SendBulkUpdateInventory(InventoryItemBase item)
{ {
} }
public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
{}
public UUID GetDefaultAnimation(string name) public UUID GetDefaultAnimation(string name)
{ {
return UUID.Zero; return UUID.Zero;