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, 4 insertions, 28 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 3dadf9c..390b938 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -35,11 +35,10 @@ 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;
39 38
40namespace OpenSim.Framework.Communications.Caches 39namespace OpenSim.Framework.Communications.Caches
41{ 40{
42 public class UserProfileCache : MarshalByRefObject 41 public class UserProfileCache
43 { 42 {
44 // Fields 43 // Fields
45 private CommunicationsManager m_parent; 44 private CommunicationsManager m_parent;
@@ -104,7 +103,7 @@ namespace OpenSim.Framework.Communications.Caches
104 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 103 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
105 if (info.RootFolder.folderID == parentID) 104 if (info.RootFolder.folderID == parentID)
106 { 105 {
107 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User); 106 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
108 if (createdFolder != null) 107 if (createdFolder != null)
109 { 108 {
110 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); 109 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
@@ -115,7 +114,7 @@ namespace OpenSim.Framework.Communications.Caches
115 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); 114 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
116 if (folder != null) 115 if (folder != null)
117 { 116 {
118 folder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User); 117 folder.CreateNewSubFolder(folderID, folderName, folderType);
119 } 118 }
120 } 119 }
121 } 120 }
@@ -125,21 +124,16 @@ namespace OpenSim.Framework.Communications.Caches
125 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) 124 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
126 { 125 {
127 InventoryFolder fold = null; 126 InventoryFolder fold = null;
128
129 if (folderID == libraryRoot.folderID ) 127 if (folderID == libraryRoot.folderID )
130 { 128 {
131 // we are looking for the root of the shared inventory
132 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); 129 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
133 } 130 }
134 else if (( fold = libraryRoot.HasSubFolder(folderID)) != null) 131 else if (( fold = libraryRoot.HasSubFolder(folderID)) != null)
135 { 132 {
136 // we are looking for a sub folder of the shared inventory
137 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); 133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems());
138 } 134 }
139 else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) 135 else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
140 { 136 {
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
143 if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) 137 if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
144 { 138 {
145 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 139 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
@@ -159,23 +153,9 @@ namespace OpenSim.Framework.Communications.Caches
159 } 153 }
160 } 154 }
161 } 155 }
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 }
167 } 156 }
168 } 157 }
169 158
170 public void ReceiveFolderInfo(LLUUID userID, InventoryFolderBase folderInfo)
171 {
172 }
173
174 public void ReceiveItemInfo(LLUUID userID, InventoryItemBase itemInfo)
175 {
176 }
177
178
179 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) 159 public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
180 { 160 {
181 if (ownerID == libraryRoot.agentID) 161 if (ownerID == libraryRoot.agentID)
@@ -201,7 +181,7 @@ namespace OpenSim.Framework.Communications.Caches
201 /// <param name="userID"></param> 181 /// <param name="userID"></param>
202 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) 182 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
203 { 183 {
204 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); 184 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
205 } 185 }
206 186
207 /// <summary> 187 /// <summary>
@@ -241,7 +221,3 @@ namespace OpenSim.Framework.Communications.Caches
241 } 221 }
242} 222}
243 223
244
245
246
247