aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs68
1 files changed, 5 insertions, 63 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 575079f..59170df 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -330,7 +330,7 @@ namespace OpenSim.Region.Framework.Scenes
330 } 330 }
331 } 331 }
332 } 332 }
333 } 333 }
334 334
335 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 335 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
336 { 336 {
@@ -487,6 +487,7 @@ namespace OpenSim.Region.Framework.Scenes
487 // can be handled transparently). 487 // can be handled transparently).
488 InventoryFolderImpl fold = null; 488 InventoryFolderImpl fold = null;
489 if (LibraryService != null && LibraryService.LibraryRootFolder != null) 489 if (LibraryService != null && LibraryService.LibraryRootFolder != null)
490 {
490 if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null) 491 if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
491 { 492 {
492 remoteClient.SendInventoryFolderDetails( 493 remoteClient.SendInventoryFolderDetails(
@@ -494,6 +495,7 @@ namespace OpenSim.Region.Framework.Scenes
494 fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems); 495 fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems);
495 return; 496 return;
496 } 497 }
498 }
497 499
498 // We're going to send the reply async, because there may be 500 // We're going to send the reply async, because there may be
499 // an enormous quantity of packets -- basically the entire inventory! 501 // an enormous quantity of packets -- basically the entire inventory!
@@ -514,64 +516,6 @@ namespace OpenSim.Region.Framework.Scenes
514 SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState; 516 SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState;
515 d.EndInvoke(iar); 517 d.EndInvoke(iar);
516 } 518 }
517
518 /// <summary>
519 /// Handle the caps inventory descendents fetch.
520 ///
521 /// Since the folder structure is sent to the client on login, I believe we only need to handle items.
522 /// Diva comment 8/13/2009: what if someone gave us a folder in the meantime??
523 /// </summary>
524 /// <param name="agentID"></param>
525 /// <param name="folderID"></param>
526 /// <param name="ownerID"></param>
527 /// <param name="fetchFolders"></param>
528 /// <param name="fetchItems"></param>
529 /// <param name="sortOrder"></param>
530 /// <returns>null if the inventory look up failed</returns>
531 public InventoryCollection HandleFetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID,
532 bool fetchFolders, bool fetchItems, int sortOrder, out int version)
533 {
534 m_log.DebugFormat(
535 "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
536 fetchFolders, fetchItems, folderID, agentID);
537
538 // FIXME MAYBE: We're not handling sortOrder!
539
540 // TODO: This code for looking in the folder for the library should be folded back into the
541 // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
542 // can be handled transparently).
543 InventoryFolderImpl fold;
544 if (LibraryService != null && LibraryService.LibraryRootFolder != null)
545 if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
546 {
547 version = 0;
548 InventoryCollection ret = new InventoryCollection();
549 ret.Folders = new List<InventoryFolderBase>();
550 ret.Items = fold.RequestListOfItems();
551
552 return ret;
553 }
554
555 InventoryCollection contents = new InventoryCollection();
556
557 if (folderID != UUID.Zero)
558 {
559 contents = InventoryService.GetFolderContent(agentID, folderID);
560 InventoryFolderBase containingFolder = new InventoryFolderBase();
561 containingFolder.ID = folderID;
562 containingFolder.Owner = agentID;
563 containingFolder = InventoryService.GetFolder(containingFolder);
564 version = containingFolder.Version;
565 }
566 else
567 {
568 // Lost itemsm don't really need a version
569 version = 1;
570 }
571
572 return contents;
573
574 }
575 519
576 /// <summary> 520 /// <summary>
577 /// Handle an inventory folder creation request from the client. 521 /// Handle an inventory folder creation request from the client.
@@ -646,14 +590,13 @@ namespace OpenSim.Region.Framework.Scenes
646 } 590 }
647 } 591 }
648 592
593 delegate void PurgeFolderDelegate(UUID userID, UUID folder);
594
649 /// <summary> 595 /// <summary>
650 /// This should delete all the items and folders in the given directory. 596 /// This should delete all the items and folders in the given directory.
651 /// </summary> 597 /// </summary>
652 /// <param name="remoteClient"></param> 598 /// <param name="remoteClient"></param>
653 /// <param name="folderID"></param> 599 /// <param name="folderID"></param>
654
655 delegate void PurgeFolderDelegate(UUID userID, UUID folder);
656
657 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) 600 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
658 { 601 {
659 PurgeFolderDelegate d = PurgeFolderAsync; 602 PurgeFolderDelegate d = PurgeFolderAsync;
@@ -667,7 +610,6 @@ namespace OpenSim.Region.Framework.Scenes
667 } 610 }
668 } 611 }
669 612
670
671 private void PurgeFolderAsync(UUID userID, UUID folderID) 613 private void PurgeFolderAsync(UUID userID, UUID folderID)
672 { 614 {
673 InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); 615 InventoryFolderBase folder = new InventoryFolderBase(folderID, userID);