Log whenever an inventory operation is blocked because the item/folder isn't in the Suitcase

0.8.0.3
Oren Hurvitz 2014-05-05 10:20:04 +03:00
parent 0fe08c8799
commit df49196e17
1 changed files with 52 additions and 8 deletions

View File

@ -248,7 +248,10 @@ namespace OpenSim.Services.HypergridService
InventoryCollection coll = null;
if (!IsWithinSuitcaseTree(principalID, folderID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderContent: folder {0} is not within Suitcase tree", folderID);
return new InventoryCollection();
}
coll = base.GetFolderContent(principalID, folderID);
@ -265,7 +268,10 @@ namespace OpenSim.Services.HypergridService
// Let's do a bit of sanity checking, more than the base service does
// make sure the given folder exists under the suitcase tree of this user
if (!IsWithinSuitcaseTree(principalID, folderID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderItems: folder {0} is not within Suitcase tree", folderID);
return new List<InventoryItemBase>();
}
return base.GetFolderItems(principalID, folderID);
}
@ -277,7 +283,10 @@ namespace OpenSim.Services.HypergridService
// make sure the given folder's parent folder exists under the suitcase tree of this user
if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder: folder {0} is not within Suitcase tree", folder.ParentID);
return false;
}
// OK, it's legit
if (base.AddFolder(folder))
@ -297,7 +306,7 @@ namespace OpenSim.Services.HypergridService
//m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version);
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name);
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateFolder: folder {0}/{1} is not within Suitcase tree", folder.Name, folder.ID);
return false;
}
@ -307,9 +316,17 @@ namespace OpenSim.Services.HypergridService
public override bool MoveFolder(InventoryFolderBase folder)
{
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID) ||
!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ID);
return false;
}
if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ParentID);
return false;
}
return base.MoveFolder(folder);
}
@ -331,7 +348,10 @@ namespace OpenSim.Services.HypergridService
// Let's do a bit of sanity checking, more than the base service does
// make sure the given folder's parent folder exists under the suitcase tree of this user
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddItem: folder {0} is not within Suitcase tree", item.Folder);
return false;
}
// OK, it's legit
return base.AddItem(item);
@ -341,7 +361,10 @@ namespace OpenSim.Services.HypergridService
public override bool UpdateItem(InventoryItemBase item)
{
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateItem: folder {0} is not within Suitcase tree", item.Folder);
return false;
}
return base.UpdateItem(item);
}
@ -350,11 +373,28 @@ namespace OpenSim.Services.HypergridService
{
// Principal is b0rked. *sigh*
if (!IsWithinSuitcaseTree(items[0].Owner, items[0].Folder))
// Check the items' destination folders
foreach (InventoryItemBase item in items)
{
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", item.Folder);
return false;
}
}
// Check the items' current folders
foreach (InventoryItemBase item in items)
{
InventoryItemBase originalItem = base.GetItem(item);
if (!IsWithinSuitcaseTree(originalItem.Owner, originalItem.Folder))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", originalItem.Folder);
return false;
}
}
return base.MoveItems(principalID, items);
}
public override bool DeleteItems(UUID principalID, List<UUID> itemIDs)
@ -374,8 +414,8 @@ namespace OpenSim.Services.HypergridService
if (!IsWithinSuitcaseTree(it.Owner, it.Folder) && !IsPartOfAppearance(it.Owner, it.ID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0} (folder {1}) is not within Suitcase",
it.Name, it.Folder);
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0}/{1} (folder {2}) is not within Suitcase tree or Appearance",
it.Name, it.ID, it.Folder);
return null;
}
@ -396,8 +436,12 @@ namespace OpenSim.Services.HypergridService
if (f != null)
{
if (!IsWithinSuitcaseTree(f.Owner, f.ID))
{
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Folder {0}/{1} is not within Suitcase tree",
f.Name, f.ID);
return null;
}
}
return f;
}