aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local/LocalInventoryService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalInventoryService.cs')
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
new file mode 100644
index 0000000..35c2c8c
--- /dev/null
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -0,0 +1,51 @@
1using System;
2using System.Collections.Generic;
3using libsecondlife;
4using OpenSim.Framework.Communications;
5using OpenSim.Framework.Data;
6using OpenSim.Framework.Types;
7using OpenSim.Framework.UserManagement;
8using OpenSim.Framework.Utilities;
9using OpenSim.Framework.InventoryServiceBase;
10using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
11
12namespace OpenSim.Region.Communications.Local
13{
14 public class LocalInventoryService : InventoryServiceBase , IInventoryServices
15 {
16
17 public LocalInventoryService()
18 {
19
20 }
21
22 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
23 {
24 List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID);
25 InventoryFolder rootFolder = null;
26
27 //need to make sure we send root folder first
28 foreach (InventoryFolderBase folder in folders)
29 {
30 if (folder.parentID == libsecondlife.LLUUID.Zero)
31 {
32 InventoryFolder newfolder = new InventoryFolder(folder);
33 rootFolder = newfolder;
34 folderCallBack(userID, newfolder);
35 }
36 }
37
38 if (rootFolder != null)
39 {
40 foreach (InventoryFolderBase folder in folders)
41 {
42 if (folder.folderID != rootFolder.folderID)
43 {
44 InventoryFolder newfolder = new InventoryFolder(folder);
45 folderCallBack(userID, newfolder);
46 }
47 }
48 }
49 }
50 }
51}