* Resolve mantis 1068, 1095

* The resolution takes the form of not crashing the session if the folder the user is attempting to add already exists (e.g. there is one already with the same UUID).
* Printing out warnings instead
0.6.0-stable
Justin Clarke Casey 2008-04-30 19:55:45 +00:00
parent 8ed9e57896
commit 3984a7fda1
2 changed files with 38 additions and 10 deletions

View File

@ -62,6 +62,13 @@ namespace OpenSim.Framework.Communications.Cache
{
}
/// <summary>
/// Create a new subfolder. This exists only in the cache.
/// </summary>
/// <param name="folderID"></param>
/// <param name="folderName"></param>
/// <param name="type"></param>
/// <returns>The newly created subfolder. Returns null if the folder already exists</returns>
public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
{
lock (SubFolders)

View File

@ -184,6 +184,12 @@ namespace OpenSim.Framework.Communications.Cache
createdBaseFolder.Version = createdFolder.Version;
m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder);
}
else
{
m_log.WarnFormat(
"[INVENTORY CACHE]: Tried to create folder {0} {1} for user {2} {3} but the folder already exists",
folderName, folderID, remoteClient.Name, remoteClient.AgentId);
}
}
else
{
@ -192,15 +198,30 @@ namespace OpenSim.Framework.Communications.Cache
{
InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType);
InventoryFolderBase createdBaseFolder = new InventoryFolderBase();
createdBaseFolder.Owner = createdFolder.Owner;
createdBaseFolder.ID = createdFolder.ID;
createdBaseFolder.Name = createdFolder.Name;
createdBaseFolder.ParentID = createdFolder.ParentID;
createdBaseFolder.Type = createdFolder.Type;
createdBaseFolder.Version = createdFolder.Version;
if (createdFolder != null)
{
InventoryFolderBase createdBaseFolder = new InventoryFolderBase();
createdBaseFolder.Owner = createdFolder.Owner;
createdBaseFolder.ID = createdFolder.ID;
createdBaseFolder.Name = createdFolder.Name;
createdBaseFolder.ParentID = createdFolder.ParentID;
createdBaseFolder.Type = createdFolder.Type;
createdBaseFolder.Version = createdFolder.Version;
m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder);
m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder);
}
else
{
m_log.WarnFormat(
"[INVENTORY CACHE]: Tried to create folder {0} {1} for user {2} {3} but the folder already exists",
folderName, folderID, remoteClient.Name, remoteClient.AgentId);
}
}
else
{
m_log.WarnFormat(
"[INVENTORY CACHE]: Could not find parent folder with id {0} in order to create folder {1} {2} for user {3} {4}",
parentID, folderName, folderID, remoteClient.Name, remoteClient.AgentId);
}
}
}