diff options
author | Brian McBee | 2007-12-15 04:57:14 +0000 |
---|---|---|
committer | Brian McBee | 2007-12-15 04:57:14 +0000 |
commit | 8a8c89a0f32b528bd588715bdbfc875c852e7187 (patch) | |
tree | b46cb20d03dfdb21a5cbdfa514a8e745070a3713 /OpenSim/Framework/Communications | |
parent | Set svn:eol-style. Cleaned up set-eol-style.sh a bit. (diff) | |
download | opensim-SC-8a8c89a0f32b528bd588715bdbfc875c852e7187.zip opensim-SC-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.gz opensim-SC-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.bz2 opensim-SC-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.xz |
Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works.
Tested only in MYSQL, but may work in MSSQL and sqlite.
Probably not working in standalone mode.
Diffstat (limited to 'OpenSim/Framework/Communications')
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 | } |