diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
3 files changed, 142 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 31c42d8..d56e469 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -656,4 +656,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
656 | m_assetsLoaded = true; | 656 | m_assetsLoaded = true; |
657 | } | 657 | } |
658 | } | 658 | } |
659 | } \ No newline at end of file | 659 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 797097f..cef6177 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -519,6 +519,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
519 | return null; | 519 | return null; |
520 | } | 520 | } |
521 | 521 | ||
522 | return account; | ||
523 | /* | ||
522 | try | 524 | try |
523 | { | 525 | { |
524 | string encpass = Util.Md5Hash(pass); | 526 | string encpass = Util.Md5Hash(pass); |
@@ -539,6 +541,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
539 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); | 541 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); |
540 | return null; | 542 | return null; |
541 | } | 543 | } |
544 | */ | ||
542 | } | 545 | } |
543 | 546 | ||
544 | /// <summary> | 547 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 1417a19..e285f21 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -164,8 +164,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
164 | if (im.binaryBucket.Length < 17) // Invalid | 164 | if (im.binaryBucket.Length < 17) // Invalid |
165 | return; | 165 | return; |
166 | 166 | ||
167 | UUID receipientID = new UUID(im.toAgentID); | 167 | UUID recipientID = new UUID(im.toAgentID); |
168 | ScenePresence user = scene.GetScenePresence(receipientID); | 168 | ScenePresence user = scene.GetScenePresence(recipientID); |
169 | UUID copyID; | 169 | UUID copyID; |
170 | 170 | ||
171 | // First byte is the asset type | 171 | // First byte is the asset type |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
180 | folderID, new UUID(im.toAgentID)); | 180 | folderID, new UUID(im.toAgentID)); |
181 | 181 | ||
182 | InventoryFolderBase folderCopy | 182 | InventoryFolderBase folderCopy |
183 | = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); | 183 | = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero); |
184 | 184 | ||
185 | if (folderCopy == null) | 185 | if (folderCopy == null) |
186 | { | 186 | { |
@@ -239,6 +239,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
239 | im.imSessionID = copyID.Guid; | 239 | im.imSessionID = copyID.Guid; |
240 | } | 240 | } |
241 | 241 | ||
242 | im.offline = 0; | ||
243 | |||
242 | // Send the IM to the recipient. The item is already | 244 | // Send the IM to the recipient. The item is already |
243 | // in their inventory, so it will not be lost if | 245 | // in their inventory, so it will not be lost if |
244 | // they are offline. | 246 | // they are offline. |
@@ -258,8 +260,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
258 | }); | 260 | }); |
259 | } | 261 | } |
260 | } | 262 | } |
261 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) | 263 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || |
264 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
262 | { | 265 | { |
266 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | ||
267 | IInventoryService invService = scene.InventoryService; | ||
268 | |||
269 | // Special case: folder redirect. | ||
270 | // RLV uses this | ||
271 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
272 | { | ||
273 | InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId); | ||
274 | folder = invService.GetFolder(folder); | ||
275 | |||
276 | if (folder != null) | ||
277 | { | ||
278 | if (im.binaryBucket.Length >= 16) | ||
279 | { | ||
280 | UUID destFolderID = new UUID(im.binaryBucket, 0); | ||
281 | if (destFolderID != UUID.Zero) | ||
282 | { | ||
283 | InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId); | ||
284 | destFolder = invService.GetFolder(destFolder); | ||
285 | if (destFolder != null) | ||
286 | { | ||
287 | if (folder.ParentID != destFolder.ID) | ||
288 | { | ||
289 | folder.ParentID = destFolder.ID; | ||
290 | invService.MoveFolder(folder); | ||
291 | client.SendBulkUpdateInventory(folder); | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | } | ||
296 | } | ||
297 | } | ||
298 | |||
263 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 299 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
264 | 300 | ||
265 | if (user != null) // Local | 301 | if (user != null) // Local |
@@ -269,27 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
269 | else | 305 | else |
270 | { | 306 | { |
271 | if (m_TransferModule != null) | 307 | if (m_TransferModule != null) |
272 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { | 308 | m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); |
273 | |||
274 | // justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011 | ||
275 | // and is apparently supposed to fix bulk inventory updates after accepting items. But | ||
276 | // instead it appears to cause two copies of an accepted folder for the receiving user in | ||
277 | // at least some cases. Folder/item update is already done when the offer is made (see code above) | ||
278 | |||
279 | // // Send BulkUpdateInventory | ||
280 | // IInventoryService invService = scene.InventoryService; | ||
281 | // UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip | ||
282 | // | ||
283 | // InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); | ||
284 | // folder = invService.GetFolder(folder); | ||
285 | // | ||
286 | // ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); | ||
287 | // | ||
288 | // // If the user has left the scene by the time the message comes back then we can't send | ||
289 | // // them the update. | ||
290 | // if (fromUser != null) | ||
291 | // fromUser.ControllingClient.SendBulkUpdateInventory(folder); | ||
292 | }); | ||
293 | } | 309 | } |
294 | } | 310 | } |
295 | 311 | ||
@@ -402,6 +418,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
402 | previousParentFolderID = folder.ParentID; | 418 | previousParentFolderID = folder.ParentID; |
403 | folder.ParentID = trashFolder.ID; | 419 | folder.ParentID = trashFolder.ID; |
404 | invService.MoveFolder(folder); | 420 | invService.MoveFolder(folder); |
421 | client.SendBulkUpdateInventory(folder); | ||
405 | } | 422 | } |
406 | } | 423 | } |
407 | 424 | ||
@@ -451,22 +468,113 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
451 | /// | 468 | /// |
452 | /// </summary> | 469 | /// </summary> |
453 | /// <param name="msg"></param> | 470 | /// <param name="msg"></param> |
454 | private void OnGridInstantMessage(GridInstantMessage msg) | 471 | private void OnGridInstantMessage(GridInstantMessage im) |
455 | { | 472 | { |
456 | // Check if this is ours to handle | 473 | // Check if this is ours to handle |
457 | // | 474 | // |
458 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 475 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
459 | 476 | ||
460 | if (scene == null) | 477 | if (scene == null) |
461 | return; | 478 | return; |
462 | 479 | ||
463 | // Find agent to deliver to | 480 | // Find agent to deliver to |
464 | // | 481 | // |
465 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 482 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
483 | if (user == null) | ||
484 | return; | ||
485 | |||
486 | // This requires a little bit of processing because we have to make the | ||
487 | // new item visible in the recipient's inventory here | ||
488 | // | ||
489 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
490 | { | ||
491 | if (im.binaryBucket.Length < 17) // Invalid | ||
492 | return; | ||
493 | |||
494 | UUID recipientID = new UUID(im.toAgentID); | ||
495 | |||
496 | // First byte is the asset type | ||
497 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
498 | |||
499 | if (AssetType.Folder == assetType) | ||
500 | { | ||
501 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
502 | |||
503 | InventoryFolderBase given = | ||
504 | new InventoryFolderBase(folderID, recipientID); | ||
505 | InventoryFolderBase folder = | ||
506 | scene.InventoryService.GetFolder(given); | ||
507 | |||
508 | if (folder != null) | ||
509 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
510 | } | ||
511 | else | ||
512 | { | ||
513 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
466 | 514 | ||
467 | // Just forward to local handling | 515 | InventoryItemBase given = |
468 | OnInstantMessage(user.ControllingClient, msg); | 516 | new InventoryItemBase(itemID, recipientID); |
517 | InventoryItemBase item = | ||
518 | scene.InventoryService.GetItem(given); | ||
519 | |||
520 | if (item != null) | ||
521 | { | ||
522 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
523 | } | ||
524 | } | ||
525 | user.ControllingClient.SendInstantMessage(im); | ||
526 | } | ||
527 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | ||
528 | { | ||
529 | if (im.binaryBucket.Length < 1) // Invalid | ||
530 | return; | ||
531 | |||
532 | UUID recipientID = new UUID(im.toAgentID); | ||
469 | 533 | ||
534 | // Bucket is the asset type | ||
535 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
536 | |||
537 | if (AssetType.Folder == assetType) | ||
538 | { | ||
539 | UUID folderID = new UUID(im.imSessionID); | ||
540 | |||
541 | InventoryFolderBase given = | ||
542 | new InventoryFolderBase(folderID, recipientID); | ||
543 | InventoryFolderBase folder = | ||
544 | scene.InventoryService.GetFolder(given); | ||
545 | |||
546 | if (folder != null) | ||
547 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
548 | } | ||
549 | else | ||
550 | { | ||
551 | UUID itemID = new UUID(im.imSessionID); | ||
552 | |||
553 | InventoryItemBase given = | ||
554 | new InventoryItemBase(itemID, recipientID); | ||
555 | InventoryItemBase item = | ||
556 | scene.InventoryService.GetItem(given); | ||
557 | |||
558 | if (item != null) | ||
559 | { | ||
560 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
561 | } | ||
562 | } | ||
563 | |||
564 | // Fix up binary bucket since this may be 17 chars long here | ||
565 | Byte[] bucket = new Byte[1]; | ||
566 | bucket[0] = im.binaryBucket[0]; | ||
567 | im.binaryBucket = bucket; | ||
568 | |||
569 | user.ControllingClient.SendInstantMessage(im); | ||
570 | } | ||
571 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
572 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined || | ||
573 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined || | ||
574 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
575 | { | ||
576 | user.ControllingClient.SendInstantMessage(im); | ||
577 | } | ||
470 | } | 578 | } |
471 | } | 579 | } |
472 | } | 580 | } |