aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/InventoryServiceBase.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2007-12-30 19:40:44 +0000
committerJustin Clarke Casey2007-12-30 19:40:44 +0000
commit76e74a7667867932ef08c0f402dcfc424fb51b0c (patch)
treede5dcfda31943fcf175bcd516bd645d3c95c23f9 /OpenSim/Framework/Communications/InventoryServiceBase.cs
parentAdded ScriptEngine.RemoteServer module (diff)
downloadopensim-SC_OLD-76e74a7667867932ef08c0f402dcfc424fb51b0c.zip
opensim-SC_OLD-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.gz
opensim-SC_OLD-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.bz2
opensim-SC_OLD-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.xz
Add an extra check that we don't create new inventory folders for a user that already has a root folder
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