diff options
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalInventoryService.cs')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalInventoryService.cs | 139 |
1 files changed, 67 insertions, 72 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index b8f57f6..53f6ffa 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs | |||
@@ -1,72 +1,67 @@ | |||
1 | using System; | 1 | using System.Collections.Generic; |
2 | using System.Collections.Generic; | 2 | using libsecondlife; |
3 | using libsecondlife; | 3 | using OpenSim.Framework.Communications; |
4 | using OpenSim.Framework.Communications; | 4 | using OpenSim.Framework.Data; |
5 | using OpenSim.Framework.Data; | 5 | using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; |
6 | using OpenSim.Framework.Types; | 6 | |
7 | using OpenSim.Framework.UserManagement; | 7 | namespace OpenSim.Region.Communications.Local |
8 | using OpenSim.Framework.Utilities; | 8 | { |
9 | using OpenSim.Framework.InventoryServiceBase; | 9 | public class LocalInventoryService : InventoryServiceBase |
10 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; | 10 | { |
11 | 11 | ||
12 | namespace OpenSim.Region.Communications.Local | 12 | public LocalInventoryService() |
13 | { | 13 | { |
14 | public class LocalInventoryService : InventoryServiceBase , IInventoryServices | 14 | |
15 | { | 15 | } |
16 | 16 | ||
17 | public LocalInventoryService() | 17 | public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) |
18 | { | 18 | { |
19 | 19 | List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID); | |
20 | } | 20 | InventoryFolder rootFolder = null; |
21 | 21 | ||
22 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) | 22 | //need to make sure we send root folder first |
23 | { | 23 | foreach (InventoryFolderBase folder in folders) |
24 | List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID); | 24 | { |
25 | InventoryFolder rootFolder = null; | 25 | if (folder.parentID == libsecondlife.LLUUID.Zero) |
26 | 26 | { | |
27 | //need to make sure we send root folder first | 27 | InventoryFolder newfolder = new InventoryFolder(folder); |
28 | foreach (InventoryFolderBase folder in folders) | 28 | rootFolder = newfolder; |
29 | { | 29 | folderCallBack(userID, newfolder); |
30 | if (folder.parentID == libsecondlife.LLUUID.Zero) | 30 | } |
31 | { | 31 | } |
32 | InventoryFolder newfolder = new InventoryFolder(folder); | 32 | |
33 | rootFolder = newfolder; | 33 | if (rootFolder != null) |
34 | folderCallBack(userID, newfolder); | 34 | { |
35 | } | 35 | foreach (InventoryFolderBase folder in folders) |
36 | } | 36 | { |
37 | 37 | if (folder.folderID != rootFolder.folderID) | |
38 | if (rootFolder != null) | 38 | { |
39 | { | 39 | InventoryFolder newfolder = new InventoryFolder(folder); |
40 | foreach (InventoryFolderBase folder in folders) | 40 | folderCallBack(userID, newfolder); |
41 | { | 41 | |
42 | if (folder.folderID != rootFolder.folderID) | 42 | List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID); |
43 | { | 43 | foreach (InventoryItemBase item in items) |
44 | InventoryFolder newfolder = new InventoryFolder(folder); | 44 | { |
45 | folderCallBack(userID, newfolder); | 45 | itemCallBack(userID, item); |
46 | 46 | } | |
47 | List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID); | 47 | } |
48 | foreach (InventoryItemBase item in items) | 48 | } |
49 | { | 49 | } |
50 | itemCallBack(userID, item); | 50 | } |
51 | } | 51 | |
52 | } | 52 | public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) |
53 | } | 53 | { |
54 | } | 54 | this.AddFolder(folder); |
55 | } | 55 | } |
56 | 56 | ||
57 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | 57 | public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) |
58 | { | 58 | { |
59 | this.AddFolder(folder); | 59 | this.AddItem(item); |
60 | } | 60 | } |
61 | 61 | ||
62 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | 62 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
63 | { | 63 | { |
64 | this.AddItem(item); | 64 | this.deleteItem(item); |
65 | } | 65 | } |
66 | 66 | } | |
67 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 67 | } |
68 | { | ||
69 | this.deleteItem(item); | ||
70 | } | ||
71 | } | ||
72 | } | ||