From 6c9e588acbf1ccbac133074f9d56e679ad95143e Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 1 Dec 2007 19:57:23 +0000 Subject: [PATCH] On login, if a set of inventory folders doesn't exist for the user then a new set is created in the inventory database. Most likely still better to use some other script to populate the inventory database instead of relaying on this. --- OpenSim/Grid/InventoryServer/GridInventoryService.cs | 1 + OpenSim/Grid/UserServer/UserLoginService.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index dda2f6147f..6983259d55 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -63,6 +63,7 @@ namespace OpenSim.Grid.InventoryServer public bool CreateUsersInventory(LLUUID user) { + Console.WriteLine("Creating New Set of Inventory Folders for " + user.ToStringHyphenated()); CreateNewUserInventory(user); return true; } diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index d3164ade15..1df4d9ad4d 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -30,6 +30,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Net; +using System.Threading; using Nwc.XmlRpc; using libsecondlife; using OpenSim.Framework; @@ -197,7 +198,14 @@ namespace OpenSim.Grid.UserServer protected override InventoryData CreateInventoryData(LLUUID userID) { List folders = SyncRestObjectPoster.BeginPostObject>(m_config.InventoryUrl + "RootFolders/", userID); - if (folders.Count > 0) + if (folders ==null | folders.Count == 0) + { + RestObjectPoster.BeginPostObject(m_config.InventoryUrl + "CreateInventory/", userID); + Thread.Sleep(1000); + folders = SyncRestObjectPoster.BeginPostObject>(m_config.InventoryUrl + "RootFolders/", userID); + } + + if(folders.Count >0) { LLUUID rootID = LLUUID.Zero; ArrayList AgentInventoryArray = new ArrayList();