diff options
author | Charles Krinke | 2008-08-16 19:37:30 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-16 19:37:30 +0000 |
commit | 7a90385f1cf89fcf6604ab2290e936b0d3d3478f (patch) | |
tree | 1caf26ba549847725ff40f0613074065a1dfe25c /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |
parent | Mantis#1969. Thank you kindly, Tyre for a patch that: (diff) | |
download | opensim-SC-7a90385f1cf89fcf6604ab2290e936b0d3d3478f.zip opensim-SC-7a90385f1cf89fcf6604ab2290e936b0d3d3478f.tar.gz opensim-SC-7a90385f1cf89fcf6604ab2290e936b0d3d3478f.tar.bz2 opensim-SC-7a90385f1cf89fcf6604ab2290e936b0d3d3478f.tar.xz |
Mantis#1970. Thank you kindly, HomerHorwitz for a patch that:
This patch improves fetching of inventory from several minutes
to a few seconds.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b616acb..4869858 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1437,22 +1437,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1437 | if (items.Count < MAX_ITEMS_PER_PACKET) | 1437 | if (items.Count < MAX_ITEMS_PER_PACKET) |
1438 | { | 1438 | { |
1439 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; | 1439 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; |
1440 | descend.AgentData.Descendents = items.Count; | ||
1441 | } | 1440 | } |
1442 | else | 1441 | else |
1443 | { | 1442 | { |
1444 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET]; | 1443 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET]; |
1445 | descend.AgentData.Descendents = MAX_ITEMS_PER_PACKET; | ||
1446 | } | 1444 | } |
1447 | 1445 | ||
1448 | // Even if we aren't fetching the folders, we still need to include the folder count | 1446 | // Descendents must contain the *total* number of descendents (plus folders, whether we |
1449 | // in the total number of descendents. Failure to do so will cause subtle bugs such | 1447 | // fetch them or not), not the number of entries we send in this packet. For consistency, |
1450 | // as the failure of textures which haven't been expanded in inventory to show up | 1448 | // I'll use it for folder-requests, too, although I wasn't able to get one with |
1451 | // in the texture prim edit selection panel. | 1449 | // FetchFolders = true. |
1452 | if (!fetchFolders) | 1450 | // TODO this should be checked with FetchFolders = true |
1453 | { | 1451 | descend.AgentData.Descendents = items.Count + folders.Count; |
1454 | descend.AgentData.Descendents += folders.Count; | ||
1455 | } | ||
1456 | 1452 | ||
1457 | int count = 0; | 1453 | int count = 0; |
1458 | int i = 0; | 1454 | int i = 0; |
@@ -1506,13 +1502,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1506 | if ((items.Count - count) < MAX_ITEMS_PER_PACKET) | 1502 | if ((items.Count - count) < MAX_ITEMS_PER_PACKET) |
1507 | { | 1503 | { |
1508 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count]; | 1504 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count]; |
1509 | descend.AgentData.Descendents = items.Count - count; | ||
1510 | } | 1505 | } |
1511 | else | 1506 | else |
1512 | { | 1507 | { |
1513 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET]; | 1508 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET]; |
1514 | descend.AgentData.Descendents = MAX_ITEMS_PER_PACKET; | ||
1515 | } | 1509 | } |
1510 | descend.AgentData.Descendents = items.Count + folders.Count; | ||
1516 | i = 0; | 1511 | i = 0; |
1517 | } | 1512 | } |
1518 | } | 1513 | } |
@@ -1532,20 +1527,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1532 | if (folders.Count < MAX_ITEMS_PER_PACKET) | 1527 | if (folders.Count < MAX_ITEMS_PER_PACKET) |
1533 | { | 1528 | { |
1534 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count]; | 1529 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count]; |
1535 | descend.AgentData.Descendents = folders.Count; | ||
1536 | } | 1530 | } |
1537 | else | 1531 | else |
1538 | { | 1532 | { |
1539 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET]; | 1533 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET]; |
1540 | descend.AgentData.Descendents = MAX_ITEMS_PER_PACKET; | ||
1541 | } | 1534 | } |
1542 | 1535 | ||
1543 | // Not sure if this scenario ever actually occurs, but nonetheless we include the items | 1536 | // Not sure if this scenario ever actually occurs, but nonetheless we include the items |
1544 | // count even if we're not sending item data for the same reasons as above. | 1537 | // count even if we're not sending item data for the same reasons as above. |
1545 | if (!fetchItems) | 1538 | descend.AgentData.Descendents = items.Count + folders.Count; |
1546 | { | ||
1547 | descend.AgentData.Descendents += items.Count; | ||
1548 | } | ||
1549 | 1539 | ||
1550 | int i = 0; | 1540 | int i = 0; |
1551 | int count = 0; | 1541 | int count = 0; |
@@ -1570,14 +1560,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1570 | { | 1560 | { |
1571 | descend.FolderData = | 1561 | descend.FolderData = |
1572 | new InventoryDescendentsPacket.FolderDataBlock[folders.Count - count]; | 1562 | new InventoryDescendentsPacket.FolderDataBlock[folders.Count - count]; |
1573 | descend.AgentData.Descendents = folders.Count - count; | ||
1574 | } | 1563 | } |
1575 | else | 1564 | else |
1576 | { | 1565 | { |
1577 | descend.FolderData = | 1566 | descend.FolderData = |
1578 | new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET]; | 1567 | new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET]; |
1579 | descend.AgentData.Descendents = MAX_ITEMS_PER_PACKET; | ||
1580 | } | 1568 | } |
1569 | descend.AgentData.Descendents = items.Count + folders.Count; | ||
1581 | i = 0; | 1570 | i = 0; |
1582 | } | 1571 | } |
1583 | } | 1572 | } |