diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 6209beb..edc1268 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -531,13 +531,19 @@ namespace OpenSim.Region.ClientStack | |||
531 | { | 531 | { |
532 | Encoding enc = Encoding.ASCII; | 532 | Encoding enc = Encoding.ASCII; |
533 | uint FULL_MASK_PERMISSIONS = 2147483647; | 533 | uint FULL_MASK_PERMISSIONS = 2147483647; |
534 | InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); | 534 | InventoryDescendentsPacket descend = this.CreateInventoryDescendentsPacket(ownerID, folderID); |
535 | descend.AgentData.AgentID = this.AgentId; | 535 | |
536 | descend.AgentData.OwnerID = ownerID; | 536 | int count = 0; |
537 | descend.AgentData.FolderID = folderID; | 537 | if (items.Count < 40) |
538 | descend.AgentData.Descendents = items.Count; | 538 | { |
539 | descend.AgentData.Version = 0; | 539 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; |
540 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; | 540 | descend.AgentData.Descendents = items.Count; |
541 | } | ||
542 | else | ||
543 | { | ||
544 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40]; | ||
545 | descend.AgentData.Descendents = 40; | ||
546 | } | ||
541 | int i = 0; | 547 | int i = 0; |
542 | foreach (InventoryItemBase item in items) | 548 | foreach (InventoryItemBase item in items) |
543 | { | 549 | { |
@@ -564,10 +570,45 @@ namespace OpenSim.Region.ClientStack | |||
564 | descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); | 570 | descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); |
565 | 571 | ||
566 | i++; | 572 | i++; |
573 | count++; | ||
574 | if (i == 40) | ||
575 | { | ||
576 | this.OutPacket(descend); | ||
577 | |||
578 | if ((items.Count - count) > 0) | ||
579 | { | ||
580 | descend = this.CreateInventoryDescendentsPacket(ownerID, folderID); | ||
581 | if ((items.Count - count) < 40) | ||
582 | { | ||
583 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count]; | ||
584 | descend.AgentData.Descendents = items.Count - count; | ||
585 | } | ||
586 | else | ||
587 | { | ||
588 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40]; | ||
589 | descend.AgentData.Descendents = 40; | ||
590 | } | ||
591 | i = 0; | ||
592 | } | ||
593 | } | ||
594 | } | ||
595 | |||
596 | if (i < 40) | ||
597 | { | ||
598 | this.OutPacket(descend); | ||
567 | } | 599 | } |
568 | 600 | ||
569 | this.OutPacket(descend); | 601 | } |
602 | |||
603 | private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) | ||
604 | { | ||
605 | InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); | ||
606 | descend.AgentData.AgentID = this.AgentId; | ||
607 | descend.AgentData.OwnerID = ownerID; | ||
608 | descend.AgentData.FolderID = folderID; | ||
609 | descend.AgentData.Version = 0; | ||
570 | 610 | ||
611 | return descend; | ||
571 | } | 612 | } |
572 | 613 | ||
573 | public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) | 614 | public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) |