diff options
author | Jeff Ames | 2009-03-11 18:46:52 +0000 |
---|---|---|
committer | Jeff Ames | 2009-03-11 18:46:52 +0000 |
commit | 64620142506ca27f44b3623eeb96be3c3b24f6c4 (patch) | |
tree | 4e5f0153ae6f9ee1e6a7e9bb3e418debf0aa6caf /OpenSim/Region | |
parent | * fix build break (diff) | |
download | opensim-SC-64620142506ca27f44b3623eeb96be3c3b24f6c4.zip opensim-SC-64620142506ca27f44b3623eeb96be3c3b24f6c4.tar.gz opensim-SC-64620142506ca27f44b3623eeb96be3c3b24f6c4.tar.bz2 opensim-SC-64620142506ca27f44b3623eeb96be3c3b24f6c4.tar.xz |
Thanks rtomita for a patch to fix inventory listings for clients using libomv. (#3285)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ac427d7..95519bc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1654,6 +1654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1654 | //Ckrinke This variable is not used, so comment out to remove the warning from the compiler (3-21-08) | 1654 | //Ckrinke This variable is not used, so comment out to remove the warning from the compiler (3-21-08) |
1655 | //Ckrinke uint FULL_MASK_PERMISSIONS = 2147483647; | 1655 | //Ckrinke uint FULL_MASK_PERMISSIONS = 2147483647; |
1656 | 1656 | ||
1657 | int itemsSent = 0; | ||
1657 | if (fetchItems) | 1658 | if (fetchItems) |
1658 | { | 1659 | { |
1659 | InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID); | 1660 | InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID); |
@@ -1714,9 +1715,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1714 | 1715 | ||
1715 | i++; | 1716 | i++; |
1716 | count++; | 1717 | count++; |
1718 | itemsSent++; | ||
1717 | if (i == MAX_ITEMS_PER_PACKET) | 1719 | if (i == MAX_ITEMS_PER_PACKET) |
1718 | { | 1720 | { |
1719 | descend.Header.Zerocoded = true; | 1721 | descend.Header.Zerocoded = true; |
1722 | AddNullFolderBlockToDecendentsPacket(ref descend); | ||
1720 | OutPacket(descend, ThrottleOutPacketType.Asset); | 1723 | OutPacket(descend, ThrottleOutPacketType.Asset); |
1721 | 1724 | ||
1722 | if ((items.Count - count) > 0) | 1725 | if ((items.Count - count) > 0) |
@@ -1736,8 +1739,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1736 | } | 1739 | } |
1737 | } | 1740 | } |
1738 | 1741 | ||
1739 | if (i < MAX_ITEMS_PER_PACKET) | 1742 | if (0 < i && i < MAX_ITEMS_PER_PACKET) |
1740 | { | 1743 | { |
1744 | AddNullFolderBlockToDecendentsPacket(ref descend); | ||
1741 | OutPacket(descend, ThrottleOutPacketType.Asset); | 1745 | OutPacket(descend, ThrottleOutPacketType.Asset); |
1742 | } | 1746 | } |
1743 | } | 1747 | } |
@@ -1772,8 +1776,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1772 | 1776 | ||
1773 | i++; | 1777 | i++; |
1774 | count++; | 1778 | count++; |
1779 | itemsSent++; | ||
1775 | if (i == MAX_ITEMS_PER_PACKET) | 1780 | if (i == MAX_ITEMS_PER_PACKET) |
1776 | { | 1781 | { |
1782 | AddNullItemBlockToDescendentsPacket(ref descend); | ||
1777 | OutPacket(descend, ThrottleOutPacketType.Asset); | 1783 | OutPacket(descend, ThrottleOutPacketType.Asset); |
1778 | 1784 | ||
1779 | if ((folders.Count - count) > 0) | 1785 | if ((folders.Count - count) > 0) |
@@ -1795,11 +1801,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1795 | } | 1801 | } |
1796 | } | 1802 | } |
1797 | 1803 | ||
1798 | if (i < MAX_ITEMS_PER_PACKET) | 1804 | if (0 < i && i < MAX_ITEMS_PER_PACKET) |
1799 | { | 1805 | { |
1806 | AddNullItemBlockToDescendentsPacket(ref descend); | ||
1800 | OutPacket(descend, ThrottleOutPacketType.Asset); | 1807 | OutPacket(descend, ThrottleOutPacketType.Asset); |
1801 | } | 1808 | } |
1802 | } | 1809 | } |
1810 | |||
1811 | if (itemsSent == 0) | ||
1812 | { | ||
1813 | // no items found. | ||
1814 | InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID); | ||
1815 | descend.AgentData.Descendents = 0; | ||
1816 | AddNullItemBlockToDescendentsPacket(ref descend); | ||
1817 | AddNullFolderBlockToDecendentsPacket(ref descend); | ||
1818 | OutPacket(descend, ThrottleOutPacketType.Asset); | ||
1819 | } | ||
1820 | } | ||
1821 | |||
1822 | private void AddNullFolderBlockToDecendentsPacket(ref InventoryDescendentsPacket packet) | ||
1823 | { | ||
1824 | packet.FolderData = new InventoryDescendentsPacket.FolderDataBlock[1]; | ||
1825 | packet.FolderData[0] = new InventoryDescendentsPacket.FolderDataBlock(); | ||
1826 | packet.FolderData[0].FolderID = UUID.Zero; | ||
1827 | packet.FolderData[0].ParentID = UUID.Zero; | ||
1828 | packet.FolderData[0].Type = -1; | ||
1829 | packet.FolderData[0].Name = new byte[0]; | ||
1830 | } | ||
1831 | |||
1832 | private void AddNullItemBlockToDescendentsPacket(ref InventoryDescendentsPacket packet) | ||
1833 | { | ||
1834 | packet.ItemData = new InventoryDescendentsPacket.ItemDataBlock[1]; | ||
1835 | packet.ItemData[0] = new InventoryDescendentsPacket.ItemDataBlock(); | ||
1836 | packet.ItemData[0].ItemID = UUID.Zero; | ||
1837 | packet.ItemData[0].AssetID = UUID.Zero; | ||
1838 | packet.ItemData[0].CreatorID = UUID.Zero; | ||
1839 | packet.ItemData[0].BaseMask = 0; | ||
1840 | packet.ItemData[0].Description = new byte[0]; | ||
1841 | packet.ItemData[0].EveryoneMask = 0; | ||
1842 | packet.ItemData[0].OwnerMask = 0; | ||
1843 | packet.ItemData[0].FolderID = UUID.Zero; | ||
1844 | packet.ItemData[0].InvType = (sbyte)0; | ||
1845 | packet.ItemData[0].Name = new byte[0]; | ||
1846 | packet.ItemData[0].NextOwnerMask = 0; | ||
1847 | packet.ItemData[0].OwnerID = UUID.Zero; | ||
1848 | packet.ItemData[0].Type = -1; | ||
1849 | |||
1850 | packet.ItemData[0].GroupID = UUID.Zero; | ||
1851 | packet.ItemData[0].GroupOwned = false; | ||
1852 | packet.ItemData[0].GroupMask = 0; | ||
1853 | packet.ItemData[0].CreationDate = 0; | ||
1854 | packet.ItemData[0].SalePrice = 0; | ||
1855 | packet.ItemData[0].SaleType = 0; | ||
1856 | packet.ItemData[0].Flags = 0; | ||
1857 | |||
1858 | // No need to add CRC | ||
1803 | } | 1859 | } |
1804 | 1860 | ||
1805 | private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID) | 1861 | private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID) |