diff options
author | Justin Clark-Casey (justincc) | 2010-08-23 23:16:48 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-08-23 23:16:48 +0100 |
commit | 704a53fb9bfeb945fa25f7367c631698dea5ae89 (patch) | |
tree | 532e4df3b07791e26f96d67be3f32614d9af052b /OpenSim/Region/CoreModules | |
parent | Remove various warnings and improve logging messages. No functional changes. (diff) | |
download | opensim-SC_OLD-704a53fb9bfeb945fa25f7367c631698dea5ae89.zip opensim-SC_OLD-704a53fb9bfeb945fa25f7367c631698dea5ae89.tar.gz opensim-SC_OLD-704a53fb9bfeb945fa25f7367c631698dea5ae89.tar.bz2 opensim-SC_OLD-704a53fb9bfeb945fa25f7367c631698dea5ae89.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 'OpenSim/Region/CoreModules')
2 files changed, 18 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 3de6e5c..350ad66 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -216,16 +216,28 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
216 | return m_InventoryService.PurgeFolder(folder); | 216 | return m_InventoryService.PurgeFolder(folder); |
217 | } | 217 | } |
218 | 218 | ||
219 | /// <summary> | ||
220 | /// Add a new item to the user's inventory | ||
221 | /// </summary> | ||
222 | /// <param name="item"></param> | ||
223 | /// <returns>true if the item was successfully added</returns> | ||
224 | public bool AddItem(InventoryItemBase item) | 219 | public bool AddItem(InventoryItemBase item) |
225 | { | 220 | { |
226 | m_log.DebugFormat( | 221 | m_log.DebugFormat( |
227 | "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", | 222 | "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", |
228 | item.Name, item.Owner, item.Folder); | 223 | item.Name, item.Owner, item.Folder); |
224 | |||
225 | if (UUID.Zero == item.Folder) | ||
226 | { | ||
227 | InventoryFolderBase f = m_InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType); | ||
228 | if (f != null) | ||
229 | { | ||
230 | item.Folder = f.ID; | ||
231 | } | ||
232 | else | ||
233 | { | ||
234 | f = m_InventoryService.GetRootFolder(item.Owner); | ||
235 | if (f != null) | ||
236 | item.Folder = f.ID; | ||
237 | else | ||
238 | return false; | ||
239 | } | ||
240 | } | ||
229 | 241 | ||
230 | return m_InventoryService.AddItem(item); | 242 | return m_InventoryService.AddItem(item); |
231 | } | 243 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index ada26cc..34205e3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -294,9 +294,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
294 | return m_RemoteConnector.GetAssetPermissions(userID, assetID); | 294 | return m_RemoteConnector.GetAssetPermissions(userID, assetID); |
295 | } | 295 | } |
296 | 296 | ||
297 | |||
298 | #endregion | 297 | #endregion |
299 | |||
300 | |||
301 | } | 298 | } |
302 | } | 299 | } \ No newline at end of file |