diff options
author | root | 2011-06-30 00:26:03 +0100 |
---|---|---|
committer | root | 2011-06-30 00:26:03 +0100 |
commit | 5f927dc104aac48707c0ea2ff77a3410c3857ecc (patch) | |
tree | 123324ae910db49349e7b07749f49cd172a3d037 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Remove friends debug spam (diff) | |
parent | Don't follow inventory links of links. (diff) | |
download | opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.zip opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.gz opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.bz2 opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c04bbb4..28c0276 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1347 | // m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", | 1347 | // m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", |
1348 | // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); | 1348 | // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); |
1349 | 1349 | ||
1350 | if (containingFolder != null && containingFolder != null) | 1350 | if (containingFolder != null) |
1351 | { | 1351 | { |
1352 | // If the folder requested contains links, then we need to send those folders first, otherwise the links | 1352 | // If the folder requested contains links, then we need to send those folders first, otherwise the links |
1353 | // will be broken in the viewer. | 1353 | // will be broken in the viewer. |
@@ -1359,15 +1359,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | 1359 | InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID)); |
1360 | 1360 | ||
1361 | // Take care of genuinely broken links where the target doesn't exist | 1361 | // Take care of genuinely broken links where the target doesn't exist |
1362 | if (linkedItem != null) | 1362 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, |
1363 | linkedItemFolderIdsToSend.Add(linkedItem.Folder); | 1363 | // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles |
1364 | // rather than having to keep track of every folder requested in the recursion. | ||
1365 | if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) | ||
1366 | { | ||
1367 | // We don't need to send the folder if source and destination of the link are in the same | ||
1368 | // folder. | ||
1369 | if (linkedItem.Folder != containingFolder.ID) | ||
1370 | linkedItemFolderIdsToSend.Add(linkedItem.Folder); | ||
1371 | } | ||
1364 | } | 1372 | } |
1365 | } | 1373 | } |
1366 | 1374 | ||
1367 | foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) | 1375 | foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) |
1368 | SendInventoryUpdate(client, new InventoryFolderBase(linkedItemFolderId), false, true); | 1376 | SendInventoryUpdate(client, new InventoryFolderBase(linkedItemFolderId), false, true); |
1369 | 1377 | ||
1370 | client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems); | 1378 | client.SendInventoryFolderDetails( |
1379 | client.AgentId, folder.ID, contents.Items, contents.Folders, | ||
1380 | containingFolder.Version, fetchFolders, fetchItems); | ||
1371 | } | 1381 | } |
1372 | } | 1382 | } |
1373 | 1383 | ||