* Inserting code to prepare to fix trash emptying and the edit texture inventory (again)

* Can't just do this fix since it stops subfolders working (though it appears subfolder renaming may be fubar at the moment)
0.6.0-stable
Justin Clarke Casey 2008-03-17 21:34:58 +00:00
parent 79209c4297
commit 872184fa2a
1 changed files with 61 additions and 59 deletions

View File

@ -1150,6 +1150,9 @@ namespace OpenSim.Region.ClientStack
List<InventoryFolderBase> folders, List<InventoryFolderBase> folders,
bool fetchFolders, bool fetchItems) bool fetchFolders, bool fetchItems)
{ {
// XXX Very temporarily, always fetch the folders
fetchFolders = true;
// An inventory descendents packet consists of a single agent section and an inventory details // An inventory descendents packet consists of a single agent section and an inventory details
// section for each inventory item. The size of each inventory item is approximately 550 bytes. // section for each inventory item. The size of each inventory item is approximately 550 bytes.
// In theory, UDP has a maximum packet size of 64k, so it should be possible to send descendent // In theory, UDP has a maximum packet size of 64k, so it should be possible to send descendent
@ -1163,13 +1166,11 @@ namespace OpenSim.Region.ClientStack
int MAX_ITEMS_PER_PACKET = 6; int MAX_ITEMS_PER_PACKET = 6;
Encoding enc = Encoding.ASCII; Encoding enc = Encoding.ASCII;
InventoryDescendentsPacket descend; uint FULL_MASK_PERMISSIONS = 2147483647;
int i;
int count;
if (fetchItems) if (fetchItems)
{ {
descend = CreateInventoryDescendentsPacket(ownerID, folderID); InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
if (items.Count < MAX_ITEMS_PER_PACKET) if (items.Count < MAX_ITEMS_PER_PACKET)
{ {
@ -1191,8 +1192,8 @@ namespace OpenSim.Region.ClientStack
descend.AgentData.Descendents += folders.Count; descend.AgentData.Descendents += folders.Count;
} }
count = 0; int count = 0;
i = 0; int i = 0;
foreach (InventoryItemBase item in items) foreach (InventoryItemBase item in items)
{ {
descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
@ -1257,8 +1258,9 @@ namespace OpenSim.Region.ClientStack
} }
//send subfolders //send subfolders
if (fetchFolders)
descend = CreateInventoryDescendentsPacket(ownerID, folderID); {
InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
if (folders.Count < MAX_ITEMS_PER_PACKET) if (folders.Count < MAX_ITEMS_PER_PACKET)
{ {
@ -1278,8 +1280,8 @@ namespace OpenSim.Region.ClientStack
descend.AgentData.Descendents += items.Count; descend.AgentData.Descendents += items.Count;
} }
i = 0; int i = 0;
count = 0; int count = 0;
foreach (InventoryFolderBase folder in folders) foreach (InventoryFolderBase folder in folders)
{ {
descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
@ -1318,7 +1320,7 @@ namespace OpenSim.Region.ClientStack
{ {
OutPacket(descend, ThrottleOutPacketType.Asset); OutPacket(descend, ThrottleOutPacketType.Asset);
} }
}
} }
private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)