aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AssetService/AssetServiceBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/AssetService/AssetServiceBase.cs')
-rw-r--r--OpenSim/Services/AssetService/AssetServiceBase.cs34
1 files changed, 25 insertions, 9 deletions
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
42 42
43 public AssetServiceBase(IConfigSource config) : base(config) 43 public AssetServiceBase(IConfigSource config) : base(config)
44 { 44 {
45 IConfig assetConfig = config.Configs["AssetService"]; 45 string dllName = String.Empty;
46 if (assetConfig == null) 46 string connString = String.Empty;
47 throw new Exception("No AssetService configuration");
48 47
49 string dllName = assetConfig.GetString("StorageProvider", 48 //
50 String.Empty); 49 // Try reading the [DatabaseService] section first, if it exists
50 //
51 IConfig dbConfig = config.Configs["DatabaseService"];
52 if (dbConfig != null)
53 {
54 dllName = dbConfig.GetString("StorageProvider", String.Empty);
55 connString = dbConfig.GetString("ConnectionString", String.Empty);
56 }
51 57
52 if (dllName == String.Empty) 58 //
53 throw new Exception("No StorageProvider configured"); 59 // Try reading the more specific [AssetService] section, if it exists
60 //
61 IConfig assetConfig = config.Configs["AssetService"];
62 if (assetConfig != null)
63 {
64 dllName = assetConfig.GetString("StorageProvider", dllName);
65 connString = assetConfig.GetString("ConnectionString", connString);
66 }
54 67
55 string connString = assetConfig.GetString("ConnectionString", 68 //
56 String.Empty); 69 // We tried, but this doesn't exist. We can't proceed.
70 //
71 if (dllName.Equals(String.Empty))
72 throw new Exception("No StorageProvider configured");
57 73
58 m_Database = LoadPlugin<IAssetDataPlugin>(dllName); 74 m_Database = LoadPlugin<IAssetDataPlugin>(dllName);
59 if (m_Database == null) 75 if (m_Database == null)