* Send a meaningful response to both the user server console and the client if a login fails because the inventory service has failed.
parent
331f26548b
commit
39165f3de4
|
@ -239,6 +239,19 @@ namespace OpenSim.Framework.UserManagement
|
||||||
"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()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
// Inventory Library Section
|
|
||||||
InventoryData inventData = GetInventorySkeleton(agentID);
|
|
||||||
ArrayList AgentInventoryArray = inventData.InventoryArray;
|
ArrayList AgentInventoryArray = inventData.InventoryArray;
|
||||||
|
|
||||||
Hashtable InventoryRootHash = new Hashtable();
|
Hashtable InventoryRootHash = new Hashtable();
|
||||||
|
@ -219,6 +231,19 @@ namespace OpenSim.Framework.UserManagement
|
||||||
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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue