diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 175 |
2 files changed, 137 insertions, 41 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 420520e..5295ba3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -566,6 +566,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
566 | return null; | 566 | return null; |
567 | } | 567 | } |
568 | 568 | ||
569 | return account; | ||
570 | /* | ||
569 | try | 571 | try |
570 | { | 572 | { |
571 | string encpass = Util.Md5Hash(pass); | 573 | string encpass = Util.Md5Hash(pass); |
@@ -586,6 +588,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
586 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e); | 588 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e); |
587 | return null; | 589 | return null; |
588 | } | 590 | } |
591 | */ | ||
589 | } | 592 | } |
590 | 593 | ||
591 | /// <summary> | 594 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index bba48cc..18e18a9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -165,8 +165,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
165 | if (im.binaryBucket.Length < 17) // Invalid | 165 | if (im.binaryBucket.Length < 17) // Invalid |
166 | return; | 166 | return; |
167 | 167 | ||
168 | UUID receipientID = new UUID(im.toAgentID); | 168 | UUID recipientID = new UUID(im.toAgentID); |
169 | ScenePresence user = scene.GetScenePresence(receipientID); | 169 | ScenePresence user = scene.GetScenePresence(recipientID); |
170 | UUID copyID; | 170 | UUID copyID; |
171 | 171 | ||
172 | // First byte is the asset type | 172 | // First byte is the asset type |
@@ -180,8 +180,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", | 180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", |
181 | folderID, new UUID(im.toAgentID)); | 181 | folderID, new UUID(im.toAgentID)); |
182 | 182 | ||
183 | <<<<<<< HEAD | ||
183 | InventoryFolderBase folderCopy | 184 | InventoryFolderBase folderCopy |
184 | = scene.GiveInventoryFolder(client, receipientID, client.AgentId, folderID, UUID.Zero); | 185 | = scene.GiveInventoryFolder(client, receipientID, client.AgentId, folderID, UUID.Zero); |
186 | ======= | ||
187 | InventoryFolderBase folderCopy | ||
188 | = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero); | ||
189 | >>>>>>> avn/ubitvar | ||
185 | 190 | ||
186 | if (folderCopy == null) | 191 | if (folderCopy == null) |
187 | { | 192 | { |
@@ -239,6 +244,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
239 | im.imSessionID = copyID.Guid; | 244 | im.imSessionID = copyID.Guid; |
240 | } | 245 | } |
241 | 246 | ||
247 | im.offline = 0; | ||
248 | |||
242 | // Send the IM to the recipient. The item is already | 249 | // Send the IM to the recipient. The item is already |
243 | // in their inventory, so it will not be lost if | 250 | // in their inventory, so it will not be lost if |
244 | // they are offline. | 251 | // they are offline. |
@@ -258,8 +265,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
258 | }); | 265 | }); |
259 | } | 266 | } |
260 | } | 267 | } |
261 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) | 268 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || |
269 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
262 | { | 270 | { |
271 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | ||
272 | IInventoryService invService = scene.InventoryService; | ||
273 | |||
274 | // Special case: folder redirect. | ||
275 | // RLV uses this | ||
276 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
277 | { | ||
278 | InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId); | ||
279 | folder = invService.GetFolder(folder); | ||
280 | |||
281 | if (folder != null) | ||
282 | { | ||
283 | if (im.binaryBucket.Length >= 16) | ||
284 | { | ||
285 | UUID destFolderID = new UUID(im.binaryBucket, 0); | ||
286 | if (destFolderID != UUID.Zero) | ||
287 | { | ||
288 | InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId); | ||
289 | destFolder = invService.GetFolder(destFolder); | ||
290 | if (destFolder != null) | ||
291 | { | ||
292 | if (folder.ParentID != destFolder.ID) | ||
293 | { | ||
294 | folder.ParentID = destFolder.ID; | ||
295 | invService.MoveFolder(folder); | ||
296 | client.SendBulkUpdateInventory(folder); | ||
297 | } | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | |||
263 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 304 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
264 | 305 | ||
265 | if (user != null) // Local | 306 | if (user != null) // Local |
@@ -269,27 +310,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
269 | else | 310 | else |
270 | { | 311 | { |
271 | if (m_TransferModule != null) | 312 | if (m_TransferModule != null) |
272 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { | 313 | 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 | } | 314 | } |
294 | } | 315 | } |
295 | 316 | ||
@@ -402,6 +423,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
402 | previousParentFolderID = folder.ParentID; | 423 | previousParentFolderID = folder.ParentID; |
403 | folder.ParentID = trashFolder.ID; | 424 | folder.ParentID = trashFolder.ID; |
404 | invService.MoveFolder(folder); | 425 | invService.MoveFolder(folder); |
426 | client.SendBulkUpdateInventory(folder); | ||
405 | } | 427 | } |
406 | } | 428 | } |
407 | 429 | ||
@@ -453,6 +475,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
453 | /// <param name="im"></param> | 475 | /// <param name="im"></param> |
454 | private void OnGridInstantMessage(GridInstantMessage im) | 476 | private void OnGridInstantMessage(GridInstantMessage im) |
455 | { | 477 | { |
478 | <<<<<<< HEAD | ||
456 | // Check if it's a type of message that we should handle | 479 | // Check if it's a type of message that we should handle |
457 | if (!((im.dialog == (byte) InstantMessageDialog.InventoryOffered) | 480 | if (!((im.dialog == (byte) InstantMessageDialog.InventoryOffered) |
458 | || (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | 481 | || (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) |
@@ -465,6 +488,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
465 | "[INVENTORY TRANSFER]: {0} IM type received from grid. From={1} ({2}), To={3}", | 488 | "[INVENTORY TRANSFER]: {0} IM type received from grid. From={1} ({2}), To={3}", |
466 | (InstantMessageDialog)im.dialog, im.fromAgentID, im.fromAgentName, im.toAgentID); | 489 | (InstantMessageDialog)im.dialog, im.fromAgentID, im.fromAgentName, im.toAgentID); |
467 | 490 | ||
491 | ======= | ||
492 | >>>>>>> avn/ubitvar | ||
468 | // Check if this is ours to handle | 493 | // Check if this is ours to handle |
469 | // | 494 | // |
470 | Scene scene = FindClientScene(new UUID(im.toAgentID)); | 495 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
@@ -475,32 +500,100 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
475 | // Find agent to deliver to | 500 | // Find agent to deliver to |
476 | // | 501 | // |
477 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 502 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
503 | if (user == null) | ||
504 | return; | ||
478 | 505 | ||
479 | if (user != null) | 506 | // This requires a little bit of processing because we have to make the |
507 | // new item visible in the recipient's inventory here | ||
508 | // | ||
509 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
480 | { | 510 | { |
481 | user.ControllingClient.SendInstantMessage(im); | 511 | if (im.binaryBucket.Length < 17) // Invalid |
512 | return; | ||
513 | |||
514 | UUID recipientID = new UUID(im.toAgentID); | ||
482 | 515 | ||
483 | if (im.dialog == (byte)InstantMessageDialog.InventoryOffered) | 516 | // First byte is the asset type |
484 | { | 517 | AssetType assetType = (AssetType)im.binaryBucket[0]; |
485 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
486 | UUID inventoryID = new UUID(im.binaryBucket, 1); | ||
487 | 518 | ||
488 | IInventoryService invService = scene.InventoryService; | 519 | if (AssetType.Folder == assetType) |
489 | InventoryNodeBase node = null; | 520 | { |
490 | if (AssetType.Folder == assetType) | 521 | UUID folderID = new UUID(im.binaryBucket, 1); |
522 | |||
523 | InventoryFolderBase given = | ||
524 | new InventoryFolderBase(folderID, recipientID); | ||
525 | InventoryFolderBase folder = | ||
526 | scene.InventoryService.GetFolder(given); | ||
527 | |||
528 | if (folder != null) | ||
529 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
530 | } | ||
531 | else | ||
532 | { | ||
533 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
534 | |||
535 | InventoryItemBase given = | ||
536 | new InventoryItemBase(itemID, recipientID); | ||
537 | InventoryItemBase item = | ||
538 | scene.InventoryService.GetItem(given); | ||
539 | |||
540 | if (item != null) | ||
491 | { | 541 | { |
492 | InventoryFolderBase folder = new InventoryFolderBase(inventoryID, new UUID(im.toAgentID)); | 542 | user.ControllingClient.SendBulkUpdateInventory(item); |
493 | node = invService.GetFolder(folder); | ||
494 | } | 543 | } |
495 | else | 544 | } |
545 | user.ControllingClient.SendInstantMessage(im); | ||
546 | } | ||
547 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered) | ||
548 | { | ||
549 | if (im.binaryBucket.Length < 1) // Invalid | ||
550 | return; | ||
551 | |||
552 | UUID recipientID = new UUID(im.toAgentID); | ||
553 | |||
554 | // Bucket is the asset type | ||
555 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
556 | |||
557 | if (AssetType.Folder == assetType) | ||
558 | { | ||
559 | UUID folderID = new UUID(im.imSessionID); | ||
560 | |||
561 | InventoryFolderBase given = | ||
562 | new InventoryFolderBase(folderID, recipientID); | ||
563 | InventoryFolderBase folder = | ||
564 | scene.InventoryService.GetFolder(given); | ||
565 | |||
566 | if (folder != null) | ||
567 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
568 | } | ||
569 | else | ||
570 | { | ||
571 | UUID itemID = new UUID(im.imSessionID); | ||
572 | |||
573 | InventoryItemBase given = | ||
574 | new InventoryItemBase(itemID, recipientID); | ||
575 | InventoryItemBase item = | ||
576 | scene.InventoryService.GetItem(given); | ||
577 | |||
578 | if (item != null) | ||
496 | { | 579 | { |
497 | InventoryItemBase item = new InventoryItemBase(inventoryID, new UUID(im.toAgentID)); | 580 | user.ControllingClient.SendBulkUpdateInventory(item); |
498 | node = invService.GetItem(item); | ||
499 | } | 581 | } |
500 | |||
501 | if (node != null) | ||
502 | user.ControllingClient.SendBulkUpdateInventory(node); | ||
503 | } | 582 | } |
583 | |||
584 | // Fix up binary bucket since this may be 17 chars long here | ||
585 | Byte[] bucket = new Byte[1]; | ||
586 | bucket[0] = im.binaryBucket[0]; | ||
587 | im.binaryBucket = bucket; | ||
588 | |||
589 | user.ControllingClient.SendInstantMessage(im); | ||
590 | } | ||
591 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
592 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined || | ||
593 | im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined || | ||
594 | im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | ||
595 | { | ||
596 | user.ControllingClient.SendInstantMessage(im); | ||
504 | } | 597 | } |
505 | } | 598 | } |
506 | } | 599 | } |