* Properly load items into correct folders when an iar is loaded
* At the moment, any existing folders with the same name are reused - will need an option to always create new folders * not yet ready for general useGenericGridServerConcept
parent
c856da2ee6
commit
a5c9354df3
|
@ -222,8 +222,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
item.Creator = m_userInfo.UserProfile.ID;
|
item.Creator = m_userInfo.UserProfile.ID;
|
||||||
item.Owner = m_userInfo.UserProfile.ID;
|
item.Owner = m_userInfo.UserProfile.ID;
|
||||||
|
|
||||||
/*
|
|
||||||
filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length);
|
filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length);
|
||||||
|
filePath = filePath.Remove(filePath.LastIndexOf("/"));
|
||||||
|
|
||||||
|
m_log.DebugFormat("[INVENTORY ARCHIVER]: Loading to file path {0}", filePath);
|
||||||
|
|
||||||
string[] rawFolders = filePath.Split(new char[] { '/' });
|
string[] rawFolders = filePath.Split(new char[] { '/' });
|
||||||
|
|
||||||
// Find the folders that do exist along the path given
|
// Find the folders that do exist along the path given
|
||||||
|
@ -248,17 +251,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
// Create any folders that did not previously exist
|
// Create any folders that did not previously exist
|
||||||
while (i < rawFolders.Length)
|
while (i < rawFolders.Length)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]);
|
m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]);
|
||||||
foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder);
|
|
||||||
|
UUID newFolderId = UUID.Random();
|
||||||
|
m_userInfo.CreateFolder(
|
||||||
|
rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
|
||||||
|
foundFolder = foundFolder.GetChildFolder(newFolderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset folder ID to the one in which we want to load it
|
// 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 = foundFolder.ID;
|
||||||
*/
|
|
||||||
|
|
||||||
item.Folder = rootDestinationFolder.ID;
|
//item.Folder = rootDestinationFolder.ID;
|
||||||
|
|
||||||
m_userInfo.AddItem(item);
|
m_userInfo.AddItem(item);
|
||||||
successfulItemRestores++;
|
successfulItemRestores++;
|
||||||
|
@ -304,7 +308,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
{
|
{
|
||||||
sbyte assetType = InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
sbyte assetType = InventoryArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
|
||||||
|
|
||||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
//m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
||||||
|
|
||||||
AssetBase asset = new AssetBase(new UUID(uuid), "RandomName");
|
AssetBase asset = new AssetBase(new UUID(uuid), "RandomName");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue