From 863195612bdef56165f2b4354bab280c371618b9 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Sep 2007 14:57:43 +0000 Subject: Reverting back to 2017 since 2018 were causing Linux breakage; reopening Tleiades patch 444 and 445. --- .../Communications/Local/CommunicationsLocal.cs | 2 +- .../Communications/Local/LocalInventoryService.cs | 3 +- .../Communications/Local/LocalLoginService.cs | 51 +++++++++++++++++++++- .../Communications/Local/LocalUserServices.cs | 5 +-- 4 files changed, 53 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Communications/Local') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 7e08297..a00b35f 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.Local } else { - this.m_inventoryService.CreateNewUserInventory(LLUUID.Zero, userProf.UUID); + this.m_inventoryService.CreateNewUserInventory(userProf.UUID); Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); return userProf.UUID; } diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 5bd3277..53f6ffa 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -3,7 +3,6 @@ using libsecondlife; using OpenSim.Framework.Communications; using OpenSim.Framework.Data; using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; -using InventoryCategory = OpenSim.Framework.Data.InventoryCategory; namespace OpenSim.Region.Communications.Local { @@ -50,7 +49,7 @@ namespace OpenSim.Region.Communications.Local } } - public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) + public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) { this.AddFolder(folder); } diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 95fdf5a..ab8e397 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -7,6 +7,7 @@ using OpenSim.Framework.Data; using OpenSim.Framework.Types; using OpenSim.Framework.UserManagement; using OpenSim.Framework.Utilities; +using OpenSim.Framework.Inventory; namespace OpenSim.Region.Communications.Local { @@ -24,7 +25,7 @@ namespace OpenSim.Region.Communications.Local public event LoginToRegionEvent OnLoginToRegion; public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) - : base(userManager, parent.InventoryService, welcomeMess) + : base(userManager, welcomeMess) { m_Parent = parent; this.serversInfo = serversInfo; @@ -52,7 +53,7 @@ namespace OpenSim.Region.Communications.Local profile = this.m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { - m_Parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); + m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; @@ -122,5 +123,51 @@ namespace OpenSim.Region.Communications.Local } } + + protected override InventoryData CreateInventoryData(LLUUID userID) + { + List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); + if (folders.Count > 0) + { + LLUUID rootID = LLUUID.Zero; + ArrayList AgentInventoryArray = new ArrayList(); + Hashtable TempHash; + foreach (InventoryFolderBase InvFolder in folders) + { + if (InvFolder.parentID == LLUUID.Zero) + { + rootID = InvFolder.folderID; + } + TempHash = new Hashtable(); + TempHash["name"] = InvFolder.name; + TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated(); + TempHash["version"] = (Int32)InvFolder.version; + TempHash["type_default"] = (Int32)InvFolder.type; + TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated(); + AgentInventoryArray.Add(TempHash); + } + return new InventoryData(AgentInventoryArray, rootID); + } + else + { + AgentInventory userInventory = new AgentInventory(); + userInventory.CreateRootFolder(userID, false); + + ArrayList AgentInventoryArray = new ArrayList(); + Hashtable TempHash; + foreach (OpenSim.Framework.Inventory.InventoryFolder InvFolder in userInventory.InventoryFolders.Values) + { + TempHash = new Hashtable(); + TempHash["name"] = InvFolder.FolderName; + TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); + TempHash["version"] = (Int32)InvFolder.Version; + TempHash["type_default"] = (Int32)InvFolder.DefaultType; + TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); + AgentInventoryArray.Add(TempHash); + } + + return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); + } + } } } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 61b8633..3bc4301 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -1,5 +1,4 @@ using System; -using libsecondlife; using OpenSim.Framework.Communications; using OpenSim.Framework.Data; using OpenSim.Framework.Types; @@ -49,10 +48,10 @@ namespace OpenSim.Region.Communications.Local } else { - m_parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); + m_parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; } } -} +} \ No newline at end of file -- cgit v1.1