* Refactor: A final root folder special case removal, this time in HandleFetchInventoryDescendents[CAPS]

0.6.0-stable
Justin Clarke Casey 2008-05-04 01:14:21 +00:00
parent 6c62985fd5
commit 5ab392d0ee
1 changed files with 18 additions and 49 deletions

View File

@ -250,15 +250,6 @@ namespace OpenSim.Framework.Communications.Cache
// XXX We're not handling sortOrder yet!
InventoryFolderImpl fold = null;
if (folderID == libraryRoot.ID)
{
remoteClient.SendInventoryFolderDetails(
libraryRoot.Owner, libraryRoot.ID, libraryRoot.RequestListOfItems(),
libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems);
return;
}
if ((fold = libraryRoot.FindFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(
@ -292,21 +283,6 @@ namespace OpenSim.Framework.Communications.Cache
}
if (userProfile.HasInventory)
{
if (userProfile.RootFolder.ID == folderID)
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Found root folder {0} for client {1}",
// folderID, remoteClient.AgentId);
remoteClient.SendInventoryFolderDetails(
remoteClient.AgentId, folderID, userProfile.RootFolder.RequestListOfItems(),
userProfile.RootFolder.RequestListOfFolders(),
fetchFolders, fetchItems);
return;
}
else
{
if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null)
{
@ -320,6 +296,11 @@ namespace OpenSim.Framework.Communications.Cache
return;
}
else
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}",
folderID, remoteClient.Name, remoteClient.AgentId);
}
}
else
@ -363,12 +344,7 @@ namespace OpenSim.Framework.Communications.Cache
// XXX We're not handling sortOrder yet!
InventoryFolderImpl fold = null;
if (folderID == libraryRoot.ID)
{
return libraryRoot.RequestListOfItems();
}
InventoryFolderImpl fold;
if ((fold = libraryRoot.FindFolder(folderID)) != null)
{
return fold.RequestListOfItems();
@ -403,17 +379,18 @@ namespace OpenSim.Framework.Communications.Cache
}
if (userProfile.HasInventory)
{
if (userProfile.RootFolder.ID == folderID)
{
return userProfile.RootFolder.RequestListOfItems();
}
else
{
if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null)
{
return fold.RequestListOfItems();
}
else
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Could not find folder {0} requested by user {1}",
folderID, agentID);
return null;
}
}
else
@ -429,14 +406,6 @@ namespace OpenSim.Framework.Communications.Cache
return null;
}
// If we've reached this point then we couldn't find the folder, even though the client thinks
// it exists
m_log.ErrorFormat("[AGENT INVENTORY]: " +
"Could not find folder {0} for user {1}",
folderID, agentID.ToString());
return new List<InventoryItemBase>();
}
/// <summary>