diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index a3bc9f0..e71a2cc 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -303,9 +303,8 @@ namespace OpenSim.Grid.UserServer | |||
303 | protected override InventoryData GetInventorySkeleton(LLUUID userID) | 303 | protected override InventoryData GetInventorySkeleton(LLUUID userID) |
304 | { | 304 | { |
305 | m_log.DebugFormat( | 305 | m_log.DebugFormat( |
306 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", | 306 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", |
307 | m_config.InventoryUrl, userID); | 307 | m_config.InventoryUrl, userID); |
308 | |||
309 | 308 | ||
310 | List<InventoryFolderBase> folders | 309 | List<InventoryFolderBase> folders |
311 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 310 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( |
@@ -316,22 +315,27 @@ namespace OpenSim.Grid.UserServer | |||
316 | // which does. | 315 | // which does. |
317 | if (null == folders || folders.Count == 0) | 316 | if (null == folders || folders.Count == 0) |
318 | { | 317 | { |
319 | m_log.Warn( | 318 | m_log.InfoFormat( |
320 | "[LOGIN]: " + | 319 | "[LOGIN]: A root inventory folder for user {0} was not found. Requesting creation.", userID); |
321 | "root inventory folder user " + userID + " not found. Creating."); | ||
322 | |||
323 | RestObjectPoster.BeginPostObject<Guid>( | ||
324 | m_config.InventoryUrl + "CreateInventory/", userID.UUID); | ||
325 | 320 | ||
326 | // A big delay should be okay here since the recreation of the user's root folders should | 321 | bool created = |
327 | // only ever happen once. We need to sleep to let the inventory server do its work - | 322 | SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( |
328 | // previously 1000ms has been found to be too short. | 323 | "POST", m_config.InventoryUrl + "CreateInventory/", userID.UUID); |
329 | Thread.Sleep(10000); | 324 | |
325 | if (!created) | ||
326 | { | ||
327 | throw new Exception( | ||
328 | String.Format( | ||
329 | "The inventory creation request for user {0} did not succeed." | ||
330 | + " Please contact your inventory service provider for more information.", | ||
331 | userID)); | ||
332 | } | ||
333 | |||
330 | folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 334 | folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( |
331 | "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); | 335 | "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); |
332 | } | 336 | } |
333 | 337 | ||
334 | if (folders.Count > 0) | 338 | if (folders != null && folders.Count > 0) |
335 | { | 339 | { |
336 | LLUUID rootID = LLUUID.Zero; | 340 | LLUUID rootID = LLUUID.Zero; |
337 | ArrayList AgentInventoryArray = new ArrayList(); | 341 | ArrayList AgentInventoryArray = new ArrayList(); |
@@ -358,7 +362,8 @@ namespace OpenSim.Grid.UserServer | |||
358 | { | 362 | { |
359 | throw new Exception( | 363 | throw new Exception( |
360 | String.Format( | 364 | String.Format( |
361 | "A root inventory folder for {0} could not be retrieved from the inventory service", userID)); | 365 | "A root inventory folder for user {0} could not be retrieved from the inventory service", |
366 | userID)); | ||
362 | } | 367 | } |
363 | } | 368 | } |
364 | } | 369 | } |