From 0f367bd7bbc5d22d4834e1eb0f1671381485143e Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 10 Jun 2009 13:18:32 +0000 Subject: 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. --- OpenSim/Services/AssetService/AssetServiceBase.cs | 34 +++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'OpenSim/Services/AssetService') diff --git a/OpenSim/Services/AssetService/AssetServiceBase.cs b/OpenSim/Services/AssetService/AssetServiceBase.cs index d5faffb..c42d469 100644 --- a/OpenSim/Services/AssetService/AssetServiceBase.cs +++ b/OpenSim/Services/AssetService/AssetServiceBase.cs @@ -42,18 +42,34 @@ namespace OpenSim.Services.AssetService public AssetServiceBase(IConfigSource config) : base(config) { - IConfig assetConfig = config.Configs["AssetService"]; - if (assetConfig == null) - throw new Exception("No AssetService configuration"); + string dllName = String.Empty; + string connString = String.Empty; - string dllName = assetConfig.GetString("StorageProvider", - 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); + } - if (dllName == String.Empty) - throw new Exception("No StorageProvider configured"); + // + // Try reading the more specific [AssetService] section, if it exists + // + IConfig assetConfig = config.Configs["AssetService"]; + if (assetConfig != null) + { + dllName = assetConfig.GetString("StorageProvider", dllName); + connString = assetConfig.GetString("ConnectionString", connString); + } - string connString = assetConfig.GetString("ConnectionString", - String.Empty); + // + // We tried, but this doesn't exist. We can't proceed. + // + if (dllName.Equals(String.Empty)) + throw new Exception("No StorageProvider configured"); m_Database = LoadPlugin(dllName); if (m_Database == null) -- cgit v1.1