123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
-
- using System;
- using System.Reflection;
- using Nini.Config;
- using OpenSim.Framework;
- using OpenSim.Data;
- using OpenSim.Services.Interfaces;
- using OpenSim.Services.Base;
- namespace OpenSim.Services.HypergridService
- {
- public class UserAgentServiceBase : ServiceBase
- {
- protected IHGTravelingData m_Database = null;
- public UserAgentServiceBase(IConfigSource config)
- : base(config)
- {
- string dllName = String.Empty;
- string connString = String.Empty;
- string realm = "hg_traveling_data";
-
-
-
- IConfig dbConfig = config.Configs["DatabaseService"];
- if (dbConfig != null)
- {
- if (dllName == String.Empty)
- dllName = dbConfig.GetString("StorageProvider", String.Empty);
- if (connString == String.Empty)
- connString = dbConfig.GetString("ConnectionString", String.Empty);
- }
-
-
-
- IConfig gridConfig = config.Configs["UserAgentService"];
- if (gridConfig != null)
- {
- dllName = gridConfig.GetString("StorageProvider", dllName);
- connString = gridConfig.GetString("ConnectionString", connString);
- realm = gridConfig.GetString("Realm", realm);
- }
-
-
-
- if (dllName.Equals(String.Empty))
- throw new Exception("No StorageProvider configured");
- m_Database = LoadPlugin<IHGTravelingData>(dllName, new Object[] { connString, realm });
- if (m_Database == null)
- throw new Exception("Could not find a storage interface in the given module");
- }
- }
- }
|