aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/InventoryServiceBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/InventoryServiceBase.cs')
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs26
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 098d08e..2f466a3 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -112,8 +112,10 @@ namespace OpenSim.Framework.Communications
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// 115 /// Get the root folder for a user
116 /// </summary> 116 /// </summary>
117 /// <param name="userID"></param>
118 /// <returns>null if no root folder was found</returns>
117 public InventoryFolderBase RequestUsersRoot(LLUUID userID) 119 public InventoryFolderBase RequestUsersRoot(LLUUID userID)
118 { 120 {
119 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 121 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
@@ -204,11 +206,27 @@ namespace OpenSim.Framework.Communications
204 } 206 }
205 } 207 }
206 208
209 /// <summary>
210 /// Create a new set of inventory folders for the given user.
211 /// </summary>
212 /// <param name="user"></param>
207 public void CreateNewUserInventory(LLUUID user) 213 public void CreateNewUserInventory(LLUUID user)
208 { 214 {
209 UsersInventory inven = new UsersInventory(); 215 InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
210 inven.CreateNewInventorySet(user); 216
211 AddNewInventorySet(inven); 217 if (null != existingRootFolder)
218 {
219 MainLog.Instance.Error(
220 "AGENTINVENTORY",
221 "Did not create a new inventory for user {0} since they already have "
222 + "a root inventory folder with id {1}", user, existingRootFolder);
223 }
224 else
225 {
226 UsersInventory inven = new UsersInventory();
227 inven.CreateNewInventorySet(user);
228 AddNewInventorySet(inven);
229 }
212 } 230 }
213 231
214 public class UsersInventory 232 public class UsersInventory