Log whenever an inventory operation is blocked because the item/folder isn't in the Suitcase
parent
0fe08c8799
commit
df49196e17
|
@ -248,7 +248,10 @@ namespace OpenSim.Services.HypergridService
|
||||||
InventoryCollection coll = null;
|
InventoryCollection coll = null;
|
||||||
|
|
||||||
if (!IsWithinSuitcaseTree(principalID, folderID))
|
if (!IsWithinSuitcaseTree(principalID, folderID))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderContent: folder {0} is not within Suitcase tree", folderID);
|
||||||
return new InventoryCollection();
|
return new InventoryCollection();
|
||||||
|
}
|
||||||
|
|
||||||
coll = base.GetFolderContent(principalID, folderID);
|
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
|
// 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
|
// make sure the given folder exists under the suitcase tree of this user
|
||||||
if (!IsWithinSuitcaseTree(principalID, folderID))
|
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 new List<InventoryItemBase>();
|
||||||
|
}
|
||||||
|
|
||||||
return base.GetFolderItems(principalID, folderID);
|
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
|
// make sure the given folder's parent folder exists under the suitcase tree of this user
|
||||||
|
|
||||||
if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
|
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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// OK, it's legit
|
// OK, it's legit
|
||||||
if (base.AddFolder(folder))
|
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);
|
//m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version);
|
||||||
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,9 +316,17 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
public override bool MoveFolder(InventoryFolderBase folder)
|
public override bool MoveFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID) ||
|
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
|
||||||
!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
|
{
|
||||||
|
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ID);
|
||||||
return false;
|
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);
|
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
|
// 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
|
// make sure the given folder's parent folder exists under the suitcase tree of this user
|
||||||
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
|
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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// OK, it's legit
|
// OK, it's legit
|
||||||
return base.AddItem(item);
|
return base.AddItem(item);
|
||||||
|
@ -341,7 +361,10 @@ namespace OpenSim.Services.HypergridService
|
||||||
public override bool UpdateItem(InventoryItemBase item)
|
public override bool UpdateItem(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
|
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 false;
|
||||||
|
}
|
||||||
|
|
||||||
return base.UpdateItem(item);
|
return base.UpdateItem(item);
|
||||||
}
|
}
|
||||||
|
@ -350,11 +373,28 @@ namespace OpenSim.Services.HypergridService
|
||||||
{
|
{
|
||||||
// Principal is b0rked. *sigh*
|
// 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;
|
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);
|
return base.MoveItems(principalID, items);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool DeleteItems(UUID principalID, List<UUID> itemIDs)
|
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))
|
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",
|
m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0}/{1} (folder {2}) is not within Suitcase tree or Appearance",
|
||||||
it.Name, it.Folder);
|
it.Name, it.ID, it.Folder);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,8 +436,12 @@ namespace OpenSim.Services.HypergridService
|
||||||
if (f != null)
|
if (f != null)
|
||||||
{
|
{
|
||||||
if (!IsWithinSuitcaseTree(f.Owner, f.ID))
|
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 null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue