aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs32
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs1
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs20
4 files changed, 56 insertions, 7 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index c07a15b..1d2c920 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -142,5 +142,15 @@ namespace OpenSim.Framework.Communications.Cache
142 } 142 }
143 return itemList; 143 return itemList;
144 } 144 }
145
146 public List<InventoryFolderBase> RequestListOfFolders()
147 {
148 List<InventoryFolderBase> folderList = new List<InventoryFolderBase>();
149 foreach (InventoryFolderBase folder in SubFolders.Values)
150 {
151 folderList.Add(folder);
152 }
153 return folderList;
154 }
145 } 155 }
146} 156}
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 32d941c..bf7f5c1 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -147,6 +147,23 @@ namespace OpenSim.Framework.Communications.Cache
147 } 147 }
148 } 148 }
149 149
150 public void HandleMoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID, LLUUID parentID)
151 {
152 CachedUserInfo userProfile;
153
154 if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
155 {
156 if (userProfile.RootFolder != null)
157 {
158 InventoryFolderBase baseFolder = new InventoryFolderBase();
159 baseFolder.agentID = remoteClient.AgentId;
160 baseFolder.folderID = folderID;
161 baseFolder.parentID = parentID;
162 m_parent.InventoryService.MoveInventoryFolder(remoteClient.AgentId, baseFolder);
163 }
164 }
165 }
166
150 /// <summary> 167 /// <summary>
151 /// Tell the client about the various child items and folders contained in the requested folder. 168 /// Tell the client about the various child items and folders contained in the requested folder.
152 /// </summary> 169 /// </summary>
@@ -163,14 +180,15 @@ namespace OpenSim.Framework.Communications.Cache
163 if (folderID == libraryRoot.folderID) 180 if (folderID == libraryRoot.folderID)
164 { 181 {
165 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, 182 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID,
166 libraryRoot.RequestListOfItems(), libraryRoot.SubFoldersCount); 183 libraryRoot.RequestListOfItems(), libraryRoot.RequestListOfFolders(), libraryRoot.SubFoldersCount);
167 184
168 return; 185 return;
169 } 186 }
170 187
171 if ((fold = libraryRoot.HasSubFolder(folderID)) != null) 188 if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
172 { 189 {
173 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.SubFoldersCount); 190 System.Console.WriteLine("fetching librarysubfolder");
191 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount);
174 192
175 return; 193 return;
176 } 194 }
@@ -182,19 +200,19 @@ namespace OpenSim.Framework.Communications.Cache
182 { 200 {
183 if (userProfile.RootFolder.folderID == folderID) 201 if (userProfile.RootFolder.folderID == folderID)
184 { 202 {
203 System.Console.Write("fetching root folder");
185 if (fetchItems) 204 if (fetchItems)
186 { 205 {
187 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, 206 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID,
188 userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.SubFoldersCount); 207 userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.RequestListOfFolders(), userProfile.RootFolder.SubFoldersCount);
189 } 208 }
190 } 209 }
191 else 210 else
192 { 211 {
193 InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(folderID); 212 if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null)
194
195 if (fetchItems && folder != null)
196 { 213 {
197 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems(), folder.SubFoldersCount); 214 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount);
215 return;
198 } 216 }
199 } 217 }
200 } 218 }
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 191cdf2..9c493d4 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -40,6 +40,7 @@ namespace OpenSim.Framework.Communications
40 { 40 {
41 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 41 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
42 void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); 42 void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder);
43 void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder);
43 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 44 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
44 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 45 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
45 void CreateNewUserInventory(LLUUID user); 46 void CreateNewUserInventory(LLUUID user);
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 28b81d4..1e13031 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -130,6 +130,17 @@ namespace OpenSim.Framework.Communications
130 /// <summary> 130 /// <summary>
131 /// 131 ///
132 /// </summary> 132 /// </summary>
133 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder)
134 {
135 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
136 {
137 plugin.Value.moveInventoryFolder(folder);
138 }
139 }
140
141 /// <summary>
142 ///
143 /// </summary>
133 /// <param name="parentFolderID"></param> 144 /// <param name="parentFolderID"></param>
134 /// <returns></returns> 145 /// <returns></returns>
135 public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) 146 public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID)
@@ -161,6 +172,14 @@ namespace OpenSim.Framework.Communications
161 } 172 }
162 } 173 }
163 174
175 public void MoveFolder(InventoryFolderBase folder)
176 {
177 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
178 {
179 plugin.Value.moveInventoryFolder(folder);
180 }
181 }
182
164 public void AddItem(InventoryItemBase item) 183 public void AddItem(InventoryItemBase item)
165 { 184 {
166 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 185 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
@@ -251,6 +270,7 @@ namespace OpenSim.Framework.Communications
251 InventoryItemInfo itemCallBack); 270 InventoryItemInfo itemCallBack);
252 271
253 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); 272 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder);
273 public abstract void MoveExistingInventoryFolder(InventoryFolderBase folder);
254 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 274 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
255 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 275 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
256 } 276 }