From a228b5984e6523456871f2f8e51aa086050acbf2 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 14 Aug 2007 13:54:46 +0000 Subject: 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. --- .../Communications/Local/LocalInventoryService.cs | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 OpenSim/Region/Communications/Local/LocalInventoryService.cs (limited to 'OpenSim/Region/Communications/Local/LocalInventoryService.cs') 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 @@ +using System; +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; +using OpenSim.Framework.Types; +using OpenSim.Framework.UserManagement; +using OpenSim.Framework.Utilities; +using OpenSim.Framework.InventoryServiceBase; +using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; + +namespace OpenSim.Region.Communications.Local +{ + public class LocalInventoryService : InventoryServiceBase , IInventoryServices + { + + public LocalInventoryService() + { + + } + + public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) + { + List folders = this.RequestFirstLevelFolders(userID); + InventoryFolder rootFolder = null; + + //need to make sure we send root folder first + foreach (InventoryFolderBase folder in folders) + { + if (folder.parentID == libsecondlife.LLUUID.Zero) + { + InventoryFolder newfolder = new InventoryFolder(folder); + rootFolder = newfolder; + folderCallBack(userID, newfolder); + } + } + + if (rootFolder != null) + { + foreach (InventoryFolderBase folder in folders) + { + if (folder.folderID != rootFolder.folderID) + { + InventoryFolder newfolder = new InventoryFolder(folder); + folderCallBack(userID, newfolder); + } + } + } + } + } +} -- cgit v1.1