aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/InventoryServiceBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/InventoryService/InventoryServiceBase.cs')
-rw-r--r--OpenSim/Services/InventoryService/InventoryServiceBase.cs40
1 files changed, 29 insertions, 11 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryServiceBase.cs b/OpenSim/Services/InventoryService/InventoryServiceBase.cs
index 179d541..4526c34 100644
--- a/OpenSim/Services/InventoryService/InventoryServiceBase.cs
+++ b/OpenSim/Services/InventoryService/InventoryServiceBase.cs
@@ -44,19 +44,37 @@ namespace OpenSim.Services.InventoryService
44 44
45 public InventoryServiceBase(IConfigSource config) : base(config) 45 public InventoryServiceBase(IConfigSource config) : base(config)
46 { 46 {
47 IConfig assetConfig = config.Configs["InventoryService"]; 47 string dllName = String.Empty;
48 if (assetConfig == null) 48 string connString = String.Empty;
49
50 //
51 // Try reading the [DatabaseService] section first, if it exists
52 //
53 IConfig dbConfig = config.Configs["DatabaseService"];
54 if (dbConfig != null)
55 {
56 dllName = dbConfig.GetString("StorageProvider", String.Empty);
57 connString = dbConfig.GetString("ConnectionString", String.Empty);
58 }
59 else
60 Console.WriteLine("------ dbConfig = null!");
61
62 //
63 // Try reading the more specific [InventoryService] section, if it exists
64 //
65 IConfig inventoryConfig = config.Configs["InventoryService"];
66 if (inventoryConfig != null)
67 {
68 dllName = inventoryConfig.GetString("StorageProvider", dllName);
69 connString = inventoryConfig.GetString("ConnectionString", connString);
70 }
71
72 //
73 // We tried, but this doesn't exist. We can't proceed.
74 //
75 if (dllName.Equals(String.Empty))
49 throw new Exception("No InventoryService configuration"); 76 throw new Exception("No InventoryService configuration");
50 77
51 string dllName = assetConfig.GetString("StorageProvider",
52 String.Empty);
53
54 if (dllName == String.Empty)
55 throw new Exception("No StorageProvider configured");
56
57 string connString = assetConfig.GetString("ConnectionString",
58 String.Empty);
59
60 m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); 78 m_Database = LoadPlugin<IInventoryDataPlugin>(dllName);
61 if (m_Database == null) 79 if (m_Database == null)
62 throw new Exception("Could not find a storage interface in the given module"); 80 throw new Exception("Could not find a storage interface in the given module");