diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateUserData.cs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 6ba2783..4de0291 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -64,20 +64,20 @@ namespace OpenSim.Data.NHibernate | |||
64 | 64 | ||
65 | // This is stubbing for now, it will become dynamic later and support different db backends | 65 | // This is stubbing for now, it will become dynamic later and support different db backends |
66 | cfg = new Configuration(); | 66 | cfg = new Configuration(); |
67 | cfg.SetProperty(Environment.ConnectionProvider, | 67 | cfg.SetProperty(Environment.ConnectionProvider, |
68 | "NHibernate.Connection.DriverConnectionProvider"); | 68 | "NHibernate.Connection.DriverConnectionProvider"); |
69 | cfg.SetProperty(Environment.Dialect, | 69 | cfg.SetProperty(Environment.Dialect, |
70 | "NHibernate.Dialect." + parts[0]); | 70 | "NHibernate.Dialect." + parts[0]); |
71 | cfg.SetProperty(Environment.ConnectionDriver, | 71 | cfg.SetProperty(Environment.ConnectionDriver, |
72 | "NHibernate.Driver." + parts[1]); | 72 | "NHibernate.Driver." + parts[1]); |
73 | cfg.SetProperty(Environment.ConnectionString, parts[2]); | 73 | cfg.SetProperty(Environment.ConnectionString, parts[2]); |
74 | cfg.AddAssembly("OpenSim.Data.NHibernate"); | 74 | cfg.AddAssembly("OpenSim.Data.NHibernate"); |
75 | 75 | ||
76 | HbmSerializer.Default.Validate = true; | 76 | HbmSerializer.Default.Validate = true; |
77 | using ( MemoryStream stream = | 77 | using ( MemoryStream stream = |
78 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) | 78 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) |
79 | cfg.AddInputStream(stream); | 79 | cfg.AddInputStream(stream); |
80 | 80 | ||
81 | // new SchemaExport(cfg).Create(true, true); | 81 | // new SchemaExport(cfg).Create(true, true); |
82 | 82 | ||
83 | factory = cfg.BuildSessionFactory(); | 83 | factory = cfg.BuildSessionFactory(); |
@@ -122,7 +122,7 @@ namespace OpenSim.Data.NHibernate | |||
122 | // BUG: CATCHALL IS BAD. | 122 | // BUG: CATCHALL IS BAD. |
123 | } | 123 | } |
124 | catch (Exception) {} | 124 | catch (Exception) {} |
125 | 125 | ||
126 | return (user != null); | 126 | return (user != null); |
127 | } | 127 | } |
128 | 128 | ||
@@ -151,7 +151,7 @@ namespace OpenSim.Data.NHibernate | |||
151 | // TODO: save agent | 151 | // TODO: save agent |
152 | transaction.Commit(); | 152 | transaction.Commit(); |
153 | } | 153 | } |
154 | } | 154 | } |
155 | } | 155 | } |
156 | else | 156 | else |
157 | { | 157 | { |
@@ -162,7 +162,7 @@ namespace OpenSim.Data.NHibernate | |||
162 | 162 | ||
163 | private static void SetAgentData(LLUUID uuid, UserAgentData agent, ISession session) | 163 | private static void SetAgentData(LLUUID uuid, UserAgentData agent, ISession session) |
164 | { | 164 | { |
165 | if (agent == null) | 165 | if (agent == null) |
166 | { | 166 | { |
167 | // TODO: got to figure out how to do a delete right | 167 | // TODO: got to figure out how to do a delete right |
168 | } | 168 | } |
@@ -178,7 +178,7 @@ namespace OpenSim.Data.NHibernate | |||
178 | session.Update(agent); | 178 | session.Update(agent); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | } | 182 | } |
183 | override public bool UpdateUserProfile(UserProfileData profile) | 183 | override public bool UpdateUserProfile(UserProfileData profile) |
184 | { | 184 | { |
@@ -193,7 +193,7 @@ namespace OpenSim.Data.NHibernate | |||
193 | transaction.Commit(); | 193 | transaction.Commit(); |
194 | return true; | 194 | return true; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | } | 197 | } |
198 | else | 198 | else |
199 | { | 199 | { |
@@ -202,7 +202,7 @@ namespace OpenSim.Data.NHibernate | |||
202 | return true; | 202 | return true; |
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | override public void AddNewUserAgent(UserAgentData agent) | 206 | override public void AddNewUserAgent(UserAgentData agent) |
207 | { | 207 | { |
208 | using (ISession session = factory.OpenSession()) | 208 | using (ISession session = factory.OpenSession()) |
@@ -212,9 +212,9 @@ namespace OpenSim.Data.NHibernate | |||
212 | session.Save(agent); | 212 | session.Save(agent); |
213 | transaction.Commit(); | 213 | transaction.Commit(); |
214 | } | 214 | } |
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | public void UpdateUserAgent(UserAgentData agent) | 218 | public void UpdateUserAgent(UserAgentData agent) |
219 | { | 219 | { |
220 | using (ISession session = factory.OpenSession()) | 220 | using (ISession session = factory.OpenSession()) |
@@ -224,7 +224,7 @@ namespace OpenSim.Data.NHibernate | |||
224 | session.Update(agent); | 224 | session.Update(agent); |
225 | transaction.Commit(); | 225 | transaction.Commit(); |
226 | } | 226 | } |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | override public UserAgentData GetAgentByUUID(LLUUID uuid) | 230 | override public UserAgentData GetAgentByUUID(LLUUID uuid) |
@@ -262,7 +262,7 @@ namespace OpenSim.Data.NHibernate | |||
262 | { | 262 | { |
263 | return GetUserByName(fname, lname).CurrentAgent; | 263 | return GetUserByName(fname, lname).CurrentAgent; |
264 | } | 264 | } |
265 | 265 | ||
266 | override public UserAgentData GetAgentByName(string name) | 266 | override public UserAgentData GetAgentByName(string name) |
267 | { | 267 | { |
268 | return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); | 268 | return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); |
@@ -273,7 +273,7 @@ namespace OpenSim.Data.NHibernate | |||
273 | List<AvatarPickerAvatar> results = new List<AvatarPickerAvatar>(); | 273 | List<AvatarPickerAvatar> results = new List<AvatarPickerAvatar>(); |
274 | string[] querysplit; | 274 | string[] querysplit; |
275 | querysplit = query.Split(' '); | 275 | querysplit = query.Split(' '); |
276 | 276 | ||
277 | if (querysplit.Length == 2) | 277 | if (querysplit.Length == 2) |
278 | { | 278 | { |
279 | using (ISession session = factory.OpenSession()) | 279 | using (ISession session = factory.OpenSession()) |
@@ -293,7 +293,7 @@ namespace OpenSim.Data.NHibernate | |||
293 | } | 293 | } |
294 | return results; | 294 | return results; |
295 | } | 295 | } |
296 | 296 | ||
297 | // TODO: actually implement these | 297 | // TODO: actually implement these |
298 | public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) {return;} | 298 | public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) {return;} |
299 | public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;} | 299 | public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;} |
@@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate | |||
306 | 306 | ||
307 | /// Appearance | 307 | /// Appearance |
308 | /// TODO: stubs for now to get us to a compiling state gently | 308 | /// TODO: stubs for now to get us to a compiling state gently |
309 | public AvatarAppearance GetUserAppearance(LLUUID user) | 309 | public AvatarAppearance GetUserAppearance(LLUUID user) |
310 | { | 310 | { |
311 | AvatarAppearance appearance; | 311 | AvatarAppearance appearance; |
312 | // TODO: I'm sure I'll have to do something silly here | 312 | // TODO: I'm sure I'll have to do something silly here |
@@ -345,19 +345,19 @@ namespace OpenSim.Data.NHibernate | |||
345 | } | 345 | } |
346 | transaction.Commit(); | 346 | transaction.Commit(); |
347 | } | 347 | } |
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | override public void AddAttachment(LLUUID user, LLUUID item) | 351 | override public void AddAttachment(LLUUID user, LLUUID item) |
352 | { | 352 | { |
353 | return; | 353 | return; |
354 | } | 354 | } |
355 | 355 | ||
356 | override public void RemoveAttachment(LLUUID user, LLUUID item) | 356 | override public void RemoveAttachment(LLUUID user, LLUUID item) |
357 | { | 357 | { |
358 | return; | 358 | return; |
359 | } | 359 | } |
360 | 360 | ||
361 | override public List<LLUUID> GetAttachments(LLUUID user) | 361 | override public List<LLUUID> GetAttachments(LLUUID user) |
362 | { | 362 | { |
363 | return new List<LLUUID>(); | 363 | return new List<LLUUID>(); |