* 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 instead0.6.0-stable
parent
8ed9e57896
commit
3984a7fda1
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
@ -191,16 +197,31 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
if (folder != null)
|
||||
{
|
||||
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;
|
||||
|
||||
m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder);
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue