0.9.1.0-post-fixes
UbitUmarov 2018-11-13 00:58:27 +00:00
parent e4ed2d7d6c
commit cc10cd2161
1 changed files with 74 additions and 73 deletions

View File

@ -521,9 +521,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
objlist[0].OwnerID.ToString()); objlist[0].OwnerID.ToString());
m_Scene.AssetService.Store(asset); m_Scene.AssetService.Store(asset);
item.AssetID = asset.FullID;
item.Description = desc; item.Description = desc;
item.Name = name; item.Name = name;
item.AssetType = (int)AssetType.Object;
item.AssetID = asset.FullID;
if (DeRezAction.SaveToExistingUserInventoryItem == action) if (DeRezAction.SaveToExistingUserInventoryItem == action)
{ {
@ -696,95 +697,95 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null; return null;
} }
return item;
} }
else
// Folder magic
//
if (action == DeRezAction.Delete)
{ {
// Folder magic // Deleting someone else's item
// //
if (action == DeRezAction.Delete) if (remoteClient == null ||
so.OwnerID != remoteClient.AgentId)
{ {
// Deleting someone else's item
//
if (remoteClient == null ||
so.OwnerID != remoteClient.AgentId)
{
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
}
else
{
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
}
}
else if (action == DeRezAction.Return)
{
// Dump to lost + found unconditionally
//
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
} }
else
if (folderID == UUID.Zero && folder == null)
{ {
if (action == DeRezAction.Delete) folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
}
}
else if (action == DeRezAction.Return)
{
// Dump to lost + found unconditionally
//
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
}
if (folderID == UUID.Zero && folder == null)
{
if (action == DeRezAction.Delete)
{
// Deletes go to trash by default
//
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash);
}
else
{
if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId)
{ {
// Deletes go to trash by default // Taking copy of another person's item. Take to
// // Objects folder.
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Trash); folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
so.FromFolderID = UUID.Zero;
} }
else else
{ {
if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId) // Catch all. Use lost & found
{ //
// Taking copy of another person's item. Take to folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
// Objects folder.
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
so.FromFolderID = UUID.Zero;
}
else
{
// Catch all. Use lost & found
//
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
}
} }
} }
// Override and put into where it came from, if it came
// from anywhere in inventory and the owner is taking it back.
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
{
folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID);
if(folder.Type == 14 || folder.Type == 16)
{
// folder.Type = 6;
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
}
}
}
if (folder == null) // None of the above
{
folder = new InventoryFolderBase(folderID);
if (folder == null) // Nowhere to put it
{
return null;
}
}
item = new InventoryItemBase();
item.ID = UUID.Random();
item.InvType = (int)InventoryType.Object;
item.Folder = folder.ID;
item.Owner = userID;
item.CreationDate = Util.UnixTimeSinceEpoch();
} }
// Override and put into where it came from, if it came
// from anywhere in inventory and the owner is taking it back.
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
{
folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID);
if(folder.Type == 14 || folder.Type == 16)
{
// folder.Type = 6;
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
}
}
}
if (folder == null) // None of the above
{
folder = new InventoryFolderBase(folderID);
if (folder == null) // Nowhere to put it
{
return null;
}
}
item = new InventoryItemBase();
item.ID = UUID.Random();
item.InvType = (int)InventoryType.Object;
item.Folder = folder.ID;
item.Owner = userID;
item.CreationDate = Util.UnixTimeSinceEpoch();
return item; return item;
} }
// compatibility do not use // compatibility do not use
public virtual SceneObjectGroup RezObject( public virtual SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,