* Stop the grid inventory service sending all folder and item details twice

* This change will have no functional impact - we were already filtering out the dupes on the other end.
0.6.0-stable
Justin Clarke Casey 2008-03-30 00:45:04 +00:00
parent a6999f8a5d
commit 2fddd775f4
2 changed files with 10 additions and 55 deletions

View File

@ -75,42 +75,11 @@ namespace OpenSim.Framework.Communications
#endregion #endregion
#region IInventoryServices methods #region IInventoryServices methods
/// <summary>
/// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree)
/// for the given user.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
{
List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
InventoryFolderBase rootFolder = null;
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
rootFolder = plugin.Value.getUserRootFolder(userID);
if (rootFolder != null)
{
m_log.Info(
"[INVENTORY]: Found root folder for user with ID " + userID + ". Retrieving inventory contents.");
inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID);
inventoryList.Insert(0, rootFolder);
return inventoryList;
}
}
m_log.Warn(
"[INVENTORY]: Could not find a root folder belonging to user with ID " + userID);
return inventoryList;
}
// See IInventoryServices // See IInventoryServices
public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
{ {
m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); //m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId);
List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();

View File

@ -46,22 +46,8 @@ namespace OpenSim.Grid.InventoryServer
private bool TryGetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList, private bool TryGetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList,
out List<InventoryItemBase> itemsList) out List<InventoryItemBase> itemsList)
{ {
List<InventoryFolderBase> rootFolders = RequestFirstLevelFolders(userID); List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID);
List<InventoryItemBase> allItems = new List<InventoryItemBase>(); List<InventoryItemBase> allItems = new List<InventoryItemBase>();
List<InventoryFolderBase> allFolders = new List<InventoryFolderBase>();
if (rootFolders != null)
{
allFolders.InsertRange(0, rootFolders);
foreach (InventoryFolderBase subfolder in rootFolders)
{
List<InventoryFolderBase> subFolders = GetAllFolders(subfolder.folderID);
if (subFolders != null)
{
allFolders.InsertRange(0, subFolders);
}
}
}
foreach (InventoryFolderBase folder in allFolders) foreach (InventoryFolderBase folder in allFolders)
{ {
@ -108,7 +94,7 @@ namespace OpenSim.Grid.InventoryServer
{ {
LLUUID userID = new LLUUID(rawUserID); LLUUID userID = new LLUUID(rawUserID);
m_log.Info("[GRID INVENTORY]: Request for inventory of " + userID.ToString()); m_log.Info("[AGENT INVENTORY]: Processing request for inventory of " + userID.ToString());
InventoryCollection invCollection = new InventoryCollection(); InventoryCollection invCollection = new InventoryCollection();
List<InventoryFolderBase> folders; List<InventoryFolderBase> folders;
@ -123,14 +109,14 @@ namespace OpenSim.Grid.InventoryServer
// foreach (InventoryFolderBase folder in folders) // foreach (InventoryFolderBase folder in folders)
// { // {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[GRID INVENTORY]: Sending back folder {0}, {1}", // "[AGENT INVENTORY]: Sending back folder {0}, {1}",
// folder.name, folder.folderID); // folder.name, folder.folderID);
// } // }
// //
// foreach (InventoryItemBase item in allItems) // foreach (InventoryItemBase item in allItems)
// { // {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[GRID INVENTORY]: Sending back item {0}, {1}, folder {2}", // "[AGENT INVENTORY]: Sending back item {0}, {1}, folder {2}",
// item.inventoryName, item.inventoryID, item.parentFolderID); // item.inventoryName, item.inventoryID, item.parentFolderID);
// } // }
@ -153,7 +139,7 @@ namespace OpenSim.Grid.InventoryServer
LLUUID userID = new LLUUID(rawUserID); LLUUID userID = new LLUUID(rawUserID);
m_log.Info( m_log.Info(
"[INVENTORY]: Creating new set of inventory folders for " + userID.ToString()); "[AGENT INVENTORY]: Creating new set of inventory folders for " + userID.ToString());
CreateNewUserInventory(userID); CreateNewUserInventory(userID);
return true; return true;
@ -179,7 +165,7 @@ namespace OpenSim.Grid.InventoryServer
{ {
// Right now, this actions act more like an update/insert combination than a simple create. // Right now, this actions act more like an update/insert combination than a simple create.
m_log.Info( m_log.Info(
"[INVENTORY]: " + "[AGENT INVENTORY]: " +
"Updating in " + folder.parentID.ToString() "Updating in " + folder.parentID.ToString()
+ ", folder " + folder.name); + ", folder " + folder.name);
@ -190,7 +176,7 @@ namespace OpenSim.Grid.InventoryServer
public bool MoveInventoryFolder(InventoryFolderBase folder) public bool MoveInventoryFolder(InventoryFolderBase folder)
{ {
m_log.Info( m_log.Info(
"[INVENTORY]: " + "[AGENT INVENTORY]: " +
"Moving folder " + folder.folderID "Moving folder " + folder.folderID
+ " to " + folder.parentID.ToString()); + " to " + folder.parentID.ToString());
@ -202,7 +188,7 @@ namespace OpenSim.Grid.InventoryServer
{ {
// Right now, this actions act more like an update/insert combination than a simple create. // Right now, this actions act more like an update/insert combination than a simple create.
m_log.Info( m_log.Info(
"[INVENTORY]: " + "[AGENT INVENTORY]: " +
"Updating in " + item.parentFolderID.ToString() "Updating in " + item.parentFolderID.ToString()
+ ", item " + item.inventoryName); + ", item " + item.inventoryName);
@ -214,7 +200,7 @@ namespace OpenSim.Grid.InventoryServer
{ {
// extra spaces to align with other inventory messages // extra spaces to align with other inventory messages
m_log.Info( m_log.Info(
"[INVENTORY]: " + "[AGENT INVENTORY]: " +
"Deleting in " + item.parentFolderID.ToString() "Deleting in " + item.parentFolderID.ToString()
+ ", item " + item.inventoryName); + ", item " + item.inventoryName);