Added AllowLoginWithoutInventory to LoginService, to be overwritten in subclasses. Default is false. HGLoginAuthService sets it true. Better error handling dealing with inventory service faults.

0.6.5-rc1
diva 2009-04-01 01:18:21 +00:00
parent f1e091c5f7
commit d4f6750f82
3 changed files with 41 additions and 15 deletions

View File

@ -324,5 +324,11 @@ namespace OpenSim.Framework.Communications.Services
m_regionsConnector.LogOffUserFromGrid(SimInfo.RegionHandle, theUser.ID, theUser.CurrentAgent.SecureSessionID, "Logging you off");
}
protected override bool AllowLoginWithoutInventory()
{
return true;
}
}
}

View File

@ -371,9 +371,12 @@ namespace OpenSim.Framework.Communications.Services
responseData["classified_categories"] = classifiedCategories;
responseData["ui-config"] = uiConfig;
responseData["inventory-skeleton"] = agentInventory;
if (agentInventory != null)
{
responseData["inventory-skeleton"] = agentInventory;
responseData["inventory-root"] = inventoryRoot;
}
responseData["inventory-skel-lib"] = inventoryLibrary;
responseData["inventory-root"] = inventoryRoot;
responseData["inventory-lib-root"] = inventoryLibRoot;
responseData["gestures"] = activeGestures;
responseData["inventory-lib-owner"] = inventoryLibraryOwner;
@ -386,8 +389,6 @@ namespace OpenSim.Framework.Communications.Services
responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize);
responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize);
//responseData["inventory-lib-root"] = new ArrayList(); // todo
if (m_buddyList != null)
{
responseData["buddy-list"] = m_buddyList.ToArray();

View File

@ -197,7 +197,7 @@ namespace OpenSim.Framework.Communications.Services
try
{
UUID agentID = userProfile.ID;
InventoryData inventData;
InventoryData inventData = null;
try
{
@ -209,16 +209,24 @@ namespace OpenSim.Framework.Communications.Services
"[LOGIN END]: Error retrieving inventory skeleton of agent {0} - {1}",
agentID, e);
return logResponse.CreateLoginInventoryFailedResponse();
// Let's not panic
if (!AllowLoginWithoutInventory())
return logResponse.CreateLoginInventoryFailedResponse();
}
ArrayList AgentInventoryArray = inventData.InventoryArray;
if (inventData != null)
{
ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID;
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID;
logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray;
}
// Inventory Library Section
Hashtable InventoryLibRootHash = new Hashtable();
@ -228,8 +236,6 @@ namespace OpenSim.Framework.Communications.Services
logResponse.InventoryLibRoot = InventoryLibRoot;
logResponse.InventoryLibraryOwner = GetLibraryOwner();
logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray;
logResponse.InventoryLibrary = GetInventoryLibrary();
logResponse.CircuitCode = Util.RandomClass.Next();
@ -1011,7 +1017,15 @@ namespace OpenSim.Framework.Communications.Services
/// </param>
protected void AddActiveGestures(LoginResponse response, UserProfileData theUser)
{
List<InventoryItemBase> gestures = m_inventoryService.GetActiveGestures(theUser.ID);
List<InventoryItemBase> gestures = null;
try
{
gestures = m_inventoryService.GetActiveGestures(theUser.ID);
}
catch (Exception e)
{
m_log.Debug("[LOGIN]: Unable to retrieve active gestures from inventory server. Reason: " + e.Message);
}
//m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
ArrayList list = new ArrayList();
if (gestures != null)
@ -1089,5 +1103,10 @@ namespace OpenSim.Framework.Communications.Services
return new InventoryData(AgentInventoryArray, rootID);
}
protected virtual bool AllowLoginWithoutInventory()
{
return false;
}
}
}