The Library Service is now working. UserProfileCacheService.LibraryRoot is obsolete. Didn't delete it yet to avoid merge conflicts later -- want to stay out of core as much as possible.

This commit is contained in:
Diva Canto
2010-01-01 21:12:46 -08:00
parent ec53301e63
commit 8a9677a531
13 changed files with 421 additions and 58 deletions

View File

@@ -573,7 +573,9 @@ namespace OpenSim.Region.Framework.Scenes
"[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
InventoryItemBase item = CommsManager.UserProfileCacheService.LibraryRoot.FindItem(oldItemID);
InventoryItemBase item = null;
if (LibraryService != null && LibraryService.LibraryRootFolder != null)
item = LibraryService.LibraryRootFolder.FindItem(oldItemID);
if (item == null)
{
@@ -1211,9 +1213,9 @@ namespace OpenSim.Region.Framework.Scenes
item = InventoryService.GetItem(item);
// Try library
if (null == item)
if (null == item && LibraryService != null && LibraryService.LibraryRootFolder != null)
{
item = CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID);
item = LibraryService.LibraryRootFolder.FindItem(itemID);
}
if (item != null)
@@ -1280,9 +1282,9 @@ namespace OpenSim.Region.Framework.Scenes
// Try library
// XXX clumsy, possibly should be one call
if (null == item)
if (null == item && LibraryService != null && LibraryService.LibraryRootFolder != null)
{
item = CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID);
item = LibraryService.LibraryRootFolder.FindItem(itemID);
}
if (item != null)

View File

@@ -424,7 +424,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="ownerID"></param>
public void HandleFetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID)
{
if (ownerID == CommsManager.UserProfileCacheService.LibraryRoot.Owner)
if (LibraryService != null && LibraryService.LibraryRootFolder != null && ownerID == LibraryService.LibraryRootFolder.Owner)
{
//m_log.Debug("request info for library item");
return;
@@ -458,13 +458,14 @@ namespace OpenSim.Region.Framework.Scenes
// CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
// can be handled transparently).
InventoryFolderImpl fold = null;
if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(
fold.Owner, folderID, fold.RequestListOfItems(),
fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems);
return;
}
if (LibraryService != null && LibraryService.LibraryRootFolder != null)
if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(
fold.Owner, folderID, fold.RequestListOfItems(),
fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems);
return;
}
// We're going to send the reply async, because there may be
// an enormous quantity of packets -- basically the entire inventory!
@@ -512,15 +513,16 @@ namespace OpenSim.Region.Framework.Scenes
// CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
// can be handled transparently).
InventoryFolderImpl fold;
if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null)
{
version = 0;
InventoryCollection ret = new InventoryCollection();
ret.Folders = new List<InventoryFolderBase>();
ret.Items = fold.RequestListOfItems();
if (LibraryService != null && LibraryService.LibraryRootFolder != null)
if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
{
version = 0;
InventoryCollection ret = new InventoryCollection();
ret.Folders = new List<InventoryFolderBase>();
ret.Items = fold.RequestListOfItems();
return ret;
}
return ret;
}
InventoryCollection contents = new InventoryCollection();

View File

@@ -240,6 +240,19 @@ namespace OpenSim.Region.Framework.Scenes
}
}
protected ILibraryService m_LibraryService;
public ILibraryService LibraryService
{
get
{
if (m_LibraryService == null)
m_LibraryService = RequestModuleInterface<ILibraryService>();
return m_LibraryService;
}
}
protected IXMLRPC m_xmlrpcModule;
protected IWorldComm m_worldCommModule;
protected IAvatarFactory m_AvatarFactory;