aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateUserData.cs31
1 files changed, 28 insertions, 3 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs
index 6a830f6..87594db 100644
--- a/OpenSim/Data/NHibernate/NHibernateUserData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs
@@ -244,16 +244,41 @@ namespace OpenSim.Data.NHibernate
244 public override bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) {return true;} 244 public override bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) {return true;}
245 public override bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory) {return true;} 245 public override bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory) {return true;}
246 246
247 /// Appearance 247 /// Appearance
248 /// TODO: stubs for now to get us to a compiling state gently 248 /// TODO: stubs for now to get us to a compiling state gently
249 override public UserAppearance GetUserAppearance(LLUUID user) 249 override public UserAppearance GetUserAppearance(LLUUID user)
250 { 250 {
251 return new UserAppearance(); 251 UserAppearance appearance;
252 // TODO: I'm sure I'll have to do something silly here
253 using(ISession session = factory.OpenSession()) {
254 appearance = session.Load(typeof(UserAppearance), user) as UserAppearance;
255 }
256 return appearance;
257 }
258
259 private bool ExistsAppearance(LLUUID uuid)
260 {
261 UserAppearance appearance;
262 using(ISession session = factory.OpenSession()) {
263 appearance = session.Load(typeof(UserAppearance), uuid) as UserAppearance;
264 }
265 return (appearance == null) ? false : true;
252 } 266 }
253 267
268
254 override public void UpdateUserAppearance(LLUUID user, UserAppearance appearance) 269 override public void UpdateUserAppearance(LLUUID user, UserAppearance appearance)
255 { 270 {
256 return; 271 bool exists = ExistsAppearance(user);
272 using(ISession session = factory.OpenSession()) {
273 using(ITransaction transaction = session.BeginTransaction()) {
274 if (exists) {
275 session.Update(appearance);
276 } else {
277 session.Save(appearance);
278 }
279 transaction.Commit();
280 }
281 }
257 } 282 }
258 283
259 override public void AddAttachment(LLUUID user, LLUUID item) 284 override public void AddAttachment(LLUUID user, LLUUID item)