diff options
author | Justin Clark-Casey (justincc) | 2012-12-08 01:29:58 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-12-08 01:29:58 +0000 |
commit | 63cff49bceab2a8edc889d1abaae840512bf60e6 (patch) | |
tree | 9b8bf7cf4f236d1772916902a7df61c7251fc05f /OpenSim | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-63cff49bceab2a8edc889d1abaae840512bf60e6.zip opensim-SC-63cff49bceab2a8edc889d1abaae840512bf60e6.tar.gz opensim-SC-63cff49bceab2a8edc889d1abaae840512bf60e6.tar.bz2 opensim-SC-63cff49bceab2a8edc889d1abaae840512bf60e6.tar.xz |
Re-enable code disabled in f605a62 to allow a TaskInventoryAccepted message to nominate a non-root destination folder.
This is in relation to http://opensimulator.org/mantis/view.php?id=6311
This is after further analysis which shows the viewer expects the server to move the folder for #RLV give but then should be renaming the folder itself.
For some reason this is not happening, possibly because we are not sending BulkUpdates or because we are not using transaction IDs properly.
This needs to be fixed in the future.
However, moving the folder even if the rename isn't correctly triggered in the viewer seems preferable to disabling this code altogether.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 138 |
1 files changed, 68 insertions, 70 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 582aac4..bcb7f42 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -300,76 +300,74 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | // Disabled for now as it looks like http://opensimulator.org/mantis/view.php?id=6311 was fixed by fixes | 303 | // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~<name> |
304 | // to inventory folder versioning allowing the viewer to move the received folder itself as happens on the | 304 | // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be |
305 | // LL grid. Doing it again server-side then wrongly does a second create and move | 305 | // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet |
306 | // // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name> | 306 | // happening, possibly because we are not sending the correct inventory update messages with the correct |
307 | // // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis | 307 | // transaction IDs |
308 | // // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously | 308 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
309 | // // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here. | 309 | { |
310 | // else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 310 | UUID destinationFolderID = UUID.Zero; |
311 | // { | 311 | |
312 | // UUID destinationFolderID = UUID.Zero; | 312 | if (im.binaryBucket != null && im.binaryBucket.Length >= 16) |
313 | // | 313 | { |
314 | // if (im.binaryBucket != null && im.binaryBucket.Length >= 16) | 314 | destinationFolderID = new UUID(im.binaryBucket, 0); |
315 | // { | 315 | } |
316 | // destinationFolderID = new UUID(im.binaryBucket, 0); | 316 | |
317 | // } | 317 | if (destinationFolderID != UUID.Zero) |
318 | // | 318 | { |
319 | // if (destinationFolderID != UUID.Zero) | 319 | InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId); |
320 | // { | 320 | if (destinationFolder == null) |
321 | // InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId); | 321 | { |
322 | // if (destinationFolder == null) | 322 | m_log.WarnFormat( |
323 | // { | 323 | "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist", |
324 | // m_log.WarnFormat( | 324 | client.Name, scene.Name, destinationFolderID); |
325 | // "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist", | 325 | |
326 | // client.Name, scene.Name, destinationFolderID); | 326 | return; |
327 | // | 327 | } |
328 | // return; | 328 | |
329 | // } | 329 | IInventoryService invService = scene.InventoryService; |
330 | // | 330 | |
331 | // IInventoryService invService = scene.InventoryService; | 331 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
332 | // | 332 | |
333 | // UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 333 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
334 | // | 334 | item = invService.GetItem(item); |
335 | // InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 335 | InventoryFolderBase folder = null; |
336 | // item = invService.GetItem(item); | 336 | UUID? previousParentFolderID = null; |
337 | // InventoryFolderBase folder = null; | 337 | |
338 | // UUID? previousParentFolderID = null; | 338 | if (item != null) // It's an item |
339 | // | 339 | { |
340 | // if (item != null) // It's an item | 340 | previousParentFolderID = item.Folder; |
341 | // { | 341 | item.Folder = destinationFolderID; |
342 | // previousParentFolderID = item.Folder; | 342 | |
343 | // item.Folder = destinationFolderID; | 343 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); |
344 | // | 344 | scene.AddInventoryItem(client, item); |
345 | // invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); | 345 | } |
346 | // scene.AddInventoryItem(client, item); | 346 | else |
347 | // } | 347 | { |
348 | // else | 348 | folder = new InventoryFolderBase(inventoryID, client.AgentId); |
349 | // { | 349 | folder = invService.GetFolder(folder); |
350 | // folder = new InventoryFolderBase(inventoryID, client.AgentId); | 350 | |
351 | // folder = invService.GetFolder(folder); | 351 | if (folder != null) // It's a folder |
352 | // | 352 | { |
353 | // if (folder != null) // It's a folder | 353 | previousParentFolderID = folder.ParentID; |
354 | // { | 354 | folder.ParentID = destinationFolderID; |
355 | // previousParentFolderID = folder.ParentID; | 355 | invService.MoveFolder(folder); |
356 | // folder.ParentID = destinationFolderID; | 356 | } |
357 | // invService.MoveFolder(folder); | 357 | } |
358 | // } | 358 | |
359 | // } | 359 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). |
360 | // | 360 | if (previousParentFolderID != null) |
361 | // // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | 361 | { |
362 | // if (previousParentFolderID != null) | 362 | InventoryFolderBase previousParentFolder |
363 | // { | 363 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); |
364 | // InventoryFolderBase previousParentFolder | 364 | previousParentFolder = invService.GetFolder(previousParentFolder); |
365 | // = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | 365 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); |
366 | // previousParentFolder = invService.GetFolder(previousParentFolder); | 366 | |
367 | // scene.SendInventoryUpdate(client, previousParentFolder, true, true); | 367 | scene.SendInventoryUpdate(client, destinationFolder, true, true); |
368 | // | 368 | } |
369 | // scene.SendInventoryUpdate(client, destinationFolder, true, true); | 369 | } |
370 | // } | 370 | } |
371 | // } | ||
372 | // } | ||
373 | else if ( | 371 | else if ( |
374 | im.dialog == (byte)InstantMessageDialog.InventoryDeclined | 372 | im.dialog == (byte)InstantMessageDialog.InventoryDeclined |
375 | || im.dialog == (byte)InstantMessageDialog.TaskInventoryDeclined) | 373 | || im.dialog == (byte)InstantMessageDialog.TaskInventoryDeclined) |