diff options
Start of Inventory service, currently only (partially) functional in standalone mode and using sqlite).
In standalone mode, if you have account authenticate turned on (setting in opensim.ini) then when you create a new account, a set of inventory is created for that account and stored in database (currently only a set of empty folders). Then during login the database is search for that set and sent to the client in the login response.
More functions will be added soon, like creating new folders (and a bit later items) from the client inventory window.
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalInventoryService.cs')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalInventoryService.cs | 51 |
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using libsecondlife; | ||
4 | using OpenSim.Framework.Communications; | ||
5 | using OpenSim.Framework.Data; | ||
6 | using OpenSim.Framework.Types; | ||
7 | using OpenSim.Framework.UserManagement; | ||
8 | using OpenSim.Framework.Utilities; | ||
9 | using OpenSim.Framework.InventoryServiceBase; | ||
10 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; | ||
11 | |||
12 | namespace 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 | } | ||