aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/InventoryServer/GridInventoryService.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-03 18:57:02 +0000
committerJustin Clarke Casey2008-05-03 18:57:02 +0000
commit10875427058e68784ca6f5538a00a0cafd46a72b (patch)
tree51d7be53b9bc64eb86bf1720513661933ea0a5ba /OpenSim/Grid/InventoryServer/GridInventoryService.cs
parent* Refactor: remove redundant userId parameter from UpdateItem() and DeleteItem() (diff)
downloadopensim-SC_OLD-10875427058e68784ca6f5538a00a0cafd46a72b.zip
opensim-SC_OLD-10875427058e68784ca6f5538a00a0cafd46a72b.tar.gz
opensim-SC_OLD-10875427058e68784ca6f5538a00a0cafd46a72b.tar.bz2
opensim-SC_OLD-10875427058e68784ca6f5538a00a0cafd46a72b.tar.xz
* Refactor: Move bulk of CreateFolder from UserProfileCacheService into CachedUserInfo
* Remove unused/superseded methods from GridInventoryService
Diffstat (limited to 'OpenSim/Grid/InventoryServer/GridInventoryService.cs')
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs66
1 files changed, 8 insertions, 58 deletions
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index d9510e9..f0eef31 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -28,8 +28,11 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading;
32
31using libsecondlife; 33using libsecondlife;
32using log4net; 34using log4net;
35
33using OpenSim.Framework; 36using OpenSim.Framework;
34using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
35 38
@@ -48,71 +51,18 @@ namespace OpenSim.Grid.InventoryServer
48 } 51 }
49 52
50 /// <summary> 53 /// <summary>
51 /// Get a user's inventory.
52 /// </summary>
53 /// <param name="userID"></param>
54 /// <param name="folderList"></param>
55 /// <param name="itemsList"></param>
56 /// <returns>true if the inventory was retrieved, false otherwise</returns>
57 private bool GetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList,
58 out List<InventoryItemBase> itemsList)
59 {
60 List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID);
61 List<InventoryItemBase> allItems = new List<InventoryItemBase>();
62
63 foreach (InventoryFolderBase folder in allFolders)
64 {
65 List<InventoryItemBase> items = RequestFolderItems(folder.ID);
66 if (items != null)
67 {
68 allItems.InsertRange(0, items);
69 }
70 }
71
72 folderList = allFolders;
73 itemsList = allItems;
74 if (folderList != null)
75 {
76 return true;
77 }
78 else
79 {
80 return false;
81 }
82 }
83
84 private List<InventoryFolderBase> GetAllFolders(LLUUID folder)
85 {
86 List<InventoryFolderBase> allFolders = new List<InventoryFolderBase>();
87 List<InventoryFolderBase> folders = RequestSubFolders(folder);
88 if (folders != null)
89 {
90 allFolders.InsertRange(0, folders);
91 foreach (InventoryFolderBase subfolder in folders)
92 {
93 List<InventoryFolderBase> subFolders = GetAllFolders(subfolder.ID);
94 if (subFolders != null)
95 {
96 allFolders.InsertRange(0, subFolders);
97 }
98 }
99 }
100 return allFolders;
101 }
102
103 /// <summary>
104 /// Return a user's entire inventory 54 /// Return a user's entire inventory
105 /// </summary> 55 /// </summary>
106 /// <param name="rawUserID"></param> 56 /// <param name="rawUserID"></param>
107 /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> 57 /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns>
108 public InventoryCollection GetUserInventory(Guid rawUserID) 58 public InventoryCollection GetUserInventory(Guid rawUserID)
109 { 59 {
110 // uncomment me to simulate an overloaded inventory server
111 //Thread.Sleep(20000);
112
113 LLUUID userID = new LLUUID(rawUserID); 60 LLUUID userID = new LLUUID(rawUserID);
114 61
115 m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); 62 m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID);
63
64 // uncomment me to simulate an overloaded inventory server
65 //Thread.Sleep(20000);
116 66
117 InventoryCollection invCollection = new InventoryCollection(); 67 InventoryCollection invCollection = new InventoryCollection();
118 68