diff options
author | Justin Clark-Casey (justincc) | 2010-08-23 23:16:48 +0100 |
---|---|---|
committer | Diva Canto | 2010-08-24 17:22:08 -0700 |
commit | 269c9a11b7253413c0dc139b6ca0b76bd1c65b12 (patch) | |
tree | 28ef052c92d9b5b9981ffde09e302b51f81d2d84 /OpenSim/Services/InventoryService/XInventoryService.cs | |
parent | Remove various warnings and improve logging messages. No functional changes. (diff) | |
download | opensim-SC_OLD-269c9a11b7253413c0dc139b6ca0b76bd1c65b12.zip opensim-SC_OLD-269c9a11b7253413c0dc139b6ca0b76bd1c65b12.tar.gz opensim-SC_OLD-269c9a11b7253413c0dc139b6ca0b76bd1c65b12.tar.bz2 opensim-SC_OLD-269c9a11b7253413c0dc139b6ca0b76bd1c65b12.tar.xz |
Fix bug in llGiveInventory() where items were disappearing on relog
This was a regression - the code to look up the correct type folder was no longer being called if items were added without a parent folder set
This may have been broken since commit bd49985a on 2010-05-02
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 90a5c22..84306e7 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -219,12 +219,21 @@ namespace OpenSim.Services.InventoryService | |||
219 | 219 | ||
220 | public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 220 | public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) |
221 | { | 221 | { |
222 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); | ||
223 | |||
222 | XInventoryFolder[] folders = m_Database.GetFolders( | 224 | XInventoryFolder[] folders = m_Database.GetFolders( |
223 | new string[] { "agentID", "type"}, | 225 | new string[] { "agentID", "type"}, |
224 | new string[] { principalID.ToString(), ((int)type).ToString() }); | 226 | new string[] { principalID.ToString(), ((int)type).ToString() }); |
225 | 227 | ||
226 | if (folders.Length == 0) | 228 | if (folders.Length == 0) |
229 | { | ||
230 | // m_log.WarnFormat("[XINVENTORY SERVICE]: Found no folder for type {0} for user {1}", type, principalID); | ||
227 | return null; | 231 | return null; |
232 | } | ||
233 | |||
234 | // m_log.DebugFormat( | ||
235 | // "[XINVENTORY SERVICE]: Found folder {0} {1} for type {2} for user {3}", | ||
236 | // folders[0].folderName, folders[0].folderID, type, principalID); | ||
228 | 237 | ||
229 | return ConvertToOpenSim(folders[0]); | 238 | return ConvertToOpenSim(folders[0]); |
230 | } | 239 | } |
@@ -235,7 +244,7 @@ namespace OpenSim.Services.InventoryService | |||
235 | // connector. So we disregard the principal and look | 244 | // connector. So we disregard the principal and look |
236 | // by ID. | 245 | // by ID. |
237 | // | 246 | // |
238 | m_log.DebugFormat("[XINVENTORY]: Fetch contents for folder {0}", folderID.ToString()); | 247 | m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); |
239 | InventoryCollection inventory = new InventoryCollection(); | 248 | InventoryCollection inventory = new InventoryCollection(); |
240 | inventory.UserID = principalID; | 249 | inventory.UserID = principalID; |
241 | inventory.Folders = new List<InventoryFolderBase>(); | 250 | inventory.Folders = new List<InventoryFolderBase>(); |
@@ -354,6 +363,9 @@ namespace OpenSim.Services.InventoryService | |||
354 | 363 | ||
355 | public virtual bool AddItem(InventoryItemBase item) | 364 | public virtual bool AddItem(InventoryItemBase item) |
356 | { | 365 | { |
366 | // m_log.DebugFormat( | ||
367 | // "[XINVENTORY SERVICE]: Adding item {0} to folder {1} for {2}", item.ID, item.Folder, item.Owner); | ||
368 | |||
357 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 369 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
358 | } | 370 | } |
359 | 371 | ||