aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache
diff options
context:
space:
mode:
authorJeff Ames2008-05-16 01:22:11 +0000
committerJeff Ames2008-05-16 01:22:11 +0000
commit65c5efe43b68700bad94076d4cd421160203c5de (patch)
tree589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Framework/Communications/Cache
parentThank you very much, mjm for : (diff)
downloadopensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.zip
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs22
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServerBase.cs8
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs220
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs8
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs46
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs72
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs78
7 files changed, 227 insertions, 227 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 1414260..0669ce9 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -40,12 +40,12 @@ namespace OpenSim.Framework.Communications.Cache
40 40
41 /// <summary> 41 /// <summary>
42 /// Manages local cache of assets and their sending to viewers. 42 /// Manages local cache of assets and their sending to viewers.
43 /// 43 ///
44 /// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either 44 /// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either
45 /// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and 45 /// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and
46 /// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and 46 /// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and
47 /// AssetNotFound(), which means they do share the same asset and texture caches. 47 /// AssetNotFound(), which means they do share the same asset and texture caches.
48 /// 48 ///
49 /// TODO Assets in this cache are effectively immortal (they are never disposed off through old age). 49 /// TODO Assets in this cache are effectively immortal (they are never disposed off through old age).
50 /// This is not a huge problem at the moment since other memory use usually dwarfs that used by assets 50 /// This is not a huge problem at the moment since other memory use usually dwarfs that used by assets
51 /// but it's something to bear in mind. 51 /// but it's something to bear in mind.
@@ -281,8 +281,8 @@ namespace OpenSim.Framework.Communications.Cache
281 281
282 /// <summary> 282 /// <summary>
283 /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to 283 /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to
284 /// load it into the cache. 284 /// load it into the cache.
285 /// 285 ///
286 /// XXX We'll keep polling the cache until we get the asset or we exceed 286 /// XXX We'll keep polling the cache until we get the asset or we exceed
287 /// the allowed number of polls. This isn't a very good way of doing things since a single thread 287 /// the allowed number of polls. This isn't a very good way of doing things since a single thread
288 /// is processing inbound packets, so if the asset server is slow, we could block this for up to 288 /// is processing inbound packets, so if the asset server is slow, we could block this for up to
@@ -431,11 +431,11 @@ namespace OpenSim.Framework.Communications.Cache
431 //making a copy of the list is not ideal 431 //making a copy of the list is not ideal
432 //but the old method of locking around this whole block of code was causing a multi-thread lock 432 //but the old method of locking around this whole block of code was causing a multi-thread lock
433 //between this and the TextureDownloadModule 433 //between this and the TextureDownloadModule
434 //while the localAsset thread running this and trying to send a texture to the callback in the 434 //while the localAsset thread running this and trying to send a texture to the callback in the
435 //texturedownloadmodule , and hitting a lock in there. While the texturedownload thread (which was holding 435 //texturedownloadmodule , and hitting a lock in there. While the texturedownload thread (which was holding
436 // the lock in the texturedownload module) was trying to 436 // the lock in the texturedownload module) was trying to
437 //request a new asset and hitting a lock in here on the RequestLists. 437 //request a new asset and hitting a lock in here on the RequestLists.
438 438
439 List<NewAssetRequest> theseRequests = new List<NewAssetRequest>(reqList.Requests); 439 List<NewAssetRequest> theseRequests = new List<NewAssetRequest>(reqList.Requests);
440 reqList.Requests.Clear(); 440 reqList.Requests.Clear();
441 441
@@ -460,7 +460,7 @@ namespace OpenSim.Framework.Communications.Cache
460 { 460 {
461 // m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); 461 // m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
462 462
463 // Notify requesters for this asset 463 // Notify requesters for this asset
464 AssetRequestsList reqList = null; 464 AssetRequestsList reqList = null;
465 lock (RequestLists) 465 lock (RequestLists)
466 { 466 {
@@ -552,7 +552,7 @@ namespace OpenSim.Framework.Communications.Cache
552 } 552 }
553 return; 553 return;
554 } 554 }
555 //it is in our cache 555 //it is in our cache
556 AssetInfo asset = Assets[requestID]; 556 AssetInfo asset = Assets[requestID];
557 557
558 // add to the AssetRequests list 558 // add to the AssetRequests list
@@ -679,14 +679,14 @@ namespace OpenSim.Framework.Communications.Cache
679 public byte AssetRequestSource = 2; 679 public byte AssetRequestSource = 2;
680 public byte[] Params = null; 680 public byte[] Params = null;
681 //public bool AssetInCache; 681 //public bool AssetInCache;
682 //public int TimeRequested; 682 //public int TimeRequested;
683 public int DiscardLevel = -1; 683 public int DiscardLevel = -1;
684 684
685 public AssetRequest() 685 public AssetRequest()
686 { 686 {
687 } 687 }
688 } 688 }
689 689
690 public class AssetInfo : AssetBase 690 public class AssetInfo : AssetBase
691 { 691 {
692 public AssetInfo() 692 public AssetInfo()
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index 1a7f872..b16512c 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache
36{ 36{
37 public abstract class AssetServerBase : IAssetServer 37 public abstract class AssetServerBase : IAssetServer
38 { 38 {
39 private static readonly ILog m_log 39 private static readonly ILog m_log
40 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 41
42 protected IAssetReceiver m_receiver; 42 protected IAssetReceiver m_receiver;
@@ -47,12 +47,12 @@ namespace OpenSim.Framework.Communications.Cache
47 47
48 // Temporarily hardcoded - should be a plugin 48 // Temporarily hardcoded - should be a plugin
49 protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); 49 protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
50 50
51 protected abstract void StoreAsset(AssetBase asset); 51 protected abstract void StoreAsset(AssetBase asset);
52 protected abstract void CommitAssets(); 52 protected abstract void CommitAssets();
53 53
54 /// <summary> 54 /// <summary>
55 /// This method must be implemented by a subclass to retrieve the asset named in the 55 /// This method must be implemented by a subclass to retrieve the asset named in the
56 /// AssetRequest. If the asset is not found, null should be returned. 56 /// AssetRequest. If the asset is not found, null should be returned.
57 /// </summary> 57 /// </summary>
58 /// <param name="req"></param> 58 /// <param name="req"></param>
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
60 protected abstract AssetBase GetAsset(AssetRequest req); 60 protected abstract AssetBase GetAsset(AssetRequest req);
61 61
62 /// <summary> 62 /// <summary>
63 /// Process an asset request. This method will call GetAsset(AssetRequest req) 63 /// Process an asset request. This method will call GetAsset(AssetRequest req)
64 /// on the subclass. 64 /// on the subclass.
65 /// </summary> 65 /// </summary>
66 /// <param name="req"></param> 66 /// <param name="req"></param>
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 218fd5a..f40f078 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -36,55 +36,55 @@ using log4net;
36namespace OpenSim.Framework.Communications.Cache 36namespace OpenSim.Framework.Communications.Cache
37{ 37{
38 internal delegate void AddItemDelegate(InventoryItemBase itemInfo); 38 internal delegate void AddItemDelegate(InventoryItemBase itemInfo);
39 internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); 39 internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
40 internal delegate void DeleteItemDelegate(LLUUID itemID); 40 internal delegate void DeleteItemDelegate(LLUUID itemID);
41 41
42 internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID); 42 internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID);
43 internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID); 43 internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID);
44 internal delegate void PurgeFolderDelegate(LLUUID folderID); 44 internal delegate void PurgeFolderDelegate(LLUUID folderID);
45 internal delegate void UpdateFolderDelegate(string name, LLUUID folderID, ushort type, LLUUID parentID); 45 internal delegate void UpdateFolderDelegate(string name, LLUUID folderID, ushort type, LLUUID parentID);
46 46
47 internal delegate void SendInventoryDescendentsDelegate( 47 internal delegate void SendInventoryDescendentsDelegate(
48 IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems); 48 IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems);
49 49
50 /// <summary> 50 /// <summary>
51 /// Stores user profile and inventory data received from backend services for a particular user. 51 /// Stores user profile and inventory data received from backend services for a particular user.
52 /// </summary> 52 /// </summary>
53 public class CachedUserInfo 53 public class CachedUserInfo
54 { 54 {
55 private static readonly ILog m_log 55 private static readonly ILog m_log
56 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 56 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
57 57
58 /// <summary> 58 /// <summary>
59 /// The comms manager holds references to services (user, grid, inventory, etc.) 59 /// The comms manager holds references to services (user, grid, inventory, etc.)
60 /// </summary> 60 /// </summary>
61 private readonly CommunicationsManager m_commsManager; 61 private readonly CommunicationsManager m_commsManager;
62 62
63 public UserProfileData UserProfile { get { return m_userProfile; } } 63 public UserProfileData UserProfile { get { return m_userProfile; } }
64 private readonly UserProfileData m_userProfile; 64 private readonly UserProfileData m_userProfile;
65 65
66 /// <summary> 66 /// <summary>
67 /// Has we received the user's inventory from the inventory service? 67 /// Has we received the user's inventory from the inventory service?
68 /// </summary> 68 /// </summary>
69 private bool m_hasInventory; 69 private bool m_hasInventory;
70 70
71 /// <summary> 71 /// <summary>
72 /// Inventory requests waiting for receipt of this user's inventory from the inventory service. 72 /// Inventory requests waiting for receipt of this user's inventory from the inventory service.
73 /// </summary> 73 /// </summary>
74 private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>(); 74 private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>();
75 75
76 /// <summary> 76 /// <summary>
77 /// Has this user info object yet received its inventory information from the invetnroy service? 77 /// Has this user info object yet received its inventory information from the invetnroy service?
78 /// </summary> 78 /// </summary>
79 public bool HasInventory { get { return m_hasInventory; } } 79 public bool HasInventory { get { return m_hasInventory; } }
80 80
81 private InventoryFolderImpl m_rootFolder; 81 private InventoryFolderImpl m_rootFolder;
82 public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } 82 public InventoryFolderImpl RootFolder { get { return m_rootFolder; } }
83 83
84 /// <summary> 84 /// <summary>
85 /// FIXME: This could be contained within a local variable - it doesn't need to be a field 85 /// FIXME: This could be contained within a local variable - it doesn't need to be a field
86 /// </summary> 86 /// </summary>
87 private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders 87 private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders
88 = new Dictionary<LLUUID, IList<InventoryFolderImpl>>(); 88 = new Dictionary<LLUUID, IList<InventoryFolderImpl>>();
89 89
90 /// <summary> 90 /// <summary>
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Cache
97 m_commsManager = commsManager; 97 m_commsManager = commsManager;
98 m_userProfile = userProfile; 98 m_userProfile = userProfile;
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// This allows a request to be added to be processed once we receive a user's inventory 102 /// This allows a request to be added to be processed once we receive a user's inventory
103 /// from the inventory service. If we already have the inventory, the request 103 /// from the inventory service. If we already have the inventory, the request
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Communications.Cache
118 } 118 }
119 } 119 }
120 } 120 }
121 121
122 /// <summary> 122 /// <summary>
123 /// Store a folder pending arrival of its parent 123 /// Store a folder pending arrival of its parent
124 /// </summary> 124 /// </summary>
@@ -126,7 +126,7 @@ namespace OpenSim.Framework.Communications.Cache
126 private void AddPendingFolder(InventoryFolderImpl folder) 126 private void AddPendingFolder(InventoryFolderImpl folder)
127 { 127 {
128 LLUUID parentFolderId = folder.ParentID; 128 LLUUID parentFolderId = folder.ParentID;
129 129
130 if (pendingCategorizationFolders.ContainsKey(parentFolderId)) 130 if (pendingCategorizationFolders.ContainsKey(parentFolderId))
131 { 131 {
132 pendingCategorizationFolders[parentFolderId].Add(folder); 132 pendingCategorizationFolders[parentFolderId].Add(folder);
@@ -135,11 +135,11 @@ namespace OpenSim.Framework.Communications.Cache
135 { 135 {
136 IList<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); 136 IList<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
137 folders.Add(folder); 137 folders.Add(folder);
138 138
139 pendingCategorizationFolders[parentFolderId] = folders; 139 pendingCategorizationFolders[parentFolderId] = folders;
140 } 140 }
141 } 141 }
142 142
143 /// <summary> 143 /// <summary>
144 /// Add any pending folders which were received before the given folder 144 /// Add any pending folders which were received before the given folder
145 /// </summary> 145 /// </summary>
@@ -155,18 +155,18 @@ namespace OpenSim.Framework.Communications.Cache
155// m_log.DebugFormat( 155// m_log.DebugFormat(
156// "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}", 156// "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}",
157// folder.name, folder.folderID, parent.name, parent.folderID); 157// folder.name, folder.folderID, parent.name, parent.folderID);
158 158
159 lock (newFolder.SubFolders) 159 lock (newFolder.SubFolders)
160 { 160 {
161 if (!newFolder.SubFolders.ContainsKey(folder.ID)) 161 if (!newFolder.SubFolders.ContainsKey(folder.ID))
162 { 162 {
163 newFolder.SubFolders.Add(folder.ID, folder); 163 newFolder.SubFolders.Add(folder.ID, folder);
164 } 164 }
165 } 165 }
166 } 166 }
167 } 167 }
168 } 168 }
169 169
170 /// <summary> 170 /// <summary>
171 /// Callback invoked when the inventory is received from an async request to the inventory service 171 /// Callback invoked when the inventory is received from an async request to the inventory service
172 /// </summary> 172 /// </summary>
@@ -177,12 +177,12 @@ namespace OpenSim.Framework.Communications.Cache
177 // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these 177 // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these
178 // are simply being swallowed 178 // are simply being swallowed
179 try 179 try
180 { 180 {
181 foreach (InventoryFolderImpl folder in folders) 181 foreach (InventoryFolderImpl folder in folders)
182 { 182 {
183 FolderReceive(folder); 183 FolderReceive(folder);
184 } 184 }
185 185
186 foreach (InventoryItemBase item in items) 186 foreach (InventoryItemBase item in items)
187 { 187 {
188 ItemReceive(item); 188 ItemReceive(item);
@@ -191,15 +191,15 @@ namespace OpenSim.Framework.Communications.Cache
191 catch (Exception e) 191 catch (Exception e)
192 { 192 {
193 m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e); 193 m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e);
194 } 194 }
195 195
196 // Deal with pending requests 196 // Deal with pending requests
197 lock (m_pendingRequests) 197 lock (m_pendingRequests)
198 { 198 {
199 // We're going to change inventory status within the lock to avoid a race condition 199 // We're going to change inventory status within the lock to avoid a race condition
200 // where requests are processed after the AddRequest() method has been called. 200 // where requests are processed after the AddRequest() method has been called.
201 m_hasInventory = true; 201 m_hasInventory = true;
202 202
203 foreach (IInventoryRequest request in m_pendingRequests) 203 foreach (IInventoryRequest request in m_pendingRequests)
204 { 204 {
205 request.Execute(); 205 request.Execute();
@@ -215,7 +215,7 @@ namespace OpenSim.Framework.Communications.Cache
215 private void FolderReceive(InventoryFolderImpl newFolder) 215 private void FolderReceive(InventoryFolderImpl newFolder)
216 { 216 {
217// m_log.DebugFormat( 217// m_log.DebugFormat(
218// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", 218// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}",
219// folderInfo.Name, folderInfo.ID, userID); 219// folderInfo.Name, folderInfo.ID, userID);
220 220
221 if (RootFolder == null) 221 if (RootFolder == null)
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications.Cache
232 else 232 else
233 { 233 {
234 InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID); 234 InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID);
235 235
236 if (parentFolder != null) 236 if (parentFolder != null)
237 { 237 {
238 lock (parentFolder.SubFolders) 238 lock (parentFolder.SubFolders)
@@ -252,44 +252,44 @@ namespace OpenSim.Framework.Communications.Cache
252 else 252 else
253 { 253 {
254 AddPendingFolder(newFolder); 254 AddPendingFolder(newFolder);
255 } 255 }
256 } 256 }
257 257
258 ResolvePendingFolders(newFolder); 258 ResolvePendingFolders(newFolder);
259 } 259 }
260 260
261 /// <summary> 261 /// <summary>
262 /// Callback invoked when an item is received from an async request to the inventory service. 262 /// Callback invoked when an item is received from an async request to the inventory service.
263 /// 263 ///
264 /// We're assuming here that items are always received after all the folders 264 /// We're assuming here that items are always received after all the folders
265 /// received. 265 /// received.
266 /// </summary> 266 /// </summary>
267 /// <param name="folderInfo"></param> 267 /// <param name="folderInfo"></param>
268 private void ItemReceive(InventoryItemBase itemInfo) 268 private void ItemReceive(InventoryItemBase itemInfo)
269 { 269 {
270// m_log.DebugFormat( 270// m_log.DebugFormat(
271// "[INVENTORY CACHE]: Received item {0} {1} for user {2}", 271// "[INVENTORY CACHE]: Received item {0} {1} for user {2}",
272// itemInfo.Name, itemInfo.ID, userID); 272// itemInfo.Name, itemInfo.ID, userID);
273 InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder); 273 InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
274 274
275 if (null == folder) 275 if (null == folder)
276 { 276 {
277 m_log.WarnFormat( 277 m_log.WarnFormat(
278 "Received item {0} {1} but its folder {2} does not exist", 278 "Received item {0} {1} but its folder {2} does not exist",
279 itemInfo.Name, itemInfo.ID, itemInfo.Folder); 279 itemInfo.Name, itemInfo.ID, itemInfo.Folder);
280 280
281 return; 281 return;
282 } 282 }
283 283
284 lock (folder.Items) 284 lock (folder.Items)
285 { 285 {
286 folder.Items[itemInfo.ID] = itemInfo; 286 folder.Items[itemInfo.ID] = itemInfo;
287 } 287 }
288 } 288 }
289 289
290 /// <summary> 290 /// <summary>
291 /// Create a folder in this agent's inventory. 291 /// Create a folder in this agent's inventory.
292 /// 292 ///
293 /// If the inventory service has not yet delievered the inventory 293 /// If the inventory service has not yet delievered the inventory
294 /// for this user then the request will be queued. 294 /// for this user then the request will be queued.
295 /// </summary> 295 /// </summary>
@@ -299,20 +299,20 @@ namespace OpenSim.Framework.Communications.Cache
299 { 299 {
300// m_log.DebugFormat( 300// m_log.DebugFormat(
301// "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId); 301// "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId);
302 302
303 if (HasInventory) 303 if (HasInventory)
304 { 304 {
305 InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID); 305 InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID);
306 306
307 if (null == parentFolder) 307 if (null == parentFolder)
308 { 308 {
309 m_log.WarnFormat( 309 m_log.WarnFormat(
310 "[AGENT INVENTORY]: Tried to create folder {0} {1} but the parent {2} does not exist", 310 "[AGENT INVENTORY]: Tried to create folder {0} {1} but the parent {2} does not exist",
311 folderName, folderID, parentID); 311 folderName, folderID, parentID);
312 312
313 return false; 313 return false;
314 } 314 }
315 315
316 InventoryFolderImpl createdFolder = parentFolder.CreateChildFolder(folderID, folderName, folderType); 316 InventoryFolderImpl createdFolder = parentFolder.CreateChildFolder(folderID, folderName, folderType);
317 317
318 if (createdFolder != null) 318 if (createdFolder != null)
@@ -324,17 +324,17 @@ namespace OpenSim.Framework.Communications.Cache
324 createdBaseFolder.ParentID = createdFolder.ParentID; 324 createdBaseFolder.ParentID = createdFolder.ParentID;
325 createdBaseFolder.Type = createdFolder.Type; 325 createdBaseFolder.Type = createdFolder.Type;
326 createdBaseFolder.Version = createdFolder.Version; 326 createdBaseFolder.Version = createdFolder.Version;
327 327
328 m_commsManager.InventoryService.AddFolder(createdBaseFolder); 328 m_commsManager.InventoryService.AddFolder(createdBaseFolder);
329 329
330 return true; 330 return true;
331 } 331 }
332 else 332 else
333 { 333 {
334 m_log.WarnFormat( 334 m_log.WarnFormat(
335 "[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists", 335 "[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists",
336 folderName, folderID); 336 folderName, folderID);
337 337
338 return false; 338 return false;
339 } 339 }
340 } 340 }
@@ -344,22 +344,22 @@ namespace OpenSim.Framework.Communications.Cache
344 new InventoryRequest( 344 new InventoryRequest(
345 Delegate.CreateDelegate(typeof(CreateFolderDelegate), this, "CreateFolder"), 345 Delegate.CreateDelegate(typeof(CreateFolderDelegate), this, "CreateFolder"),
346 new object[] { folderName, folderID, folderType, parentID })); 346 new object[] { folderName, folderID, folderType, parentID }));
347 347
348 return true; 348 return true;
349 } 349 }
350 } 350 }
351 351
352 /// <summary> 352 /// <summary>
353 /// Handle a client request to update the inventory folder 353 /// Handle a client request to update the inventory folder
354 /// 354 ///
355 /// If the inventory service has not yet delievered the inventory 355 /// If the inventory service has not yet delievered the inventory
356 /// for this user then the request will be queued. 356 /// for this user then the request will be queued.
357 /// 357 ///
358 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE 358 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
359 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, 359 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
360 /// and needs to be changed. 360 /// and needs to be changed.
361 /// </summary> 361 /// </summary>
362 /// 362 ///
363 /// <param name="folderID"></param> 363 /// <param name="folderID"></param>
364 /// <param name="type"></param> 364 /// <param name="type"></param>
365 /// <param name="name"></param> 365 /// <param name="name"></param>
@@ -367,7 +367,7 @@ namespace OpenSim.Framework.Communications.Cache
367 public bool UpdateFolder(string name, LLUUID folderID, ushort type, LLUUID parentID) 367 public bool UpdateFolder(string name, LLUUID folderID, ushort type, LLUUID parentID)
368 { 368 {
369// m_log.DebugFormat( 369// m_log.DebugFormat(
370// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); 370// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
371 371
372 if (HasInventory) 372 if (HasInventory)
373 { 373 {
@@ -378,7 +378,7 @@ namespace OpenSim.Framework.Communications.Cache
378 baseFolder.ParentID = parentID; 378 baseFolder.ParentID = parentID;
379 baseFolder.Type = (short) type; 379 baseFolder.Type = (short) type;
380 baseFolder.Version = RootFolder.Version; 380 baseFolder.Version = RootFolder.Version;
381 381
382 m_commsManager.InventoryService.AddFolder(baseFolder); 382 m_commsManager.InventoryService.AddFolder(baseFolder);
383 } 383 }
384 else 384 else
@@ -387,18 +387,18 @@ namespace OpenSim.Framework.Communications.Cache
387 new InventoryRequest( 387 new InventoryRequest(
388 Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"), 388 Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"),
389 new object[] { name, folderID, type, parentID })); 389 new object[] { name, folderID, type, parentID }));
390 } 390 }
391 391
392 return true; 392 return true;
393 } 393 }
394 394
395 /// <summary> 395 /// <summary>
396 /// Handle an inventory folder move request from the client. 396 /// Handle an inventory folder move request from the client.
397 /// 397 ///
398 /// If the inventory service has not yet delievered the inventory 398 /// If the inventory service has not yet delievered the inventory
399 /// for this user then the request will be queued. 399 /// for this user then the request will be queued.
400 /// </summary> 400 /// </summary>
401 /// 401 ///
402 /// <param name="folderID"></param> 402 /// <param name="folderID"></param>
403 /// <param name="parentID"></param> 403 /// <param name="parentID"></param>
404 public bool MoveFolder(LLUUID folderID, LLUUID parentID) 404 public bool MoveFolder(LLUUID folderID, LLUUID parentID)
@@ -413,9 +413,9 @@ namespace OpenSim.Framework.Communications.Cache
413 baseFolder.Owner = m_userProfile.ID; 413 baseFolder.Owner = m_userProfile.ID;
414 baseFolder.ID = folderID; 414 baseFolder.ID = folderID;
415 baseFolder.ParentID = parentID; 415 baseFolder.ParentID = parentID;
416 416
417 m_commsManager.InventoryService.MoveFolder(baseFolder); 417 m_commsManager.InventoryService.MoveFolder(baseFolder);
418 418
419 return true; 419 return true;
420 } 420 }
421 else 421 else
@@ -424,30 +424,30 @@ namespace OpenSim.Framework.Communications.Cache
424 new InventoryRequest( 424 new InventoryRequest(
425 Delegate.CreateDelegate(typeof(MoveFolderDelegate), this, "MoveFolder"), 425 Delegate.CreateDelegate(typeof(MoveFolderDelegate), this, "MoveFolder"),
426 new object[] { folderID, parentID })); 426 new object[] { folderID, parentID }));
427 427
428 return true; 428 return true;
429 } 429 }
430 } 430 }
431 431
432 /// <summary> 432 /// <summary>
433 /// This method will delete all the items and folders in the given folder. 433 /// This method will delete all the items and folders in the given folder.
434 /// 434 ///
435 /// If the inventory service has not yet delievered the inventory 435 /// If the inventory service has not yet delievered the inventory
436 /// for this user then the request will be queued. 436 /// for this user then the request will be queued.
437 /// </summary> 437 /// </summary>
438 /// 438 ///
439 /// <param name="folderID"></param> 439 /// <param name="folderID"></param>
440 public bool PurgeFolder(LLUUID folderID) 440 public bool PurgeFolder(LLUUID folderID)
441 { 441 {
442// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", 442// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
443// folderID, remoteClient.Name, remoteClient.AgentId); 443// folderID, remoteClient.Name, remoteClient.AgentId);
444 444
445 if (HasInventory) 445 if (HasInventory)
446 { 446 {
447 InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID); 447 InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID);
448 448
449 if (purgedFolder != null) 449 if (purgedFolder != null)
450 { 450 {
451 // XXX Nasty - have to create a new object to hold details we already have 451 // XXX Nasty - have to create a new object to hold details we already have
452 InventoryFolderBase purgedBaseFolder = new InventoryFolderBase(); 452 InventoryFolderBase purgedBaseFolder = new InventoryFolderBase();
453 purgedBaseFolder.Owner = purgedFolder.Owner; 453 purgedBaseFolder.Owner = purgedFolder.Owner;
@@ -455,12 +455,12 @@ namespace OpenSim.Framework.Communications.Cache
455 purgedBaseFolder.Name = purgedFolder.Name; 455 purgedBaseFolder.Name = purgedFolder.Name;
456 purgedBaseFolder.ParentID = purgedFolder.ParentID; 456 purgedBaseFolder.ParentID = purgedFolder.ParentID;
457 purgedBaseFolder.Type = purgedFolder.Type; 457 purgedBaseFolder.Type = purgedFolder.Type;
458 purgedBaseFolder.Version = purgedFolder.Version; 458 purgedBaseFolder.Version = purgedFolder.Version;
459 459
460 m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder); 460 m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
461 461
462 purgedFolder.Purge(); 462 purgedFolder.Purge();
463 463
464 return true; 464 return true;
465 } 465 }
466 } 466 }
@@ -470,12 +470,12 @@ namespace OpenSim.Framework.Communications.Cache
470 new InventoryRequest( 470 new InventoryRequest(
471 Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"), 471 Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"),
472 new object[] { folderID })); 472 new object[] { folderID }));
473 473
474 return true; 474 return true;
475 } 475 }
476 476
477 return false; 477 return false;
478 } 478 }
479 479
480 /// <summary> 480 /// <summary>
481 /// Add an item to the user's inventory 481 /// Add an item to the user's inventory
@@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications.Cache
494 new InventoryRequest( 494 new InventoryRequest(
495 Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"), 495 Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"),
496 new object[] { item })); 496 new object[] { item }));
497 } 497 }
498 } 498 }
499 499
500 /// <summary> 500 /// <summary>
@@ -514,18 +514,18 @@ namespace OpenSim.Framework.Communications.Cache
514 new InventoryRequest( 514 new InventoryRequest(
515 Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"), 515 Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"),
516 new object[] { item })); 516 new object[] { item }));
517 } 517 }
518 } 518 }
519 519
520 /// <summary> 520 /// <summary>
521 /// Delete an item from the user's inventory 521 /// Delete an item from the user's inventory
522 /// 522 ///
523 /// If the inventory service has not yet delievered the inventory 523 /// If the inventory service has not yet delievered the inventory
524 /// for this user then the request will be queued. 524 /// for this user then the request will be queued.
525 /// </summary> 525 /// </summary>
526 /// <param name="itemID"></param> 526 /// <param name="itemID"></param>
527 /// <returns> 527 /// <returns>
528 /// true on a successful delete or a if the request is queued. 528 /// true on a successful delete or a if the request is queued.
529 /// Returns false on an immediate failure 529 /// Returns false on an immediate failure
530 /// </returns> 530 /// </returns>
531 public bool DeleteItem(LLUUID itemID) 531 public bool DeleteItem(LLUUID itemID)
@@ -535,14 +535,14 @@ namespace OpenSim.Framework.Communications.Cache
535 // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though 535 // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though
536 // really only the item id is required. 536 // really only the item id is required.
537 InventoryItemBase item = RootFolder.FindItem(itemID); 537 InventoryItemBase item = RootFolder.FindItem(itemID);
538 538
539 if (null == item) 539 if (null == item)
540 { 540 {
541 m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID); 541 m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID);
542 542
543 return false; 543 return false;
544 } 544 }
545 545
546 if (RootFolder.DeleteItem(item.ID)) 546 if (RootFolder.DeleteItem(item.ID))
547 { 547 {
548 return m_commsManager.InventoryService.DeleteItem(item); 548 return m_commsManager.InventoryService.DeleteItem(item);
@@ -554,13 +554,13 @@ namespace OpenSim.Framework.Communications.Cache
554 new InventoryRequest( 554 new InventoryRequest(
555 Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"), 555 Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"),
556 new object[] { itemID })); 556 new object[] { itemID }));
557 557
558 return true; 558 return true;
559 } 559 }
560 560
561 return false; 561 return false;
562 } 562 }
563 563
564 /// <summary> 564 /// <summary>
565 /// Send details of the inventory items and/or folders in a given folder to the client. 565 /// Send details of the inventory items and/or folders in a given folder to the client.
566 /// </summary> 566 /// </summary>
@@ -574,13 +574,13 @@ namespace OpenSim.Framework.Communications.Cache
574 if (HasInventory) 574 if (HasInventory)
575 { 575 {
576 InventoryFolderImpl folder; 576 InventoryFolderImpl folder;
577 577
578 if ((folder = RootFolder.FindFolder(folderID)) != null) 578 if ((folder = RootFolder.FindFolder(folderID)) != null)
579 { 579 {
580// m_log.DebugFormat( 580// m_log.DebugFormat(
581// "[AGENT INVENTORY]: Found folder {0} for client {1}", 581// "[AGENT INVENTORY]: Found folder {0} for client {1}",
582// folderID, remoteClient.AgentId); 582// folderID, remoteClient.AgentId);
583 583
584 client.SendInventoryFolderDetails( 584 client.SendInventoryFolderDetails(
585 client.AgentId, folderID, folder.RequestListOfItems(), 585 client.AgentId, folderID, folder.RequestListOfItems(),
586 folder.RequestListOfFolders(), fetchFolders, fetchItems); 586 folder.RequestListOfFolders(), fetchFolders, fetchItems);
@@ -592,7 +592,7 @@ namespace OpenSim.Framework.Communications.Cache
592 m_log.WarnFormat( 592 m_log.WarnFormat(
593 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}", 593 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}",
594 folderID, client.Name, client.AgentId); 594 folderID, client.Name, client.AgentId);
595 595
596 return false; 596 return false;
597 } 597 }
598 } 598 }
@@ -604,13 +604,13 @@ namespace OpenSim.Framework.Communications.Cache
604 new object[] { client, folderID, fetchFolders, fetchItems })); 604 new object[] { client, folderID, fetchFolders, fetchItems }));
605 605
606 return true; 606 return true;
607 } 607 }
608 } 608 }
609 } 609 }
610 610
611 /// <summary> 611 /// <summary>
612 /// Should be implemented by callers which require a callback when the user's inventory is received 612 /// Should be implemented by callers which require a callback when the user's inventory is received
613 /// </summary> 613 /// </summary>
614 public interface IInventoryRequest 614 public interface IInventoryRequest
615 { 615 {
616 /// <summary> 616 /// <summary>
@@ -618,7 +618,7 @@ namespace OpenSim.Framework.Communications.Cache
618 /// </summary> 618 /// </summary>
619 void Execute(); 619 void Execute();
620 } 620 }
621 621
622 /// <summary> 622 /// <summary>
623 /// Generic inventory request 623 /// Generic inventory request
624 /// </summary> 624 /// </summary>
@@ -626,16 +626,16 @@ namespace OpenSim.Framework.Communications.Cache
626 { 626 {
627 private Delegate m_delegate; 627 private Delegate m_delegate;
628 private Object[] m_args; 628 private Object[] m_args;
629 629
630 internal InventoryRequest(Delegate delegat, Object[] args) 630 internal InventoryRequest(Delegate delegat, Object[] args)
631 { 631 {
632 m_delegate = delegat; 632 m_delegate = delegat;
633 m_args = args; 633 m_args = args;
634 } 634 }
635 635
636 public void Execute() 636 public void Execute()
637 { 637 {
638 m_delegate.DynamicInvoke(m_args); 638 m_delegate.DynamicInvoke(m_args);
639 } 639 }
640 } 640 }
641} 641}
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index d5b7fea..4b4ef17 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -95,9 +95,9 @@ namespace OpenSim.Framework.Communications.Cache
95 // XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); 95 // XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
96 // xs.Serialize(s, asset); 96 // xs.Serialize(s, asset);
97 // RestClient rc = new RestClient(_assetServerUrl); 97 // RestClient rc = new RestClient(_assetServerUrl);
98 98
99 string assetUrl = _assetServerUrl + "/assets/"; 99 string assetUrl = _assetServerUrl + "/assets/";
100 100
101 //rc.AddResourcePath("assets"); 101 //rc.AddResourcePath("assets");
102 102
103 // rc.RequestMethod = "POST"; 103 // rc.RequestMethod = "POST";
@@ -105,7 +105,7 @@ namespace OpenSim.Framework.Communications.Cache
105 //m_log.InfoFormat("[ASSET]: Stored {0}", rc); 105 //m_log.InfoFormat("[ASSET]: Stored {0}", rc);
106 106
107 m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID); 107 m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);
108 108
109 RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); 109 RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset);
110 } 110 }
111 catch (Exception e) 111 catch (Exception e)
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index c8cec69..0fbc427 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache
36 public class InventoryFolderImpl : InventoryFolderBase 36 public class InventoryFolderImpl : InventoryFolderBase
37 { 37 {
38 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 38 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
39 39
40 // Fields 40 // Fields
41 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); 41 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
42 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>(); 42 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
@@ -82,14 +82,14 @@ namespace OpenSim.Framework.Communications.Cache
82 subFold.ParentID = this.ID; 82 subFold.ParentID = this.ID;
83 subFold.Owner = Owner; 83 subFold.Owner = Owner;
84 SubFolders.Add(subFold.ID, subFold); 84 SubFolders.Add(subFold.ID, subFold);
85 85
86 return subFold; 86 return subFold;
87 } 87 }
88 } 88 }
89 89
90 return null; 90 return null;
91 } 91 }
92 92
93 /// <summary> 93 /// <summary>
94 /// Delete all the folders and items in this folder. 94 /// Delete all the folders and items in this folder.
95 /// </summary> 95 /// </summary>
@@ -97,9 +97,9 @@ namespace OpenSim.Framework.Communications.Cache
97 { 97 {
98 foreach (InventoryFolderImpl folder in SubFolders.Values) 98 foreach (InventoryFolderImpl folder in SubFolders.Values)
99 { 99 {
100 folder.Purge(); 100 folder.Purge();
101 } 101 }
102 102
103 SubFolders.Clear(); 103 SubFolders.Clear();
104 Items.Clear(); 104 Items.Clear();
105 } 105 }
@@ -118,20 +118,20 @@ namespace OpenSim.Framework.Communications.Cache
118 return Items[itemID]; 118 return Items[itemID];
119 } 119 }
120 } 120 }
121 121
122 lock (SubFolders) 122 lock (SubFolders)
123 { 123 {
124 foreach (InventoryFolderImpl folder in SubFolders.Values) 124 foreach (InventoryFolderImpl folder in SubFolders.Values)
125 { 125 {
126 InventoryItemBase item = folder.FindItem(itemID); 126 InventoryItemBase item = folder.FindItem(itemID);
127 127
128 if (item != null) 128 if (item != null)
129 { 129 {
130 return item; 130 return item;
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 return null; 135 return null;
136 } 136 }
137 137
@@ -143,7 +143,7 @@ namespace OpenSim.Framework.Communications.Cache
143 public bool DeleteItem(LLUUID itemID) 143 public bool DeleteItem(LLUUID itemID)
144 { 144 {
145 bool found = false; 145 bool found = false;
146 146
147 lock (Items) 147 lock (Items)
148 { 148 {
149 if (Items.ContainsKey(itemID)) 149 if (Items.ContainsKey(itemID))
@@ -152,20 +152,20 @@ namespace OpenSim.Framework.Communications.Cache
152 return true; 152 return true;
153 } 153 }
154 } 154 }
155 155
156 lock (SubFolders) 156 lock (SubFolders)
157 { 157 {
158 foreach (InventoryFolderImpl folder in SubFolders.Values) 158 foreach (InventoryFolderImpl folder in SubFolders.Values)
159 { 159 {
160 found = folder.DeleteItem(itemID); 160 found = folder.DeleteItem(itemID);
161 161
162 if (found == true) 162 if (found == true)
163 { 163 {
164 break; 164 break;
165 } 165 }
166 } 166 }
167 } 167 }
168 168
169 return found; 169 return found;
170 } 170 }
171 171
@@ -175,25 +175,25 @@ namespace OpenSim.Framework.Communications.Cache
175 /// </summary> 175 /// </summary>
176 /// <returns>The requested folder if it exists, null if it does not.</returns> 176 /// <returns>The requested folder if it exists, null if it does not.</returns>
177 public InventoryFolderImpl FindFolder(LLUUID folderID) 177 public InventoryFolderImpl FindFolder(LLUUID folderID)
178 { 178 {
179 if (folderID == ID) 179 if (folderID == ID)
180 { 180 {
181 return this; 181 return this;
182 } 182 }
183 183
184 lock (SubFolders) 184 lock (SubFolders)
185 { 185 {
186 foreach (InventoryFolderImpl folder in SubFolders.Values) 186 foreach (InventoryFolderImpl folder in SubFolders.Values)
187 { 187 {
188 InventoryFolderImpl returnFolder = folder.FindFolder(folderID); 188 InventoryFolderImpl returnFolder = folder.FindFolder(folderID);
189 189
190 if (returnFolder != null) 190 if (returnFolder != null)
191 { 191 {
192 return returnFolder; 192 return returnFolder;
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 return null; 197 return null;
198 } 198 }
199 199
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache
203 public List<InventoryItemBase> RequestListOfItems() 203 public List<InventoryItemBase> RequestListOfItems()
204 { 204 {
205 List<InventoryItemBase> itemList = new List<InventoryItemBase>(); 205 List<InventoryItemBase> itemList = new List<InventoryItemBase>();
206 206
207 lock (Items) 207 lock (Items)
208 { 208 {
209 foreach (InventoryItemBase item in Items.Values) 209 foreach (InventoryItemBase item in Items.Values)
@@ -211,9 +211,9 @@ namespace OpenSim.Framework.Communications.Cache
211 itemList.Add(item); 211 itemList.Add(item);
212 } 212 }
213 } 213 }
214 214
215 //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count); 215 //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count);
216 216
217 return itemList; 217 return itemList;
218 } 218 }
219 219
@@ -221,9 +221,9 @@ namespace OpenSim.Framework.Communications.Cache
221 /// Return the list of immediate child folders in this folder. 221 /// Return the list of immediate child folders in this folder.
222 /// </summary> 222 /// </summary>
223 public List<InventoryFolderBase> RequestListOfFolders() 223 public List<InventoryFolderBase> RequestListOfFolders()
224 { 224 {
225 List<InventoryFolderBase> folderList = new List<InventoryFolderBase>(); 225 List<InventoryFolderBase> folderList = new List<InventoryFolderBase>();
226 226
227 lock (SubFolders) 227 lock (SubFolders)
228 { 228 {
229 foreach (InventoryFolderBase folder in SubFolders.Values) 229 foreach (InventoryFolderBase folder in SubFolders.Values)
@@ -231,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache
231 folderList.Add(folder); 231 folderList.Add(folder);
232 } 232 }
233 } 233 }
234 234
235 return folderList; 235 return folderList;
236 } 236 }
237 } 237 }
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index b3852c0..ca7eb13 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -45,34 +45,34 @@ namespace OpenSim.Framework.Communications.Cache
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); 47 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
48 48
49 /// <summary> 49 /// <summary>
50 /// Holds the root library folder and all its descendents. This is really only used during inventory 50 /// Holds the root library folder and all its descendents. This is really only used during inventory
51 /// setup so that we don't have to repeatedly search the tree of library folders. 51 /// setup so that we don't have to repeatedly search the tree of library folders.
52 /// </summary> 52 /// </summary>
53 protected Dictionary<LLUUID, InventoryFolderImpl> libraryFolders 53 protected Dictionary<LLUUID, InventoryFolderImpl> libraryFolders
54 = new Dictionary<LLUUID, InventoryFolderImpl>(); 54 = new Dictionary<LLUUID, InventoryFolderImpl>();
55 55
56 public LibraryRootFolder() 56 public LibraryRootFolder()
57 { 57 {
58 m_log.Info("[LIBRARY INVENTORY]: Loading library inventory"); 58 m_log.Info("[LIBRARY INVENTORY]: Loading library inventory");
59 59
60 Owner = libOwner; 60 Owner = libOwner;
61 ID = new LLUUID("00000112-000f-0000-0000-000100bba000"); 61 ID = new LLUUID("00000112-000f-0000-0000-000100bba000");
62 Name = "OpenSim Library"; 62 Name = "OpenSim Library";
63 ParentID = LLUUID.Zero; 63 ParentID = LLUUID.Zero;
64 Type = (short) 8; 64 Type = (short) 8;
65 Version = (ushort) 1; 65 Version = (ushort) 1;
66 66
67 libraryFolders.Add(ID, this); 67 libraryFolders.Add(ID, this);
68 68
69 LoadLibraries(Path.Combine(Util.inventoryDir(), "Libraries.xml")); 69 LoadLibraries(Path.Combine(Util.inventoryDir(), "Libraries.xml"));
70 70
71 // CreateLibraryItems(); 71 // CreateLibraryItems();
72 } 72 }
73 73
74 /// <summary> 74 /// <summary>
75 /// Hardcoded item creation. Please don't add any more items here - future items should be created 75 /// Hardcoded item creation. Please don't add any more items here - future items should be created
76 /// in the xml in the bin/inventory folder. 76 /// in the xml in the bin/inventory folder.
77 /// </summary> 77 /// </summary>
78 /// 78 ///
@@ -132,7 +132,7 @@ namespace OpenSim.Framework.Communications.Cache
132 item.NextPermissions = 0x7FFFFFFF; 132 item.NextPermissions = 0x7FFFFFFF;
133 return item; 133 return item;
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// Use the asset set information at path to load assets 137 /// Use the asset set information at path to load assets
138 /// </summary> 138 /// </summary>
@@ -142,49 +142,49 @@ namespace OpenSim.Framework.Communications.Cache
142 { 142 {
143 m_log.InfoFormat( 143 m_log.InfoFormat(
144 "[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath); 144 "[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath);
145 145
146 LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig); 146 LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig);
147 } 147 }
148 148
149 /// <summary> 149 /// <summary>
150 /// Read a library set from config 150 /// Read a library set from config
151 /// </summary> 151 /// </summary>
152 /// <param name="config"></param> 152 /// <param name="config"></param>
153 protected void ReadLibraryFromConfig(IConfig config) 153 protected void ReadLibraryFromConfig(IConfig config)
154 { 154 {
155 string foldersPath 155 string foldersPath
156 = Path.Combine( 156 = Path.Combine(
157 Util.inventoryDir(), config.GetString("foldersFile", String.Empty)); 157 Util.inventoryDir(), config.GetString("foldersFile", String.Empty));
158 158
159 LoadFromFile(foldersPath, "Library folders", ReadFolderFromConfig); 159 LoadFromFile(foldersPath, "Library folders", ReadFolderFromConfig);
160 160
161 string itemsPath 161 string itemsPath
162 = Path.Combine( 162 = Path.Combine(
163 Util.inventoryDir(), config.GetString("itemsFile", String.Empty)); 163 Util.inventoryDir(), config.GetString("itemsFile", String.Empty));
164 164
165 LoadFromFile(itemsPath, "Library items", ReadItemFromConfig); 165 LoadFromFile(itemsPath, "Library items", ReadItemFromConfig);
166 } 166 }
167 167
168 /// <summary> 168 /// <summary>
169 /// Read a library inventory folder from a loaded configuration 169 /// Read a library inventory folder from a loaded configuration
170 /// </summary> 170 /// </summary>
171 /// <param name="source"></param> 171 /// <param name="source"></param>
172 private void ReadFolderFromConfig(IConfig config) 172 private void ReadFolderFromConfig(IConfig config)
173 { 173 {
174 InventoryFolderImpl folderInfo = new InventoryFolderImpl(); 174 InventoryFolderImpl folderInfo = new InventoryFolderImpl();
175 175
176 folderInfo.ID = new LLUUID(config.GetString("folderID", ID.ToString())); 176 folderInfo.ID = new LLUUID(config.GetString("folderID", ID.ToString()));
177 folderInfo.Name = config.GetString("name", "unknown"); 177 folderInfo.Name = config.GetString("name", "unknown");
178 folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString())); 178 folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString()));
179 folderInfo.Type = (short)config.GetInt("type", 8); 179 folderInfo.Type = (short)config.GetInt("type", 8);
180 180
181 folderInfo.Owner = libOwner; 181 folderInfo.Owner = libOwner;
182 folderInfo.Version = 1; 182 folderInfo.Version = 1;
183 183
184 if (libraryFolders.ContainsKey(folderInfo.ParentID)) 184 if (libraryFolders.ContainsKey(folderInfo.ParentID))
185 { 185 {
186 InventoryFolderImpl parentFolder = libraryFolders[folderInfo.ParentID]; 186 InventoryFolderImpl parentFolder = libraryFolders[folderInfo.ParentID];
187 187
188 libraryFolders.Add(folderInfo.ID, folderInfo); 188 libraryFolders.Add(folderInfo.ID, folderInfo);
189 parentFolder.SubFolders.Add(folderInfo.ID, folderInfo); 189 parentFolder.SubFolders.Add(folderInfo.ID, folderInfo);
190 190
@@ -201,7 +201,7 @@ namespace OpenSim.Framework.Communications.Cache
201 /// <summary> 201 /// <summary>
202 /// Read a library inventory item metadata from a loaded configuration 202 /// Read a library inventory item metadata from a loaded configuration
203 /// </summary> 203 /// </summary>
204 /// <param name="source"></param> 204 /// <param name="source"></param>
205 private void ReadItemFromConfig(IConfig config) 205 private void ReadItemFromConfig(IConfig config)
206 { 206 {
207 InventoryItemBase item = new InventoryItemBase(); 207 InventoryItemBase item = new InventoryItemBase();
@@ -218,11 +218,11 @@ namespace OpenSim.Framework.Communications.Cache
218 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); 218 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
219 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); 219 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
220 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); 220 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
221 221
222 if (libraryFolders.ContainsKey(item.Folder)) 222 if (libraryFolders.ContainsKey(item.Folder))
223 { 223 {
224 InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; 224 InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
225 225
226 parentFolder.Items.Add(item.ID, item); 226 parentFolder.Items.Add(item.ID, item);
227 } 227 }
228 else 228 else
@@ -230,11 +230,11 @@ namespace OpenSim.Framework.Communications.Cache
230 m_log.WarnFormat( 230 m_log.WarnFormat(
231 "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", 231 "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
232 item.Name, item.ID, item.Folder); 232 item.Name, item.ID, item.Folder);
233 } 233 }
234 } 234 }
235 235
236 private delegate void ConfigAction(IConfig config); 236 private delegate void ConfigAction(IConfig config);
237 237
238 /// <summary> 238 /// <summary>
239 /// Load the given configuration at a path and perform an action on each Config contained within it 239 /// Load the given configuration at a path and perform an action on each Config contained within it
240 /// </summary> 240 /// </summary>
@@ -242,7 +242,7 @@ namespace OpenSim.Framework.Communications.Cache
242 /// <param name="fileDescription"></param> 242 /// <param name="fileDescription"></param>
243 /// <param name="action"></param> 243 /// <param name="action"></param>
244 private static void LoadFromFile(string path, string fileDescription, ConfigAction action) 244 private static void LoadFromFile(string path, string fileDescription, ConfigAction action)
245 { 245 {
246 if (File.Exists(path)) 246 if (File.Exists(path))
247 { 247 {
248 try 248 try
@@ -250,21 +250,21 @@ namespace OpenSim.Framework.Communications.Cache
250 XmlConfigSource source = new XmlConfigSource(path); 250 XmlConfigSource source = new XmlConfigSource(path);
251 251
252 for (int i = 0; i < source.Configs.Count; i++) 252 for (int i = 0; i < source.Configs.Count; i++)
253 { 253 {
254 action(source.Configs[i]); 254 action(source.Configs[i]);
255 } 255 }
256 } 256 }
257 catch (XmlException e) 257 catch (XmlException e)
258 { 258 {
259 m_log.ErrorFormat("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e); 259 m_log.ErrorFormat("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e);
260 } 260 }
261 } 261 }
262 else 262 else
263 { 263 {
264 m_log.ErrorFormat("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path); 264 m_log.ErrorFormat("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path);
265 } 265 }
266 } 266 }
267 267
268 /// <summary> 268 /// <summary>
269 /// Looks like a simple getter, but is written like this for some consistency with the other Request 269 /// Looks like a simple getter, but is written like this for some consistency with the other Request
270 /// methods in the superclass 270 /// methods in the superclass
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 7f911dc..fe61406 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -33,7 +33,7 @@ using libsecondlife;
33using log4net; 33using log4net;
34 34
35namespace OpenSim.Framework.Communications.Cache 35namespace OpenSim.Framework.Communications.Cache
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Holds user profile information and retrieves it from backend services. 38 /// Holds user profile information and retrieves it from backend services.
39 /// </summary> 39 /// </summary>
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
45 /// The comms manager holds references to services (user, grid, inventory, etc.) 45 /// The comms manager holds references to services (user, grid, inventory, etc.)
46 /// </summary> 46 /// </summary>
47 private readonly CommunicationsManager m_commsManager; 47 private readonly CommunicationsManager m_commsManager;
48 48
49 /// <summary> 49 /// <summary>
50 /// Each user has a cached profile. 50 /// Each user has a cached profile.
51 /// </summary> 51 /// </summary>
@@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache
84 } 84 }
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 /// <summary> 89 /// <summary>
90 /// Remove this user's profile cache. 90 /// Remove this user's profile cache.
91 /// </summary> 91 /// </summary>
@@ -103,9 +103,9 @@ namespace OpenSim.Framework.Communications.Cache
103 else 103 else
104 { 104 {
105 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID); 105 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID);
106 } 106 }
107 } 107 }
108 108
109 return false; 109 return false;
110 } 110 }
111 111
@@ -118,14 +118,14 @@ namespace OpenSim.Framework.Communications.Cache
118 { 118 {
119 CachedUserInfo userInfo = GetUserDetails(userID); 119 CachedUserInfo userInfo = GetUserDetails(userID);
120 if (userInfo != null) 120 if (userInfo != null)
121 { 121 {
122 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive); 122 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
123 } 123 }
124 else 124 else
125 { 125 {
126 m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID); 126 m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID);
127 } 127 }
128 } 128 }
129 129
130 /// <summary> 130 /// <summary>
131 /// Get the details of the given user. A caller should try this method first if it isn't sure that 131 /// Get the details of the given user. A caller should try this method first if it isn't sure that
@@ -151,7 +151,7 @@ namespace OpenSim.Framework.Communications.Cache
151 /// <param name="parentID"></param> 151 /// <param name="parentID"></param>
152 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType, 152 public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType,
153 string folderName, LLUUID parentID) 153 string folderName, LLUUID parentID)
154 { 154 {
155 CachedUserInfo userProfile; 155 CachedUserInfo userProfile;
156 156
157 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) 157 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@@ -159,21 +159,21 @@ namespace OpenSim.Framework.Communications.Cache
159 if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID)) 159 if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID))
160 { 160 {
161 m_log.ErrorFormat( 161 m_log.ErrorFormat(
162 "[AGENT INVENTORY]: Failed to create folder for user {0} {1}", 162 "[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
163 remoteClient.Name, remoteClient.AgentId); 163 remoteClient.Name, remoteClient.AgentId);
164 } 164 }
165 } 165 }
166 else 166 else
167 { 167 {
168 m_log.ErrorFormat( 168 m_log.ErrorFormat(
169 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 169 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
170 remoteClient.Name, remoteClient.AgentId); 170 remoteClient.Name, remoteClient.AgentId);
171 } 171 }
172 } 172 }
173 173
174 /// <summary> 174 /// <summary>
175 /// Handle a client request to update the inventory folder 175 /// Handle a client request to update the inventory folder
176 /// 176 ///
177 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE 177 /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
178 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, 178 /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
179 /// and needs to be changed. 179 /// and needs to be changed.
@@ -188,7 +188,7 @@ namespace OpenSim.Framework.Communications.Cache
188 { 188 {
189// m_log.DebugFormat( 189// m_log.DebugFormat(
190// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); 190// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
191 191
192 CachedUserInfo userProfile; 192 CachedUserInfo userProfile;
193 193
194 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) 194 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@@ -196,16 +196,16 @@ namespace OpenSim.Framework.Communications.Cache
196 if (!userProfile.UpdateFolder(name, folderID, type, parentID)) 196 if (!userProfile.UpdateFolder(name, folderID, type, parentID))
197 { 197 {
198 m_log.ErrorFormat( 198 m_log.ErrorFormat(
199 "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", 199 "[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
200 remoteClient.Name, remoteClient.AgentId); 200 remoteClient.Name, remoteClient.AgentId);
201 } 201 }
202 } 202 }
203 else 203 else
204 { 204 {
205 m_log.ErrorFormat( 205 m_log.ErrorFormat(
206 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 206 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
207 remoteClient.Name, remoteClient.AgentId); 207 remoteClient.Name, remoteClient.AgentId);
208 } 208 }
209 } 209 }
210 210
211 /// <summary> 211 /// <summary>
@@ -223,16 +223,16 @@ namespace OpenSim.Framework.Communications.Cache
223 if (!userProfile.MoveFolder(folderID, parentID)) 223 if (!userProfile.MoveFolder(folderID, parentID))
224 { 224 {
225 m_log.ErrorFormat( 225 m_log.ErrorFormat(
226 "[AGENT INVENTORY]: Failed to move folder for user {0} {1}", 226 "[AGENT INVENTORY]: Failed to move folder for user {0} {1}",
227 remoteClient.Name, remoteClient.AgentId); 227 remoteClient.Name, remoteClient.AgentId);
228 } 228 }
229 } 229 }
230 else 230 else
231 { 231 {
232 m_log.ErrorFormat( 232 m_log.ErrorFormat(
233 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 233 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
234 remoteClient.Name, remoteClient.AgentId); 234 remoteClient.Name, remoteClient.AgentId);
235 } 235 }
236 } 236 }
237 237
238 /// <summary> 238 /// <summary>
@@ -267,14 +267,14 @@ namespace OpenSim.Framework.Communications.Cache
267 else 267 else
268 { 268 {
269 m_log.ErrorFormat( 269 m_log.ErrorFormat(
270 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 270 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
271 remoteClient.Name, remoteClient.AgentId); 271 remoteClient.Name, remoteClient.AgentId);
272 } 272 }
273 } 273 }
274 274
275 /// <summary> 275 /// <summary>
276 /// Handle the caps inventory descendents fetch. 276 /// Handle the caps inventory descendents fetch.
277 /// 277 ///
278 /// Since the folder structure is sent to the client on login, I believe we only need to handle items. 278 /// Since the folder structure is sent to the client on login, I believe we only need to handle items.
279 /// </summary> 279 /// </summary>
280 /// <param name="agentID"></param> 280 /// <param name="agentID"></param>
@@ -288,20 +288,20 @@ namespace OpenSim.Framework.Communications.Cache
288 bool fetchFolders, bool fetchItems, int sortOrder) 288 bool fetchFolders, bool fetchItems, int sortOrder)
289 { 289 {
290// m_log.DebugFormat( 290// m_log.DebugFormat(
291// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", 291// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
292// fetchFolders, fetchItems, folderID, agentID); 292// fetchFolders, fetchItems, folderID, agentID);
293 293
294 // FIXME MAYBE: We're not handling sortOrder! 294 // FIXME MAYBE: We're not handling sortOrder!
295 295
296 InventoryFolderImpl fold; 296 InventoryFolderImpl fold;
297 if ((fold = libraryRoot.FindFolder(folderID)) != null) 297 if ((fold = libraryRoot.FindFolder(folderID)) != null)
298 { 298 {
299 return fold.RequestListOfItems(); 299 return fold.RequestListOfItems();
300 } 300 }
301 301
302 CachedUserInfo userProfile; 302 CachedUserInfo userProfile;
303 if (m_userProfiles.TryGetValue(agentID, out userProfile)) 303 if (m_userProfiles.TryGetValue(agentID, out userProfile))
304 { 304 {
305 // XXX: When a client crosses into a scene, their entire inventory is fetched 305 // XXX: When a client crosses into a scene, their entire inventory is fetched
306 // asynchronously. If the client makes a request before the inventory is received, we need 306 // asynchronously. If the client makes a request before the inventory is received, we need
307 // to give the inventory a chance to come in. 307 // to give the inventory a chance to come in.
@@ -315,18 +315,18 @@ namespace OpenSim.Framework.Communications.Cache
315 while (attempts++ < 30) 315 while (attempts++ < 30)
316 { 316 {
317 m_log.DebugFormat( 317 m_log.DebugFormat(
318 "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}", 318 "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}",
319 attempts, folderID, agentID); 319 attempts, folderID, agentID);
320 320
321 Thread.Sleep(2000); 321 Thread.Sleep(2000);
322 322
323 if (userProfile.HasInventory) 323 if (userProfile.HasInventory)
324 { 324 {
325 break; 325 break;
326 } 326 }
327 } 327 }
328 } 328 }
329 329
330 if (userProfile.HasInventory) 330 if (userProfile.HasInventory)
331 { 331 {
332 if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) 332 if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null)
@@ -338,9 +338,9 @@ namespace OpenSim.Framework.Communications.Cache
338 m_log.WarnFormat( 338 m_log.WarnFormat(
339 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1}", 339 "[AGENT INVENTORY]: Could not find folder {0} requested by user {1}",
340 folderID, agentID); 340 folderID, agentID);
341 341
342 return null; 342 return null;
343 } 343 }
344 } 344 }
345 else 345 else
346 { 346 {
@@ -352,7 +352,7 @@ namespace OpenSim.Framework.Communications.Cache
352 else 352 else
353 { 353 {
354 m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID); 354 m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID);
355 355
356 return null; 356 return null;
357 } 357 }
358 } 358 }
@@ -371,16 +371,16 @@ namespace OpenSim.Framework.Communications.Cache
371 if (!userProfile.PurgeFolder(folderID)) 371 if (!userProfile.PurgeFolder(folderID))
372 { 372 {
373 m_log.ErrorFormat( 373 m_log.ErrorFormat(
374 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", 374 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}",
375 remoteClient.Name, remoteClient.AgentId); 375 remoteClient.Name, remoteClient.AgentId);
376 } 376 }
377 } 377 }
378 else 378 else
379 { 379 {
380 m_log.ErrorFormat( 380 m_log.ErrorFormat(
381 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 381 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
382 remoteClient.Name, remoteClient.AgentId); 382 remoteClient.Name, remoteClient.AgentId);
383 } 383 }
384 } 384 }
385 385
386 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) 386 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
@@ -407,9 +407,9 @@ namespace OpenSim.Framework.Communications.Cache
407 else 407 else
408 { 408 {
409 m_log.ErrorFormat( 409 m_log.ErrorFormat(
410 "[AGENT INVENTORY]: Could not find user profile for {0} {1}", 410 "[AGENT INVENTORY]: Could not find user profile for {0} {1}",
411 remoteClient.Name, remoteClient.AgentId); 411 remoteClient.Name, remoteClient.AgentId);
412 } 412 }
413 } 413 }
414 } 414 }
415} 415}