diff options
author | Justin Clarke Casey | 2008-04-30 19:55:45 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-30 19:55:45 +0000 |
commit | 3984a7fda1c37d5aaec7f6c7d12ce2804a0c750e (patch) | |
tree | 70aa023ffc13f029dbb73bdb9831b9951ba8dcbc /OpenSim/Framework/Communications/Cache | |
parent | * Add a scratch implementation of the new inventory fields to the mssql datab... (diff) | |
download | opensim-SC-3984a7fda1c37d5aaec7f6c7d12ce2804a0c750e.zip opensim-SC-3984a7fda1c37d5aaec7f6c7d12ce2804a0c750e.tar.gz opensim-SC-3984a7fda1c37d5aaec7f6c7d12ce2804a0c750e.tar.bz2 opensim-SC-3984a7fda1c37d5aaec7f6c7d12ce2804a0c750e.tar.xz |
* Resolve mantis 1068, 1095
* The resolution takes the form of not crashing the session if the folder the user is attempting to add already exists (e.g. there is one already with the same UUID).
* Printing out warnings instead
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 41 |
2 files changed, 38 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index 5f532e0..f55f323 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs | |||
@@ -62,6 +62,13 @@ namespace OpenSim.Framework.Communications.Cache | |||
62 | { | 62 | { |
63 | } | 63 | } |
64 | 64 | ||
65 | /// <summary> | ||
66 | /// Create a new subfolder. This exists only in the cache. | ||
67 | /// </summary> | ||
68 | /// <param name="folderID"></param> | ||
69 | /// <param name="folderName"></param> | ||
70 | /// <param name="type"></param> | ||
71 | /// <returns>The newly created subfolder. Returns null if the folder already exists</returns> | ||
65 | public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) | 72 | public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) |
66 | { | 73 | { |
67 | lock (SubFolders) | 74 | lock (SubFolders) |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index ec06a23..4627f75 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -184,6 +184,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
184 | createdBaseFolder.Version = createdFolder.Version; | 184 | createdBaseFolder.Version = createdFolder.Version; |
185 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder); | 185 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder); |
186 | } | 186 | } |
187 | else | ||
188 | { | ||
189 | m_log.WarnFormat( | ||
190 | "[INVENTORY CACHE]: Tried to create folder {0} {1} for user {2} {3} but the folder already exists", | ||
191 | folderName, folderID, remoteClient.Name, remoteClient.AgentId); | ||
192 | } | ||
187 | } | 193 | } |
188 | else | 194 | else |
189 | { | 195 | { |
@@ -191,16 +197,31 @@ namespace OpenSim.Framework.Communications.Cache | |||
191 | if (folder != null) | 197 | if (folder != null) |
192 | { | 198 | { |
193 | InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType); | 199 | InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType); |
194 | 200 | ||
195 | InventoryFolderBase createdBaseFolder = new InventoryFolderBase(); | 201 | if (createdFolder != null) |
196 | createdBaseFolder.Owner = createdFolder.Owner; | 202 | { |
197 | createdBaseFolder.ID = createdFolder.ID; | 203 | InventoryFolderBase createdBaseFolder = new InventoryFolderBase(); |
198 | createdBaseFolder.Name = createdFolder.Name; | 204 | createdBaseFolder.Owner = createdFolder.Owner; |
199 | createdBaseFolder.ParentID = createdFolder.ParentID; | 205 | createdBaseFolder.ID = createdFolder.ID; |
200 | createdBaseFolder.Type = createdFolder.Type; | 206 | createdBaseFolder.Name = createdFolder.Name; |
201 | createdBaseFolder.Version = createdFolder.Version; | 207 | createdBaseFolder.ParentID = createdFolder.ParentID; |
202 | 208 | createdBaseFolder.Type = createdFolder.Type; | |
203 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder); | 209 | createdBaseFolder.Version = createdFolder.Version; |
210 | |||
211 | m_commsManager.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder); | ||
212 | } | ||
213 | else | ||
214 | { | ||
215 | m_log.WarnFormat( | ||
216 | "[INVENTORY CACHE]: Tried to create folder {0} {1} for user {2} {3} but the folder already exists", | ||
217 | folderName, folderID, remoteClient.Name, remoteClient.AgentId); | ||
218 | } | ||
219 | } | ||
220 | else | ||
221 | { | ||
222 | m_log.WarnFormat( | ||
223 | "[INVENTORY CACHE]: Could not find parent folder with id {0} in order to create folder {1} {2} for user {3} {4}", | ||
224 | parentID, folderName, folderID, remoteClient.Name, remoteClient.AgentId); | ||
204 | } | 225 | } |
205 | } | 226 | } |
206 | } | 227 | } |