mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
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:
@@ -44,19 +44,37 @@ namespace OpenSim.Services.InventoryService
|
||||
|
||||
public InventoryServiceBase(IConfigSource config) : base(config)
|
||||
{
|
||||
IConfig assetConfig = config.Configs["InventoryService"];
|
||||
if (assetConfig == null)
|
||||
string dllName = String.Empty;
|
||||
string connString = String.Empty;
|
||||
|
||||
//
|
||||
// Try reading the [DatabaseService] section first, if it exists
|
||||
//
|
||||
IConfig dbConfig = config.Configs["DatabaseService"];
|
||||
if (dbConfig != null)
|
||||
{
|
||||
dllName = dbConfig.GetString("StorageProvider", String.Empty);
|
||||
connString = dbConfig.GetString("ConnectionString", String.Empty);
|
||||
}
|
||||
else
|
||||
Console.WriteLine("------ dbConfig = null!");
|
||||
|
||||
//
|
||||
// Try reading the more specific [InventoryService] section, if it exists
|
||||
//
|
||||
IConfig inventoryConfig = config.Configs["InventoryService"];
|
||||
if (inventoryConfig != null)
|
||||
{
|
||||
dllName = inventoryConfig.GetString("StorageProvider", dllName);
|
||||
connString = inventoryConfig.GetString("ConnectionString", connString);
|
||||
}
|
||||
|
||||
//
|
||||
// We tried, but this doesn't exist. We can't proceed.
|
||||
//
|
||||
if (dllName.Equals(String.Empty))
|
||||
throw new Exception("No InventoryService configuration");
|
||||
|
||||
string dllName = assetConfig.GetString("StorageProvider",
|
||||
String.Empty);
|
||||
|
||||
if (dllName == String.Empty)
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
string connString = assetConfig.GetString("ConnectionString",
|
||||
String.Empty);
|
||||
|
||||
m_Database = LoadPlugin<IInventoryDataPlugin>(dllName);
|
||||
if (m_Database == null)
|
||||
throw new Exception("Could not find a storage interface in the given module");
|
||||
|
||||
Reference in New Issue
Block a user