From 8143c597fc5f62ec0d931d2d5b887730e06aec04 Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 27 Sep 2007 13:25:45 +0000
Subject: * Tleiades grid mode inventory (#444) - thanx Tleiades! * updated
to rev 1413 on libsecondlife.dll and libsecondlife.dll.config (#423)
---
.../Communications/Cache/UserProfileCache.cs | 32 +++++++++++++++++++---
1 file changed, 28 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Framework/Communications/Cache/UserProfileCache.cs')
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 390b938..3dadf9c 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -35,10 +35,11 @@ using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Data;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Framework.Communications.Caches
{
- public class UserProfileCache
+ public class UserProfileCache : MarshalByRefObject
{
// Fields
private CommunicationsManager m_parent;
@@ -103,7 +104,7 @@ namespace OpenSim.Framework.Communications.Caches
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
if (info.RootFolder.folderID == parentID)
{
- InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
+ InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
if (createdFolder != null)
{
this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
@@ -114,7 +115,7 @@ namespace OpenSim.Framework.Communications.Caches
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
if (folder != null)
{
- folder.CreateNewSubFolder(folderID, folderName, folderType);
+ folder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
}
}
}
@@ -124,16 +125,21 @@ namespace OpenSim.Framework.Communications.Caches
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
{
InventoryFolder fold = null;
+
if (folderID == libraryRoot.folderID )
{
+ // we are looking for the root of the shared inventory
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
}
else if (( fold = libraryRoot.HasSubFolder(folderID)) != null)
{
+ // we are looking for a sub folder of the shared inventory
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems());
}
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
{
+ //if we get here, we are looking the inventory of an agent in this sim
+ //now we need to see if we already have the inventory cached
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
{
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
@@ -153,9 +159,23 @@ namespace OpenSim.Framework.Communications.Caches
}
}
}
+ else
+ {
+ //nope, inventory wasn't cached, so go to the inventory server and ask for the inventory
+ m_parent.InventoryService.RequestInventoryForUser(remoteClient.AgentId, ReceiveFolderInfo, ReceiveItemInfo);
+ }
}
}
+ public void ReceiveFolderInfo(LLUUID userID, InventoryFolderBase folderInfo)
+ {
+ }
+
+ public void ReceiveItemInfo(LLUUID userID, InventoryItemBase itemInfo)
+ {
+ }
+
+
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
{
if (ownerID == libraryRoot.agentID)
@@ -181,7 +201,7 @@ namespace OpenSim.Framework.Communications.Caches
///
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
{
- this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
+ this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
}
///
@@ -221,3 +241,7 @@ namespace OpenSim.Framework.Communications.Caches
}
}
+
+
+
+
--
cgit v1.1