aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserService/UserServiceBase.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-08 14:08:41 +0000
committerMelanie Thielker2009-05-08 14:08:41 +0000
commitaec069d161e6d818c4b1d9b7448aebade62c29c5 (patch)
treed1a27527d0119b98d6fbf1255ad5cff7294524fe /OpenSim/Services/UserService/UserServiceBase.cs
parentnow that creatorID is no longer a strict UUID, and the column can still be NULL, (diff)
downloadopensim-SC_OLD-aec069d161e6d818c4b1d9b7448aebade62c29c5.zip
opensim-SC_OLD-aec069d161e6d818c4b1d9b7448aebade62c29c5.tar.gz
opensim-SC_OLD-aec069d161e6d818c4b1d9b7448aebade62c29c5.tar.bz2
opensim-SC_OLD-aec069d161e6d818c4b1d9b7448aebade62c29c5.tar.xz
More additions to the nextgen reference UGAIM
Diffstat (limited to 'OpenSim/Services/UserService/UserServiceBase.cs')
-rw-r--r--OpenSim/Services/UserService/UserServiceBase.cs37
1 files changed, 8 insertions, 29 deletions
diff --git a/OpenSim/Services/UserService/UserServiceBase.cs b/OpenSim/Services/UserService/UserServiceBase.cs
index 6a20670..0cf24a4 100644
--- a/OpenSim/Services/UserService/UserServiceBase.cs
+++ b/OpenSim/Services/UserService/UserServiceBase.cs
@@ -30,18 +30,19 @@ using System.Reflection;
30using Nini.Config; 30using Nini.Config;
31using OpenSim.Data; 31using OpenSim.Data;
32using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
33using OpenSim.Services.Base;
33 34
34namespace OpenSim.Services.UserService 35namespace OpenSim.Services.UserService
35{ 36{
36 public class UserServiceBase 37 public class UserServiceBase: ServiceBase
37 { 38 {
38 protected IUserDataPlugin m_Database = null; 39 protected IUserDataPlugin m_Database = null;
39 40
40 public UserServiceBase(IConfigSource config) 41 public UserServiceBase(IConfigSource config) : base(config)
41 { 42 {
42 IConfig userConfig = config.Configs["UserService"]; 43 IConfig userConfig = config.Configs["UserService"];
43 if (userConfig == null) 44 if (userConfig == null)
44 throw new Exception("No userService configuration"); 45 throw new Exception("No UserService configuration");
45 46
46 string dllName = userConfig.GetString("StorageProvider", 47 string dllName = userConfig.GetString("StorageProvider",
47 String.Empty); 48 String.Empty);
@@ -52,34 +53,12 @@ namespace OpenSim.Services.UserService
52 string connString = userConfig.GetString("ConnectionString", 53 string connString = userConfig.GetString("ConnectionString",
53 String.Empty); 54 String.Empty);
54 55
55 try 56 m_Database = LoadPlugin<IUserDataPlugin>(dllName);
56 {
57 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
58 57
59 foreach (Type pluginType in pluginAssembly.GetTypes()) 58 if (m_Database == null)
60 { 59 throw new Exception("Could not find a storage interface in the given module");
61 if (pluginType.IsPublic)
62 {
63 Type typeInterface =
64 pluginType.GetInterface("IUserDataPlugin", true);
65 if (typeInterface != null)
66 {
67 IUserDataPlugin plug =
68 (IUserDataPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
69 plug.Initialise(connString);
70 60
71 m_Database = plug; 61 m_Database.Initialise(connString);
72 }
73 }
74 }
75
76 if (m_Database == null)
77 throw new Exception("Could not find a storage interface in the given module");
78 }
79 catch (Exception e)
80 {
81 throw new Exception("Can't open database module: "+e.Message);
82 }
83 } 62 }
84 } 63 }
85} 64}