Heart surgery no.2: the inventory service hooks.

Several improvements in the connectors themselves.
Several improvements in configurations.
Needed to add a hack in IUserService and UserManagerBase, to be removed when that service is refactored.
This commit is contained in:
diva
2009-06-10 13:18:32 +00:00
parent 8045ed28ec
commit 0f367bd7bb
34 changed files with 726 additions and 437 deletions

View File

@@ -37,6 +37,7 @@ using OpenMetaverse.StructuredData;
using OpenSim.Data;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Statistics;
using OpenSim.Services.Interfaces;
namespace OpenSim.Framework.Communications
{
@@ -54,6 +55,7 @@ namespace OpenSim.Framework.Communications
private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>();
protected CommunicationsManager m_commsManager;
protected IInventoryService m_InventoryService;
/// <summary>
/// Constructor
@@ -64,6 +66,11 @@ namespace OpenSim.Framework.Communications
m_commsManager = commsManager;
}
public virtual void SetInventoryService(IInventoryService invService)
{
m_InventoryService = invService;
}
/// <summary>
/// Add a new user data plugin - plugins will be requested in the order they were added.
/// </summary>
@@ -676,7 +683,24 @@ namespace OpenSim.Framework.Communications
}
else
{
m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
//
// WARNING: This is a horrible hack
// The purpose here is to avoid touching the user server at this point.
// There are dragons there that I can't deal with right now.
// diva 06/09/09
//
if (m_InventoryService != null)
{
// local service (standalone)
m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory");
m_InventoryService.CreateUserInventory(userProf.ID);
}
else
{
// used by the user server
m_log.Debug("[USERSTORAGE]: using m_commsManager.InterServiceInventoryService to create user's inventory");
m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
}
return userProf.ID;
}