* Minor: really just comment and subsequent indentation adjustment. Preparation for handling inventory problems where the inventory server receives a request and never responds, or is late in responding

0.6.0-stable
Justin Clarke Casey 2008-04-10 17:44:19 +00:00
parent 5ad4c79a4e
commit b41abbd50e
2 changed files with 62 additions and 42 deletions

View File

@ -293,64 +293,73 @@ namespace OpenSim.Framework.Communications.Cache
folderID, remoteClient.Name); folderID, remoteClient.Name);
} }
/// <summary>
/// Handle the caps inventory descendents fetch.
///
/// Since the folder structure is sent to the client on login, I believe we only need to handle items.
/// </summary>
/// <param name="agentID"></param>
/// <param name="folderID"></param>
/// <param name="ownerID"></param>
/// <param name="fetchFolders"></param>
/// <param name="fetchItems"></param>
/// <param name="sortOrder"></param>
/// <returns></returns>
public List<InventoryItemBase> HandleFetchInventoryDescendentsCAPS(LLUUID agentID, LLUUID folderID, LLUUID ownerID, public List<InventoryItemBase> HandleFetchInventoryDescendentsCAPS(LLUUID agentID, LLUUID folderID, LLUUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder) bool fetchFolders, bool fetchItems, int sortOrder)
{ {
// XXX We're not handling sortOrder yet! // XXX We're not handling sortOrder yet!
// with CAPS we are only return items in the folders at the moment
// need to find the format that sub folder details are sent in
// if (fetchItems)
// {
InventoryFolderImpl fold = null;
if (folderID == libraryRoot.ID)
{
return libraryRoot.RequestListOfItems();
}
if ((fold = libraryRoot.HasSubFolder(folderID)) != null) InventoryFolderImpl fold = null;
{ if (folderID == libraryRoot.ID)
return fold.RequestListOfItems(); {
} return libraryRoot.RequestListOfItems();
}
CachedUserInfo userProfile; if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
if (m_userProfiles.TryGetValue(agentID, out userProfile)) {
return fold.RequestListOfItems();
}
CachedUserInfo userProfile;
if (m_userProfiles.TryGetValue(agentID, out userProfile))
{
if (userProfile.RootFolder != null)
{ {
if (userProfile.RootFolder != null) if (userProfile.RootFolder.ID == folderID)
{ {
if (userProfile.RootFolder.ID == folderID) return userProfile.RootFolder.RequestListOfItems();
{
return userProfile.RootFolder.RequestListOfItems();
}
else
{
if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null)
{
return fold.RequestListOfItems();
}
}
} }
else else
{ {
m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString()); if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null)
{
return new List<InventoryItemBase>(); ; return fold.RequestListOfItems();
}
} }
} }
else else
{ {
m_log.ErrorFormat( m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString());
"[USER CACHE]: HandleFetchInventoryDescendentsCAPS() Could not find user profile for {0}",
agentID); return new List<InventoryItemBase>(); ;
}
return new List<InventoryItemBase>(); }
} else
{
m_log.ErrorFormat(
"[USER CACHE]: HandleFetchInventoryDescendentsCAPS() Could not find user profile for {0}",
agentID);
return new List<InventoryItemBase>();
}
// If we've reached this point then we couldn't find the folder, even though the client thinks
// it exists
m_log.ErrorFormat("[INVENTORY CACHE]: " +
"Could not find folder {0} for user {1}",
folderID, agentID.ToString());
// If we've reached this point then we couldn't find the folder, even though the client thinks
// it exists
m_log.ErrorFormat("[INVENTORY CACHE]: " +
"Could not find folder {0} for user {1}",
folderID, agentID.ToString());
// }
return new List<InventoryItemBase>(); return new List<InventoryItemBase>();
} }
@ -400,6 +409,11 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
/// <summary>
/// Request the inventory data for the given user.
/// </summary>
/// <param name="userID"></param>
/// <param name="userInfo"></param>
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
{ {
m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);

View File

@ -27,7 +27,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using libsecondlife; using libsecondlife;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
@ -103,6 +106,9 @@ namespace OpenSim.Grid.InventoryServer
/// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns>
public InventoryCollection GetUserInventory(Guid rawUserID) public InventoryCollection GetUserInventory(Guid rawUserID)
{ {
// uncomment me to simulate an overloaded inventory server
//Thread.Sleep(40000);
LLUUID userID = new LLUUID(rawUserID); LLUUID userID = new LLUUID(rawUserID);
m_log.InfoFormat("[AGENT INVENTORY]: Processing request for inventory of {0}", userID); m_log.InfoFormat("[AGENT INVENTORY]: Processing request for inventory of {0}", userID);