mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
* Fix my own unit test
* Disable folder iar creation code for now (though this wasn't actually causing the test failure)
This commit is contained in:
@@ -222,6 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
item.Creator = m_userInfo.UserProfile.ID;
|
||||
item.Owner = m_userInfo.UserProfile.ID;
|
||||
|
||||
/*
|
||||
filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length);
|
||||
string[] rawFolders = filePath.Split(new char[] { '/' });
|
||||
|
||||
@@ -231,23 +232,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
InventoryFolderImpl foundFolder = rootDestinationFolder;
|
||||
while (!noFolder && i < rawFolders.Length)
|
||||
{
|
||||
foundFolder = foundFolder.FindFolderByPath(rawFolders[i]);
|
||||
if (null == foundFolder)
|
||||
noFolder = true;
|
||||
else
|
||||
InventoryFolderImpl folder = foundFolder.FindFolderByPath(rawFolders[i]);
|
||||
if (null != folder)
|
||||
{
|
||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Found folder {0}", folder.Name);
|
||||
foundFolder = folder;
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
noFolder = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Create any folders that did not previously exist
|
||||
while (i < rawFolders.Length)
|
||||
{
|
||||
foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder);
|
||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]);
|
||||
foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder);
|
||||
}
|
||||
|
||||
// Reset folder ID to the one in which we want to load it
|
||||
// TODO: Properly restore entire folder structure. At the moment all items are dumped in this
|
||||
// single folder no matter where in the saved folder structure they are.
|
||||
item.Folder = foundFolder.ID;
|
||||
*/
|
||||
|
||||
item.Folder = rootDestinationFolder.ID;
|
||||
|
||||
m_userInfo.AddItem(item);
|
||||
successfulItemRestores++;
|
||||
|
||||
@@ -128,7 +128,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
bool gotObject1File = false;
|
||||
//bool gotObject2File = false;
|
||||
string expectedObject1FilePath = string.Format(
|
||||
"{0}{1}_{2}.xml",
|
||||
"{0}{1}{2}_{3}.xml",
|
||||
InventoryArchiveConstants.INVENTORY_PATH,
|
||||
"Objects/",
|
||||
item1.Name,
|
||||
item1Id);
|
||||
@@ -151,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
gotControlFile = true;
|
||||
}
|
||||
*/
|
||||
if (filePath.StartsWith("Objects/") && filePath.EndsWith(".xml"))
|
||||
if (filePath.StartsWith(InventoryArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml"))
|
||||
{
|
||||
//string fileName = filePath.Remove(0, "Objects/".Length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user