aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCache.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs32
1 files changed, 28 insertions, 4 deletions
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;
35using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37using OpenSim.Framework.Data; 37using OpenSim.Framework.Data;
38using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
38 39
39namespace OpenSim.Framework.Communications.Caches 40namespace OpenSim.Framework.Communications.Caches
40{ 41{
41 public class UserProfileCache 42 public class UserProfileCache : MarshalByRefObject
42 { 43 {
43 // Fields 44 // Fields
44 private CommunicationsManager m_parent; 45 private CommunicationsManager m_parent;
@@ -103,7 +104,7 @@ namespace OpenSim.Framework.Communications.Caches
103 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 104 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
104 if (info.RootFolder.folderID == parentID) 105 if (info.RootFolder.folderID == parentID)
105 { 106 {
106 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); 107 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
107 if (createdFolder != null) 108 if (createdFolder != null)
108 { 109 {
109 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); 110 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
@@ -114,7 +115,7 @@ namespace OpenSim.Framework.Communications.Caches
114 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); 115 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
115 if (folder != null) 116 if (folder != null)
116 { 117 {
117 folder.CreateNewSubFolder(folderID, folderName, folderType); 118 folder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
118 } 119 }
119 } 120 }
120 } 121 }
@@ -124,16 +125,21 @@ namespace OpenSim.Framework.Communications.Caches
124 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) 125 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
125 { 126 {
126 InventoryFolder fold = null; 127 InventoryFolder fold = null;
128
127 if (folderID == libraryRoot.folderID ) 129 if (folderID == libraryRoot.folderID )
128 { 130 {
131 // we are looking for the root of the shared inventory
129 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); 132 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
130 } 133 }
131 else if (( fold = libraryRoot.HasSubFolder(folderID)) != null) 134 else if (( fold = libraryRoot.HasSubFolder(folderID)) != null)
132 { 135 {
136 // we are looking for a sub folder of the shared inventory
133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); 137 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems());
134 } 138 }
135 else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) 139 else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
136 { 140 {
141 //if we get here, we are looking the inventory of an agent in this sim
142 //now we need to see if we already have the inventory cached
137 if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) 143 if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
138 { 144 {
139 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 145 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
@@ -153,9 +159,23 @@ namespace OpenSim.Framework.Communications.Caches
153 } 159 }
154 } 160 }
155 } 161 }
162 else
163 {
164 //nope, inventory wasn't cached, so go to the inventory server and ask for the inventory
165 m_parent.InventoryService.RequestInventoryForUser(remoteClient.AgentId, ReceiveFolderInfo, ReceiveItemInfo);
166 }
156 } 167 }
157 } 168 }
158 169
170 public void ReceiveFolderInfo(LLUUID userID, InventoryFolderBase folderInfo)
171 {
172 }
173
174 public void ReceiveItemInfo(LLUUID userID, InventoryItemBase itemInfo)
175 {
176 }
177
178
159 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) 179 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
160 { 180 {
161 if (ownerID == libraryRoot.agentID) 181 if (ownerID == libraryRoot.agentID)
@@ -181,7 +201,7 @@ namespace OpenSim.Framework.Communications.Caches
181 /// <param name="userID"></param> 201 /// <param name="userID"></param>
182 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) 202 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
183 { 203 {
184 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); 204 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
185 } 205 }
186 206
187 /// <summary> 207 /// <summary>
@@ -221,3 +241,7 @@ namespace OpenSim.Framework.Communications.Caches
221 } 241 }
222} 242}
223 243
244
245
246
247