* On grid mode, if the inventory service is responding but returning an empty response to a whole agent inventory request, then post an inventory login failure message.

IMO, this is better than allowing the agent to login with an apparantly blank inventory.
0.6.0-stable
Justin Clarke Casey 2008-04-20 18:19:34 +00:00
parent 16275ca26d
commit d3cd2b0ae4
2 changed files with 6 additions and 22 deletions

View File

@ -84,7 +84,7 @@ namespace OpenSim.Framework.UserManagement
/// </summary> /// </summary>
/// <param name="userID"></param> /// <param name="userID"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref='System.Net.WebException'>This will be thrown if there is a problem with the inventory service</exception> /// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception>
protected abstract InventoryData GetInventorySkeleton(LLUUID userID); protected abstract InventoryData GetInventorySkeleton(LLUUID userID);
/// <summary> /// <summary>
@ -218,7 +218,7 @@ namespace OpenSim.Framework.UserManagement
{ {
inventData = GetInventorySkeleton(agentID); inventData = GetInventorySkeleton(agentID);
} }
catch (System.Net.WebException e) catch (Exception e)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[LOGIN END]: Error retrieving inventory skeleton of agent {0}, {1} - {2}", "[LOGIN END]: Error retrieving inventory skeleton of agent {0}, {1} - {2}",

View File

@ -306,6 +306,7 @@ namespace OpenSim.Grid.UserServer
"[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}",
m_config.InventoryUrl, userID); m_config.InventoryUrl, userID);
List<InventoryFolderBase> folders List<InventoryFolderBase> folders
= SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
"POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID);
@ -355,26 +356,9 @@ namespace OpenSim.Grid.UserServer
} }
else else
{ {
m_log.Warn("[LOGIN]: The root inventory folder could still not be retrieved" + throw new Exception(
" for user ID " + userID); String.Format(
"A root inventory folder for {0} could not be retrieved from the inventory service", userID));
AgentInventory userInventory = new AgentInventory();
userInventory.CreateRootFolder(userID);
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
{
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);
}
return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
} }
} }
} }