From Justin Casey (IBM)

When using a local inventory service, this patch stops items held in the
root 'my inventory' folder from 'disappearing' on server restart.
They were actually still there, we just weren't retrieving them.
>From looking at the grid inventory server, the bug probably still exists
in there.
But I wanted to get this patch in first and consult with MW about the grid
fix (he may be planning to change the area extensively soon).
afrisby
Sean Dague 2007-12-05 19:00:29 +00:00
parent c5c0df74e6
commit 4b77821275
1 changed files with 24 additions and 16 deletions

View File

@ -36,10 +36,6 @@ namespace OpenSim.Region.Communications.Local
{
public class LocalInventoryService : InventoryServiceBase
{
public LocalInventoryService()
{
}
public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
InventoryItemInfo itemCallBack)
{
@ -51,9 +47,7 @@ namespace OpenSim.Region.Communications.Local
{
if (folder.parentID == LLUUID.Zero)
{
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
rootFolder = newfolder;
folderCallBack(userID, newfolder);
rootFolder = RequestInventoryFolder(userID, folder, folderCallBack, itemCallBack);
}
}
@ -63,14 +57,7 @@ namespace OpenSim.Region.Communications.Local
{
if (folder.folderID != rootFolder.folderID)
{
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
folderCallBack(userID, newfolder);
List<InventoryItemBase> items = RequestFolderItems(newfolder.folderID);
foreach (InventoryItemBase item in items)
{
itemCallBack(userID, item);
}
RequestInventoryFolder(userID, folder, folderCallBack, itemCallBack);
}
}
}
@ -90,5 +77,26 @@ namespace OpenSim.Region.Communications.Local
{
DeleteItem(item);
}
/// <summary>
/// Send the given inventory folder and its item contents back to the requester.
/// </summary>
/// <param name="userID"></param>
/// <param name="folder"></param>
private InventoryFolderImpl RequestInventoryFolder(LLUUID userID, InventoryFolderBase folder,
InventoryFolderInfo folderCallBack,
InventoryItemInfo itemCallBack)
{
InventoryFolderImpl newFolder = new InventoryFolderImpl(folder);
folderCallBack(userID, newFolder);
List<InventoryItemBase> items = RequestFolderItems(newFolder.folderID);
foreach (InventoryItemBase item in items)
{
itemCallBack(userID, item);
}
return newFolder;
}
}
}