diff options
author | Diva Canto | 2015-05-07 19:24:08 -0700 |
---|---|---|
committer | Diva Canto | 2015-05-07 19:24:08 -0700 |
commit | c74cef0f4261191962959e42c7e349adafd42a04 (patch) | |
tree | 95ad098d2606b7d37a6b287816d9f6a02311860d /OpenSim/Services/InventoryService | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.zip opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.gz opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.bz2 opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.xz |
Major change in the way inventory is downloaded: added a method throughout IIventoryService that fetches sets of folders at once. Also added folder id in the InventoryCollection data structure, so that we don't need to go to inventory server again just for that. This reduces the chatter between sims and inventory server by... a lot. On my tests, this reduces initial inventory download down to 30% of what it currently is.
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 362ff8f..6582b75 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -291,7 +291,7 @@ namespace OpenSim.Services.InventoryService | |||
291 | // | 291 | // |
292 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); | 292 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); |
293 | InventoryCollection inventory = new InventoryCollection(); | 293 | InventoryCollection inventory = new InventoryCollection(); |
294 | inventory.UserID = principalID; | 294 | inventory.OwnerID = principalID; |
295 | inventory.Folders = new List<InventoryFolderBase>(); | 295 | inventory.Folders = new List<InventoryFolderBase>(); |
296 | inventory.Items = new List<InventoryItemBase>(); | 296 | inventory.Items = new List<InventoryItemBase>(); |
297 | 297 | ||
@@ -315,8 +315,27 @@ namespace OpenSim.Services.InventoryService | |||
315 | inventory.Items.Add(ConvertToOpenSim(i)); | 315 | inventory.Items.Add(ConvertToOpenSim(i)); |
316 | } | 316 | } |
317 | 317 | ||
318 | InventoryFolderBase f = new InventoryFolderBase(folderID, principalID); | ||
319 | f = GetFolder(f); | ||
320 | if (f != null) | ||
321 | { | ||
322 | inventory.Version = f.Version; | ||
323 | inventory.OwnerID = f.Owner; | ||
324 | } | ||
325 | inventory.FolderID = folderID; | ||
326 | |||
318 | return inventory; | 327 | return inventory; |
319 | } | 328 | } |
329 | |||
330 | public virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs) | ||
331 | { | ||
332 | InventoryCollection[] multiple = new InventoryCollection[folderIDs.Length]; | ||
333 | int i = 0; | ||
334 | foreach (UUID fid in folderIDs) | ||
335 | multiple[i++] = GetFolderContent(principalID, fid); | ||
336 | |||
337 | return multiple; | ||
338 | } | ||
320 | 339 | ||
321 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 340 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
322 | { | 341 | { |