* Send a meaningful response to both the user server console and the client if a login fails because the inventory service has failed.

0.6.0-stable
Justin Clarke Casey 2008-04-15 18:10:42 +00:00
parent 331f26548b
commit 39165f3de4
3 changed files with 43 additions and 13 deletions

View File

@ -238,6 +238,19 @@ namespace OpenSim.Framework.UserManagement
"Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.",
"false"); "false");
} }
/// <summary>
/// Response to indicate that login failed because the agent's inventory was not available.
/// </summary>
/// <returns></returns>
public XmlRpcResponse CreateLoginInventoryFailedResponse()
{
return GenerateFailureResponse(
"key",
"The agent inventory service is not responding. Please notify the grid operator if this is a grid sim,"
+ " or the sim operator if this is a standalone sim.",
"false");
}
public XmlRpcResponse CreateAlreadyLoggedInResponse() public XmlRpcResponse CreateAlreadyLoggedInResponse()
{ {

View File

@ -84,6 +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>
protected abstract InventoryData GetInventorySkeleton(LLUUID userID); protected abstract InventoryData GetInventorySkeleton(LLUUID userID);
/// <summary> /// <summary>
@ -208,9 +209,20 @@ namespace OpenSim.Framework.UserManagement
try try
{ {
LLUUID agentID = userProfile.ID; LLUUID agentID = userProfile.ID;
InventoryData inventData = null;
// Inventory Library Section
InventoryData inventData = GetInventorySkeleton(agentID); try
{
inventData = GetInventorySkeleton(agentID);
}
catch (System.Net.WebException e)
{
m_log.ErrorFormat(
"[LOGIN]: Error retrieving inventory skeleton of agent {0}, {1} - {2}", agentID, e.GetType(), e.Message);
return logResponse.CreateLoginInventoryFailedResponse();
}
ArrayList AgentInventoryArray = inventData.InventoryArray; ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable(); Hashtable InventoryRootHash = new Hashtable();
@ -218,7 +230,20 @@ namespace OpenSim.Framework.UserManagement
ArrayList InventoryRoot = new ArrayList(); ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash); InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID; userProfile.RootInventoryFolderID = inventData.RootFolderID;
// Inventory Library Section
Hashtable InventoryLibRootHash = new Hashtable();
InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
ArrayList InventoryLibRoot = new ArrayList();
InventoryLibRoot.Add(InventoryLibRootHash);
logResponse.InventoryLibRoot = InventoryLibRoot;
logResponse.InventoryLibraryOwner = GetLibraryOwner();
logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray;
logResponse.InventoryLibrary = GetInventoryLibrary();
// Circuit Code // Circuit Code
uint circode = (uint) (Util.RandomClass.Next()); uint circode = (uint) (Util.RandomClass.Next());
@ -227,17 +252,7 @@ namespace OpenSim.Framework.UserManagement
logResponse.AgentID = agentID.ToString(); logResponse.AgentID = agentID.ToString();
logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString(); logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString();
logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString(); logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString();
logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray;
logResponse.InventoryLibrary = GetInventoryLibrary();
Hashtable InventoryLibRootHash = new Hashtable();
InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
ArrayList InventoryLibRoot = new ArrayList();
InventoryLibRoot.Add(InventoryLibRootHash);
logResponse.InventoryLibRoot = InventoryLibRoot;
logResponse.InventoryLibraryOwner = GetLibraryOwner();
logResponse.CircuitCode = (Int32) circode; logResponse.CircuitCode = (Int32) circode;
//logResponse.RegionX = 0; //overwritten //logResponse.RegionX = 0; //overwritten
//logResponse.RegionY = 0; //overwritten //logResponse.RegionY = 0; //overwritten

View File

@ -302,6 +302,8 @@ namespace OpenSim.Grid.UserServer
// See LoginService // See LoginService
protected override InventoryData GetInventorySkeleton(LLUUID userID) protected override InventoryData GetInventorySkeleton(LLUUID userID)
{ {
m_log.InfoFormat("[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", 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);