diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index f38abd380d..feb0ccad7c 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications // See IInventoryServices public List GetInventorySkeleton(LLUUID userId) { - m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); +// m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); InventoryFolderBase rootFolder = RequestRootFolder(userId); @@ -87,9 +87,10 @@ namespace OpenSim.Framework.Communications if (null == rootFolder) { return null; - } + } + + List userFolders = new List(); - List userFolders = new List(); userFolders.Add(rootFolder); foreach (KeyValuePair plugin in m_plugins) diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 6d3a081fc3..7917118c29 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -299,7 +299,7 @@ namespace OpenSim.Grid.UserServer // In theory, the user will only ever be missing a root folder in situations where a grid // which didn't previously run a grid wide inventory server is being transitioned to one // which does. - if (null == folders | folders.Count == 0) + if (null == folders || folders.Count == 0) { m_log.Warn( "[LOGIN]: " + diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 3cea82db94..8583e6144e 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -217,47 +217,32 @@ namespace OpenSim.Region.Communications.Local { List folders = m_Parent.InventoryService.GetInventorySkeleton(userID); - if (folders.Count > 0) + // If we have user auth but no inventory folders for some reason, create a new set of folders. + if (null == folders || 0 == folders.Count) { - 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.ToString(); - TempHash["version"] = (Int32) InvFolder.version; - TempHash["type_default"] = (Int32) InvFolder.type; - TempHash["folder_id"] = InvFolder.folderID.ToString(); - AgentInventoryArray.Add(TempHash); - } - return new InventoryData(AgentInventoryArray, rootID); + m_Parent.InventoryService.CreateNewUserInventory(userID); + folders = m_Parent.InventoryService.GetInventorySkeleton(userID); } - else + + LLUUID rootID = LLUUID.Zero; + ArrayList AgentInventoryArray = new ArrayList(); + Hashtable TempHash; + foreach (InventoryFolderBase InvFolder in folders) { - AgentInventory userInventory = new AgentInventory(); - userInventory.CreateRootFolder(userID); - - ArrayList AgentInventoryArray = new ArrayList(); - Hashtable TempHash; - foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) + if (InvFolder.parentID == LLUUID.Zero) { - TempHash = new Hashtable(); - TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToString(); - TempHash["version"] = (Int32) InvFolder.Version; - TempHash["type_default"] = (Int32) InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToString(); - AgentInventoryArray.Add(TempHash); + rootID = InvFolder.folderID; } - - return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); + TempHash = new Hashtable(); + TempHash["name"] = InvFolder.name; + TempHash["parent_id"] = InvFolder.parentID.ToString(); + TempHash["version"] = (Int32) InvFolder.version; + TempHash["type_default"] = (Int32) InvFolder.type; + TempHash["folder_id"] = InvFolder.folderID.ToString(); + AgentInventoryArray.Add(TempHash); } + + return new InventoryData(AgentInventoryArray, rootID); } } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index fb4f02cfad..c0095936f3 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1208,6 +1208,8 @@ namespace OpenSim.Region.Environment.Scenes /// public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) { + m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); + List EntityList = GetEntities(); SceneObjectGroup originPrim = null;