diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
3 files changed, 109 insertions, 36 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index ee10d04..0833154 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -635,4 +635,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
635 | m_assetsLoaded = true; | 635 | m_assetsLoaded = true; |
636 | } | 636 | } |
637 | } | 637 | } |
638 | } \ No newline at end of file | 638 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index a26c73a..8560c73 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -178,9 +178,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
178 | InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, | 178 | InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, |
179 | Dictionary<string, object> options, IUserAccountService userAccountService) | 179 | Dictionary<string, object> options, IUserAccountService userAccountService) |
180 | { | 180 | { |
181 | if (options.ContainsKey("verbose")) | ||
182 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving folder {0}", inventoryFolder.Name); | ||
183 | |||
184 | if (saveThisFolderItself) | 181 | if (saveThisFolderItself) |
185 | { | 182 | { |
186 | path += CreateArchiveFolderName(inventoryFolder); | 183 | path += CreateArchiveFolderName(inventoryFolder); |
@@ -450,4 +447,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
450 | return s; | 447 | return s; |
451 | } | 448 | } |
452 | } | 449 | } |
453 | } \ No newline at end of file | 450 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 19c774f..da708d2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
175 | if (im.binaryBucket.Length < 17) // Invalid | 175 | if (im.binaryBucket.Length < 17) // Invalid |
176 | return; | 176 | return; |
177 | 177 | ||
178 | UUID receipientID = new UUID(im.toAgentID); | 178 | UUID recipientID = new UUID(im.toAgentID); |
179 | ScenePresence user = scene.GetScenePresence(receipientID); | 179 | ScenePresence user = scene.GetScenePresence(recipientID); |
180 | UUID copyID; | 180 | UUID copyID; |
181 | 181 | ||
182 | // First byte is the asset type | 182 | // First byte is the asset type |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
191 | folderID, new UUID(im.toAgentID)); | 191 | folderID, new UUID(im.toAgentID)); |
192 | 192 | ||
193 | InventoryFolderBase folderCopy | 193 | InventoryFolderBase folderCopy |
194 | = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); | 194 | = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero); |
195 | 195 | ||
196 | if (folderCopy == null) | 196 | if (folderCopy == null) |
197 | { | 197 | { |
@@ -244,6 +244,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
244 | im.imSessionID = itemID.Guid; | 244 | im.imSessionID = itemID.Guid; |
245 | } | 245 | } |
246 | 246 | ||
247 | im.offline = 0; | ||
248 | |||
247 | // Send the IM to the recipient. The item is already | 249 | // Send the IM to the recipient. The item is already |
248 | // in their inventory, so it will not be lost if | 250 | // in their inventory, so it will not be lost if |
249 | // they are offline. | 251 | // they are offline. |
@@ -263,7 +265,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
263 | }); | 265 | }); |
264 | } | 266 | } |
265 | } | 267 | } |
266 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) | 268 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || |
269 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
267 | { | 270 | { |
268 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 271 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
269 | 272 | ||
@@ -274,30 +277,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
274 | else | 277 | else |
275 | { | 278 | { |
276 | if (m_TransferModule != null) | 279 | if (m_TransferModule != null) |
277 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { | 280 | m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); |
278 | |||
279 | // justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011 | ||
280 | // and is apparently supposed to fix bulk inventory updates after accepting items. But | ||
281 | // instead it appears to cause two copies of an accepted folder for the receiving user in | ||
282 | // at least some cases. Folder/item update is already done when the offer is made (see code above) | ||
283 | |||
284 | // // Send BulkUpdateInventory | ||
285 | // IInventoryService invService = scene.InventoryService; | ||
286 | // UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip | ||
287 | // | ||
288 | // InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); | ||
289 | // folder = invService.GetFolder(folder); | ||
290 | // | ||
291 | // ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); | ||
292 | // | ||
293 | // // If the user has left the scene by the time the message comes back then we can't send | ||
294 | // // them the update. | ||
295 | // if (fromUser != null) | ||
296 | // fromUser.ControllingClient.SendBulkUpdateInventory(folder); | ||
297 | }); | ||
298 | } | 281 | } |
299 | } | 282 | } |
300 | else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) | 283 | else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined || |
284 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined) | ||
301 | { | 285 | { |
302 | // Here, the recipient is local and we can assume that the | 286 | // Here, the recipient is local and we can assume that the |
303 | // inventory is loaded. Courtesy of the above bulk update, | 287 | // inventory is loaded. Courtesy of the above bulk update, |
@@ -333,6 +317,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
333 | { | 317 | { |
334 | folder.ParentID = trashFolder.ID; | 318 | folder.ParentID = trashFolder.ID; |
335 | invService.MoveFolder(folder); | 319 | invService.MoveFolder(folder); |
320 | client.SendBulkUpdateInventory(folder); | ||
336 | } | 321 | } |
337 | } | 322 | } |
338 | 323 | ||
@@ -433,22 +418,113 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
433 | /// | 418 | /// |
434 | /// </summary> | 419 | /// </summary> |
435 | /// <param name="msg"></param> | 420 | /// <param name="msg"></param> |
436 | private void OnGridInstantMessage(GridInstantMessage msg) | 421 | private void OnGridInstantMessage(GridInstantMessage im) |
437 | { | 422 | { |
438 | // Check if this is ours to handle | 423 | // Check if this is ours to handle |
439 | // | 424 | // |
440 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 425 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
441 | 426 | ||
442 | if (scene == null) | 427 | if (scene == null) |
443 | return; | 428 | return; |
444 | 429 | ||
445 | // Find agent to deliver to | 430 | // Find agent to deliver to |
446 | // | 431 | // |
447 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 432 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
433 | if (user == null) | ||
434 | return; | ||
435 | |||
436 | // This requires a little bit of processing because we have to make the | ||
437 | // new item visible in the recipient's inventory here | ||
438 | // | ||
439 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
440 | { | ||
441 | if (im.binaryBucket.Length < 17) // Invalid | ||
442 | return; | ||
443 | |||
444 | UUID recipientID = new UUID(im.toAgentID); | ||
445 | |||
446 | // First byte is the asset type | ||
447 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
448 | |||
449 | if (AssetType.Folder == assetType) | ||
450 | { | ||
451 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
448 | 452 | ||
449 | // Just forward to local handling | 453 | InventoryFolderBase given = |
450 | OnInstantMessage(user.ControllingClient, msg); | 454 | new InventoryFolderBase(folderID, recipientID); |
455 | InventoryFolderBase folder = | ||
456 | scene.InventoryService.GetFolder(given); | ||
451 | 457 | ||
458 | if (folder != null) | ||
459 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
460 | } | ||
461 | else | ||
462 | { | ||
463 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
464 | |||
465 | InventoryItemBase given = | ||
466 | new InventoryItemBase(itemID, recipientID); | ||
467 | InventoryItemBase item = | ||
468 | scene.InventoryService.GetItem(given); | ||
469 | |||
470 | if (item != null) | ||
471 | { | ||
472 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
473 | } | ||
474 | } | ||
475 | user.ControllingClient.SendInstantMessage(im); | ||
476 | } | ||
477 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | ||
478 | { | ||
479 | if (im.binaryBucket.Length < 1) // Invalid | ||
480 | return; | ||
481 | |||
482 | UUID recipientID = new UUID(im.toAgentID); | ||
483 | |||
484 | // Bucket is the asset type | ||
485 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
486 | |||
487 | if (AssetType.Folder == assetType) | ||
488 | { | ||
489 | UUID folderID = new UUID(im.imSessionID); | ||
490 | |||
491 | InventoryFolderBase given = | ||
492 | new InventoryFolderBase(folderID, recipientID); | ||
493 | InventoryFolderBase folder = | ||
494 | scene.InventoryService.GetFolder(given); | ||
495 | |||
496 | if (folder != null) | ||
497 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
498 | } | ||
499 | else | ||
500 | { | ||
501 | UUID itemID = new UUID(im.imSessionID); | ||
502 | |||
503 | InventoryItemBase given = | ||
504 | new InventoryItemBase(itemID, recipientID); | ||
505 | InventoryItemBase item = | ||
506 | scene.InventoryService.GetItem(given); | ||
507 | |||
508 | if (item != null) | ||
509 | { | ||
510 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
511 | } | ||
512 | } | ||
513 | |||
514 | // Fix up binary bucket since this may be 17 chars long here | ||
515 | Byte[] bucket = new Byte[1]; | ||
516 | bucket[0] = im.binaryBucket[0]; | ||
517 | im.binaryBucket = bucket; | ||
518 | |||
519 | user.ControllingClient.SendInstantMessage(im); | ||
520 | } | ||
521 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
522 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined || | ||
523 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined || | ||
524 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
525 | { | ||
526 | user.ControllingClient.SendInstantMessage(im); | ||
527 | } | ||
452 | } | 528 | } |
453 | } | 529 | } |
454 | } | 530 | } |