mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +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:
@@ -42,19 +42,35 @@ namespace OpenSim.Services.AssetService
|
||||
|
||||
public AssetServiceBase(IConfigSource config) : base(config)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
//
|
||||
// Try reading the more specific [AssetService] section, if it exists
|
||||
//
|
||||
IConfig assetConfig = config.Configs["AssetService"];
|
||||
if (assetConfig == null)
|
||||
throw new Exception("No AssetService configuration");
|
||||
if (assetConfig != null)
|
||||
{
|
||||
dllName = assetConfig.GetString("StorageProvider", dllName);
|
||||
connString = assetConfig.GetString("ConnectionString", connString);
|
||||
}
|
||||
|
||||
string dllName = assetConfig.GetString("StorageProvider",
|
||||
String.Empty);
|
||||
|
||||
if (dllName == String.Empty)
|
||||
//
|
||||
// We tried, but this doesn't exist. We can't proceed.
|
||||
//
|
||||
if (dllName.Equals(String.Empty))
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
string connString = assetConfig.GetString("ConnectionString",
|
||||
String.Empty);
|
||||
|
||||
m_Database = LoadPlugin<IAssetDataPlugin>(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