aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorSean Dague2008-04-10 13:53:06 +0000
committerSean Dague2008-04-10 13:53:06 +0000
commitc176caeb05c2264654b764e4d010561da60c24fc (patch)
tree87e0cab128ecaac57c5995df4cf5048185fe383f /OpenSim/Data
parent* Brings back map tile generation based on the terrain. The algorithm produc... (diff)
downloadopensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.zip
opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.gz
opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.bz2
opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.xz
moved fields to properties for UserDataProfile, which was
actually a little more work than I expected given the copious use of out params.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/DB4o/DB4oManager.cs12
-rw-r--r--OpenSim/Data/DB4o/DB4oUserData.cs8
-rw-r--r--OpenSim/Data/MSSQL/MSSQLManager.cs38
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserData.cs68
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs63
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs28
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs128
7 files changed, 180 insertions, 165 deletions
diff --git a/OpenSim/Data/DB4o/DB4oManager.cs b/OpenSim/Data/DB4o/DB4oManager.cs
index d9085c5..13bd61c 100644
--- a/OpenSim/Data/DB4o/DB4oManager.cs
+++ b/OpenSim/Data/DB4o/DB4oManager.cs
@@ -125,10 +125,10 @@ namespace OpenSim.Data.DB4o
125 IObjectSet result = database.Get(typeof (UserProfileData)); 125 IObjectSet result = database.Get(typeof (UserProfileData));
126 foreach (UserProfileData row in result) 126 foreach (UserProfileData row in result)
127 { 127 {
128 if (userProfiles.ContainsKey(row.UUID)) 128 if (userProfiles.ContainsKey(row.Id))
129 userProfiles[row.UUID] = row; 129 userProfiles[row.Id] = row;
130 else 130 else
131 userProfiles.Add(row.UUID, row); 131 userProfiles.Add(row.Id, row);
132 } 132 }
133 database.Close(); 133 database.Close();
134 } 134 }
@@ -145,13 +145,13 @@ namespace OpenSim.Data.DB4o
145 /// <returns>true on success, false on fail to persist to db</returns> 145 /// <returns>true on success, false on fail to persist to db</returns>
146 public bool UpdateRecord(UserProfileData record) 146 public bool UpdateRecord(UserProfileData record)
147 { 147 {
148 if (userProfiles.ContainsKey(record.UUID)) 148 if (userProfiles.ContainsKey(record.Id))
149 { 149 {
150 userProfiles[record.UUID] = record; 150 userProfiles[record.Id] = record;
151 } 151 }
152 else 152 else
153 { 153 {
154 userProfiles.Add(record.UUID, record); 154 userProfiles.Add(record.Id, record);
155 } 155 }
156 156
157 try 157 try
diff --git a/OpenSim/Data/DB4o/DB4oUserData.cs b/OpenSim/Data/DB4o/DB4oUserData.cs
index 62671e3..d0108ab 100644
--- a/OpenSim/Data/DB4o/DB4oUserData.cs
+++ b/OpenSim/Data/DB4o/DB4oUserData.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Data.DB4o
85 { 85 {
86 foreach (UserProfileData profile in manager.userProfiles.Values) 86 foreach (UserProfileData profile in manager.userProfiles.Values)
87 { 87 {
88 if (profile.username == fname && profile.surname == lname) 88 if (profile.FirstName == fname && profile.SurName == lname)
89 return profile; 89 return profile;
90 } 90 }
91 return null; 91 return null;
@@ -100,7 +100,7 @@ namespace OpenSim.Data.DB4o
100 { 100 {
101 try 101 try
102 { 102 {
103 return GetUserByUUID(uuid).currentAgent; 103 return GetUserByUUID(uuid).CurrentAgent;
104 } 104 }
105 catch (Exception) 105 catch (Exception)
106 { 106 {
@@ -128,7 +128,7 @@ namespace OpenSim.Data.DB4o
128 { 128 {
129 try 129 try
130 { 130 {
131 return GetUserByName(fname, lname).currentAgent; 131 return GetUserByName(fname, lname).CurrentAgent;
132 } 132 }
133 catch (Exception) 133 catch (Exception)
134 { 134 {
@@ -138,7 +138,7 @@ namespace OpenSim.Data.DB4o
138 public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 138 public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
139 { 139 {
140 UserProfileData user = GetUserByUUID(AgentID); 140 UserProfileData user = GetUserByUUID(AgentID);
141 user.webLoginKey = WebLoginKey; 141 user.WebLoginKey = WebLoginKey;
142 UpdateUserProfile(user); 142 UpdateUserProfile(user);
143 143
144 } 144 }
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs
index 5154092..e33468a 100644
--- a/OpenSim/Data/MSSQL/MSSQLManager.cs
+++ b/OpenSim/Data/MSSQL/MSSQLManager.cs
@@ -300,38 +300,38 @@ namespace OpenSim.Data.MSSQL
300 300
301 if (reader.Read()) 301 if (reader.Read())
302 { 302 {
303 retval.UUID = new LLUUID((string)reader["UUID"]); 303 retval.Id = new LLUUID((string)reader["UUID"]);
304 retval.username = (string)reader["username"]; 304 retval.FirstName = (string)reader["username"];
305 retval.surname = (string)reader["lastname"]; 305 retval.SurName = (string)reader["lastname"];
306 306
307 retval.passwordHash = (string)reader["passwordHash"]; 307 retval.PasswordHash = (string)reader["passwordHash"];
308 retval.passwordSalt = (string)reader["passwordSalt"]; 308 retval.PasswordSalt = (string)reader["passwordSalt"];
309 309
310 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); 310 retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
311 retval.homeLocation = new LLVector3( 311 retval.HomeLocation = new LLVector3(
312 Convert.ToSingle(reader["homeLocationX"].ToString()), 312 Convert.ToSingle(reader["homeLocationX"].ToString()),
313 Convert.ToSingle(reader["homeLocationY"].ToString()), 313 Convert.ToSingle(reader["homeLocationY"].ToString()),
314 Convert.ToSingle(reader["homeLocationZ"].ToString())); 314 Convert.ToSingle(reader["homeLocationZ"].ToString()));
315 retval.homeLookAt = new LLVector3( 315 retval.HomeLookAt = new LLVector3(
316 Convert.ToSingle(reader["homeLookAtX"].ToString()), 316 Convert.ToSingle(reader["homeLookAtX"].ToString()),
317 Convert.ToSingle(reader["homeLookAtY"].ToString()), 317 Convert.ToSingle(reader["homeLookAtY"].ToString()),
318 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 318 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
319 319
320 retval.created = Convert.ToInt32(reader["created"].ToString()); 320 retval.Created = Convert.ToInt32(reader["created"].ToString());
321 retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); 321 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
322 322
323 retval.userInventoryURI = (string)reader["userInventoryURI"]; 323 retval.UserInventoryURI = (string)reader["userInventoryURI"];
324 retval.userAssetURI = (string)reader["userAssetURI"]; 324 retval.UserAssetURI = (string)reader["userAssetURI"];
325 325
326 retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); 326 retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
327 retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); 327 retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
328 328
329 retval.profileAboutText = (string)reader["profileAboutText"]; 329 retval.ProfileAboutText = (string)reader["profileAboutText"];
330 retval.profileFirstText = (string)reader["profileFirstText"]; 330 retval.ProfileFirstText = (string)reader["profileFirstText"];
331 331
332 retval.profileImage = new LLUUID((string)reader["profileImage"]); 332 retval.ProfileImage = new LLUUID((string)reader["profileImage"]);
333 retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]); 333 retval.ProfileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
334 retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]); 334 retval.WebLoginKey = new LLUUID((string)reader["webLoginKey"]);
335 } 335 }
336 else 336 else
337 { 337 {
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs
index c045084..aae0095 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs
@@ -453,7 +453,7 @@ namespace OpenSim.Data.MSSQL
453 override public UserAgentData GetAgentByName(string user, string last) 453 override public UserAgentData GetAgentByName(string user, string last)
454 { 454 {
455 UserProfileData profile = GetUserByName(user, last); 455 UserProfileData profile = GetUserByName(user, last);
456 return GetAgentByUUID(profile.UUID); 456 return GetAgentByUUID(profile.Id);
457 } 457 }
458 458
459 /// <summary> 459 /// <summary>
@@ -491,7 +491,7 @@ namespace OpenSim.Data.MSSQL
491 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 491 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
492 { 492 {
493 UserProfileData user = GetUserByUUID(AgentID); 493 UserProfileData user = GetUserByUUID(AgentID);
494 user.webLoginKey = WebLoginKey; 494 user.WebLoginKey = WebLoginKey;
495 UpdateUserProfile(user); 495 UpdateUserProfile(user);
496 496
497 } 497 }
@@ -505,14 +505,14 @@ namespace OpenSim.Data.MSSQL
505 { 505 {
506 lock (database) 506 lock (database)
507 { 507 {
508 InsertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 508 InsertUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
509 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, 509 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
510 user.homeLocation.Z, 510 user.HomeLocation.Z,
511 user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, 511 user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
512 user.lastLogin, user.userInventoryURI, user.userAssetURI, 512 user.LastLogin, user.UserInventoryURI, user.UserAssetURI,
513 user.profileCanDoMask, user.profileWantDoMask, 513 user.ProfileCanDoMask, user.ProfileWantDoMask,
514 user.profileAboutText, user.profileFirstText, user.profileImage, 514 user.ProfileAboutText, user.ProfileFirstText, user.ProfileImage,
515 user.profileFirstImage, user.webLoginKey); 515 user.ProfileFirstImage, user.WebLoginKey);
516 } 516 }
517 } 517 }
518 catch (Exception e) 518 catch (Exception e)
@@ -651,30 +651,30 @@ namespace OpenSim.Data.MSSQL
651 "profileFirstImage = @profileFirstImage, " + 651 "profileFirstImage = @profileFirstImage, " +
652 "webLoginKey = @webLoginKey where " + 652 "webLoginKey = @webLoginKey where " +
653 "UUID = @keyUUUID;", database.getConnection()); 653 "UUID = @keyUUUID;", database.getConnection());
654 SqlParameter param1 = new SqlParameter("@uuid", user.UUID.ToString()); 654 SqlParameter param1 = new SqlParameter("@uuid", user.Id.ToString());
655 SqlParameter param2 = new SqlParameter("@username", user.username); 655 SqlParameter param2 = new SqlParameter("@username", user.FirstName);
656 SqlParameter param3 = new SqlParameter("@lastname", user.surname); 656 SqlParameter param3 = new SqlParameter("@lastname", user.SurName);
657 SqlParameter param4 = new SqlParameter("@passwordHash", user.passwordHash); 657 SqlParameter param4 = new SqlParameter("@passwordHash", user.PasswordHash);
658 SqlParameter param5 = new SqlParameter("@passwordSalt", user.passwordSalt); 658 SqlParameter param5 = new SqlParameter("@passwordSalt", user.PasswordSalt);
659 SqlParameter param6 = new SqlParameter("@homeRegion", Convert.ToInt64(user.homeRegion)); 659 SqlParameter param6 = new SqlParameter("@homeRegion", Convert.ToInt64(user.HomeRegion));
660 SqlParameter param7 = new SqlParameter("@homeLocationX", user.homeLocation.X); 660 SqlParameter param7 = new SqlParameter("@homeLocationX", user.HomeLocation.X);
661 SqlParameter param8 = new SqlParameter("@homeLocationY", user.homeLocation.Y); 661 SqlParameter param8 = new SqlParameter("@homeLocationY", user.HomeLocation.Y);
662 SqlParameter param9 = new SqlParameter("@homeLocationZ", user.homeLocation.Y); 662 SqlParameter param9 = new SqlParameter("@homeLocationZ", user.HomeLocation.Y);
663 SqlParameter param10 = new SqlParameter("@homeLookAtX", user.homeLookAt.X); 663 SqlParameter param10 = new SqlParameter("@homeLookAtX", user.HomeLookAt.X);
664 SqlParameter param11 = new SqlParameter("@homeLookAtY", user.homeLookAt.Y); 664 SqlParameter param11 = new SqlParameter("@homeLookAtY", user.HomeLookAt.Y);
665 SqlParameter param12 = new SqlParameter("@homeLookAtZ", user.homeLookAt.Z); 665 SqlParameter param12 = new SqlParameter("@homeLookAtZ", user.HomeLookAt.Z);
666 SqlParameter param13 = new SqlParameter("@created", Convert.ToInt32(user.created)); 666 SqlParameter param13 = new SqlParameter("@created", Convert.ToInt32(user.Created));
667 SqlParameter param14 = new SqlParameter("@lastLogin", Convert.ToInt32(user.lastLogin)); 667 SqlParameter param14 = new SqlParameter("@lastLogin", Convert.ToInt32(user.LastLogin));
668 SqlParameter param15 = new SqlParameter("@userInventoryURI", user.userInventoryURI); 668 SqlParameter param15 = new SqlParameter("@userInventoryURI", user.UserInventoryURI);
669 SqlParameter param16 = new SqlParameter("@userAssetURI", user.userAssetURI); 669 SqlParameter param16 = new SqlParameter("@userAssetURI", user.UserAssetURI);
670 SqlParameter param17 = new SqlParameter("@profileCanDoMask", Convert.ToInt32(user.profileCanDoMask)); 670 SqlParameter param17 = new SqlParameter("@profileCanDoMask", Convert.ToInt32(user.ProfileCanDoMask));
671 SqlParameter param18 = new SqlParameter("@profileWantDoMask", Convert.ToInt32(user.profileWantDoMask)); 671 SqlParameter param18 = new SqlParameter("@profileWantDoMask", Convert.ToInt32(user.ProfileWantDoMask));
672 SqlParameter param19 = new SqlParameter("@profileAboutText", user.profileAboutText); 672 SqlParameter param19 = new SqlParameter("@profileAboutText", user.ProfileAboutText);
673 SqlParameter param20 = new SqlParameter("@profileFirstText", user.profileFirstText); 673 SqlParameter param20 = new SqlParameter("@profileFirstText", user.ProfileFirstText);
674 SqlParameter param21 = new SqlParameter("@profileImage", user.profileImage.ToString()); 674 SqlParameter param21 = new SqlParameter("@profileImage", user.ProfileImage.ToString());
675 SqlParameter param22 = new SqlParameter("@profileFirstImage", user.profileFirstImage.ToString()); 675 SqlParameter param22 = new SqlParameter("@profileFirstImage", user.ProfileFirstImage.ToString());
676 SqlParameter param23 = new SqlParameter("@keyUUUID", user.UUID.ToString()); 676 SqlParameter param23 = new SqlParameter("@keyUUUID", user.Id.ToString());
677 SqlParameter param24 = new SqlParameter("@webLoginKey", user.webLoginKey.UUID.ToString()); 677 SqlParameter param24 = new SqlParameter("@webLoginKey", user.WebLoginKey.UUID.ToString());
678 command.Parameters.Add(param1); 678 command.Parameters.Add(param1);
679 command.Parameters.Add(param2); 679 command.Parameters.Add(param2);
680 command.Parameters.Add(param3); 680 command.Parameters.Add(param3);
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 0d36136..110f192 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -427,60 +427,71 @@ namespace OpenSim.Data.MySQL
427 427
428 if (reader.Read()) 428 if (reader.Read())
429 { 429 {
430 if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) 430 LLUUID id;
431 if (!LLUUID.TryParse((string)reader["UUID"], out id))
431 return null; 432 return null;
432 retval.username = (string) reader["username"];
433 retval.surname = (string) reader["lastname"];
434 433
435 retval.passwordHash = (string) reader["passwordHash"]; 434 retval.Id = id;
436 retval.passwordSalt = (string) reader["passwordSalt"]; 435 retval.FirstName = (string) reader["username"];
436 retval.SurName = (string) reader["lastname"];
437
438 retval.PasswordHash = (string) reader["passwordHash"];
439 retval.PasswordSalt = (string) reader["passwordSalt"];
437 440
438 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); 441 retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
439 retval.homeLocation = new LLVector3( 442 retval.HomeLocation = new LLVector3(
440 Convert.ToSingle(reader["homeLocationX"].ToString()), 443 Convert.ToSingle(reader["homeLocationX"].ToString()),
441 Convert.ToSingle(reader["homeLocationY"].ToString()), 444 Convert.ToSingle(reader["homeLocationY"].ToString()),
442 Convert.ToSingle(reader["homeLocationZ"].ToString())); 445 Convert.ToSingle(reader["homeLocationZ"].ToString()));
443 retval.homeLookAt = new LLVector3( 446 retval.HomeLookAt = new LLVector3(
444 Convert.ToSingle(reader["homeLookAtX"].ToString()), 447 Convert.ToSingle(reader["homeLookAtX"].ToString()),
445 Convert.ToSingle(reader["homeLookAtY"].ToString()), 448 Convert.ToSingle(reader["homeLookAtY"].ToString()),
446 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 449 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
447 450
448 retval.created = Convert.ToInt32(reader["created"].ToString()); 451 retval.Created = Convert.ToInt32(reader["created"].ToString());
449 retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); 452 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
450 453
451 retval.userInventoryURI = (string) reader["userInventoryURI"]; 454 retval.UserInventoryURI = (string) reader["userInventoryURI"];
452 retval.userAssetURI = (string) reader["userAssetURI"]; 455 retval.UserAssetURI = (string) reader["userAssetURI"];
453 456
454 retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); 457 retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
455 retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); 458 retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
456 459
457 if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) 460 if (reader.IsDBNull(reader.GetOrdinal("profileAboutText")))
458 retval.profileAboutText = ""; 461 retval.ProfileAboutText = "";
459 else 462 else
460 retval.profileAboutText = (string) reader["profileAboutText"]; 463 retval.ProfileAboutText = (string) reader["profileAboutText"];
461 464
462 if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) 465 if (reader.IsDBNull(reader.GetOrdinal("profileFirstText")))
463 retval.profileFirstText = ""; 466 retval.ProfileFirstText = "";
464 else 467 else
465 retval.profileFirstText = (string)reader["profileFirstText"]; 468 retval.ProfileFirstText = (string)reader["profileFirstText"];
466 469
467 if (reader.IsDBNull(reader.GetOrdinal("profileImage"))) 470 if (reader.IsDBNull(reader.GetOrdinal("profileImage")))
468 retval.profileImage = LLUUID.Zero; 471 retval.ProfileImage = LLUUID.Zero;
469 else 472 else {
470 LLUUID.TryParse((string)reader["profileImage"], out retval.profileImage); 473 LLUUID tmp;
474 LLUUID.TryParse((string)reader["profileImage"], out tmp);
475 retval.ProfileImage = tmp;
476 }
471 477
472 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage"))) 478 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage")))
473 retval.profileFirstImage = LLUUID.Zero; 479 retval.ProfileFirstImage = LLUUID.Zero;
474 else 480 else {
475 LLUUID.TryParse((string)reader["profileFirstImage"], out retval.profileFirstImage); 481 LLUUID tmp;
482 LLUUID.TryParse((string)reader["profileFirstImage"], out tmp);
483 retval.ProfileFirstImage = tmp;
484 }
476 485
477 if(reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) 486 if(reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
478 { 487 {
479 retval.webLoginKey = LLUUID.Zero; 488 retval.WebLoginKey = LLUUID.Zero;
480 } 489 }
481 else 490 else
482 { 491 {
483 LLUUID.TryParse((string)reader["webLoginKey"], out retval.webLoginKey); 492 LLUUID tmp;
493 LLUUID.TryParse((string)reader["webLoginKey"], out tmp);
494 retval.WebLoginKey = tmp;
484 } 495 }
485 } 496 }
486 else 497 else
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index bd094f6..5654207 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL
475 override public UserAgentData GetAgentByName(string user, string last) 475 override public UserAgentData GetAgentByName(string user, string last)
476 { 476 {
477 UserProfileData profile = GetUserByName(user, last); 477 UserProfileData profile = GetUserByName(user, last);
478 return GetAgentByUUID(profile.UUID); 478 return GetAgentByUUID(profile.Id);
479 } 479 }
480 480
481 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 481 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
@@ -547,14 +547,14 @@ namespace OpenSim.Data.MySQL
547 { 547 {
548 lock (database) 548 lock (database)
549 { 549 {
550 database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 550 database.insertUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
551 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, 551 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
552 user.homeLocation.Z, 552 user.HomeLocation.Z,
553 user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, 553 user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
554 user.lastLogin, user.userInventoryURI, user.userAssetURI, 554 user.LastLogin, user.UserInventoryURI, user.UserAssetURI,
555 user.profileCanDoMask, user.profileWantDoMask, 555 user.ProfileCanDoMask, user.ProfileWantDoMask,
556 user.profileAboutText, user.profileFirstText, user.profileImage, 556 user.ProfileAboutText, user.ProfileFirstText, user.ProfileImage,
557 user.profileFirstImage, user.webLoginKey); 557 user.ProfileFirstImage, user.WebLoginKey);
558 } 558 }
559 } 559 }
560 catch (Exception e) 560 catch (Exception e)
@@ -590,11 +590,11 @@ namespace OpenSim.Data.MySQL
590 /// <param name="user">The profile data to use to update the DB</param> 590 /// <param name="user">The profile data to use to update the DB</param>
591 override public bool UpdateUserProfile(UserProfileData user) 591 override public bool UpdateUserProfile(UserProfileData user)
592 { 592 {
593 database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 593 database.updateUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
594 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X, 594 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
595 user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, 595 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI,
596 user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText, 596 user.UserAssetURI, user.ProfileCanDoMask, user.ProfileWantDoMask, user.ProfileAboutText,
597 user.profileFirstText, user.profileImage, user.profileFirstImage, user.webLoginKey); 597 user.ProfileFirstText, user.ProfileImage, user.ProfileFirstImage, user.WebLoginKey);
598 return true; 598 return true;
599 } 599 }
600 600
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index ad3d1a4..e395565 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Data.SQLite
114 row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid)); 114 row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid));
115 if (row != null) 115 if (row != null)
116 { 116 {
117 user.currentAgent = buildUserAgent(row); 117 user.CurrentAgent = buildUserAgent(row);
118 } 118 }
119 return user; 119 return user;
120 } 120 }
@@ -135,10 +135,10 @@ namespace OpenSim.Data.SQLite
135 if (rows.Length > 0) 135 if (rows.Length > 0)
136 { 136 {
137 UserProfileData user = buildUserProfile(rows[0]); 137 UserProfileData user = buildUserProfile(rows[0]);
138 DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(user.UUID)); 138 DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(user.Id));
139 if (row != null) 139 if (row != null)
140 { 140 {
141 user.currentAgent = buildUserAgent(row); 141 user.CurrentAgent = buildUserAgent(row);
142 } 142 }
143 return user; 143 return user;
144 } 144 }
@@ -297,7 +297,7 @@ namespace OpenSim.Data.SQLite
297 { 297 {
298 try 298 try
299 { 299 {
300 return GetUserByUUID(uuid).currentAgent; 300 return GetUserByUUID(uuid).CurrentAgent;
301 } 301 }
302 catch (Exception) 302 catch (Exception)
303 { 303 {
@@ -325,7 +325,7 @@ namespace OpenSim.Data.SQLite
325 { 325 {
326 try 326 try
327 { 327 {
328 return GetUserByName(fname, lname).currentAgent; 328 return GetUserByName(fname, lname).CurrentAgent;
329 } 329 }
330 catch (Exception) 330 catch (Exception)
331 { 331 {
@@ -347,7 +347,7 @@ namespace OpenSim.Data.SQLite
347 else 347 else
348 { 348 {
349 UserProfileData user = GetUserByUUID(AgentID); 349 UserProfileData user = GetUserByUUID(AgentID);
350 user.webLoginKey = WebLoginKey; 350 user.WebLoginKey = WebLoginKey;
351 fillUserRow(row, user); 351 fillUserRow(row, user);
352 da.Update(ds, "users"); 352 da.Update(ds, "users");
353 353
@@ -365,7 +365,7 @@ namespace OpenSim.Data.SQLite
365 DataTable users = ds.Tables["users"]; 365 DataTable users = ds.Tables["users"];
366 lock (ds) 366 lock (ds)
367 { 367 {
368 DataRow row = users.Rows.Find(Util.ToRawUuidString(user.UUID)); 368 DataRow row = users.Rows.Find(Util.ToRawUuidString(user.Id));
369 if (row == null) 369 if (row == null)
370 { 370 {
371 row = users.NewRow(); 371 row = users.NewRow();
@@ -381,19 +381,19 @@ namespace OpenSim.Data.SQLite
381 // useragents table once the useragent is null 381 // useragents table once the useragent is null
382 // 382 //
383 // A database guy should look at this and figure out the best way to clear the useragents table. 383 // A database guy should look at this and figure out the best way to clear the useragents table.
384 if (user.currentAgent != null) 384 if (user.CurrentAgent != null)
385 { 385 {
386 DataTable ua = ds.Tables["useragents"]; 386 DataTable ua = ds.Tables["useragents"];
387 row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); 387 row = ua.Rows.Find(Util.ToRawUuidString(user.Id));
388 if (row == null) 388 if (row == null)
389 { 389 {
390 row = ua.NewRow(); 390 row = ua.NewRow();
391 fillUserAgentRow(row, user.currentAgent); 391 fillUserAgentRow(row, user.CurrentAgent);
392 ua.Rows.Add(row); 392 ua.Rows.Add(row);
393 } 393 }
394 else 394 else
395 { 395 {
396 fillUserAgentRow(row, user.currentAgent); 396 fillUserAgentRow(row, user.CurrentAgent);
397 } 397 }
398 } 398 }
399 else 399 else
@@ -401,7 +401,7 @@ namespace OpenSim.Data.SQLite
401 // I just added this to help the standalone login situation. 401 // I just added this to help the standalone login situation.
402 //It still needs to be looked at by a Database guy 402 //It still needs to be looked at by a Database guy
403 DataTable ua = ds.Tables["useragents"]; 403 DataTable ua = ds.Tables["useragents"];
404 row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); 404 row = ua.Rows.Find(Util.ToRawUuidString(user.Id));
405 405
406 if (row == null) 406 if (row == null)
407 { 407 {
@@ -591,70 +591,74 @@ namespace OpenSim.Data.SQLite
591 // interesting has to be done to actually get these values 591 // interesting has to be done to actually get these values
592 // back out. Not enough time to figure it out yet. 592 // back out. Not enough time to figure it out yet.
593 UserProfileData user = new UserProfileData(); 593 UserProfileData user = new UserProfileData();
594 LLUUID.TryParse((String)row["UUID"], out user.UUID); 594 LLUUID tmp;
595 user.username = (String) row["username"]; 595 LLUUID.TryParse((String)row["UUID"], out tmp);
596 user.surname = (String) row["surname"]; 596 user.Id = tmp;
597 user.passwordHash = (String) row["passwordHash"]; 597 user.FirstName = (String) row["username"];
598 user.passwordSalt = (String) row["passwordSalt"]; 598 user.SurName = (String) row["surname"];
599 599 user.PasswordHash = (String) row["passwordHash"];
600 user.homeRegionX = Convert.ToUInt32(row["homeRegionX"]); 600 user.PasswordSalt = (String) row["passwordSalt"];
601 user.homeRegionY = Convert.ToUInt32(row["homeRegionY"]); 601
602 user.homeLocation = new LLVector3( 602 user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]);
603 user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]);
604 user.HomeLocation = new LLVector3(
603 Convert.ToSingle(row["homeLocationX"]), 605 Convert.ToSingle(row["homeLocationX"]),
604 Convert.ToSingle(row["homeLocationY"]), 606 Convert.ToSingle(row["homeLocationY"]),
605 Convert.ToSingle(row["homeLocationZ"]) 607 Convert.ToSingle(row["homeLocationZ"])
606 ); 608 );
607 user.homeLookAt = new LLVector3( 609 user.HomeLookAt = new LLVector3(
608 Convert.ToSingle(row["homeLookAtX"]), 610 Convert.ToSingle(row["homeLookAtX"]),
609 Convert.ToSingle(row["homeLookAtY"]), 611 Convert.ToSingle(row["homeLookAtY"]),
610 Convert.ToSingle(row["homeLookAtZ"]) 612 Convert.ToSingle(row["homeLookAtZ"])
611 ); 613 );
612 user.created = Convert.ToInt32(row["created"]); 614 user.Created = Convert.ToInt32(row["created"]);
613 user.lastLogin = Convert.ToInt32(row["lastLogin"]); 615 user.LastLogin = Convert.ToInt32(row["lastLogin"]);
614 user.rootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]); 616 user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]);
615 user.userInventoryURI = (String) row["userInventoryURI"]; 617 user.UserInventoryURI = (String) row["userInventoryURI"];
616 user.userAssetURI = (String) row["userAssetURI"]; 618 user.UserAssetURI = (String) row["userAssetURI"];
617 user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); 619 user.ProfileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
618 user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]); 620 user.ProfileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
619 user.profileAboutText = (String) row["profileAboutText"]; 621 user.ProfileAboutText = (String) row["profileAboutText"];
620 user.profileFirstText = (String) row["profileFirstText"]; 622 user.ProfileFirstText = (String) row["profileFirstText"];
621 LLUUID.TryParse((String)row["profileImage"], out user.profileImage); 623 LLUUID.TryParse((String)row["profileImage"], out tmp);
622 LLUUID.TryParse((String)row["profileFirstImage"], out user.profileFirstImage); 624 user.ProfileImage = tmp;
623 user.webLoginKey = new LLUUID((String) row["webLoginKey"]); 625 LLUUID.TryParse((String)row["profileFirstImage"], out tmp);
626 user.ProfileFirstImage = tmp;
627 user.WebLoginKey = new LLUUID((String) row["webLoginKey"]);
624 628
625 return user; 629 return user;
626 } 630 }
627 631
628 private void fillUserRow(DataRow row, UserProfileData user) 632 private void fillUserRow(DataRow row, UserProfileData user)
629 { 633 {
630 row["UUID"] = Util.ToRawUuidString(user.UUID); 634 row["UUID"] = Util.ToRawUuidString(user.Id);
631 row["username"] = user.username; 635 row["username"] = user.FirstName;
632 row["surname"] = user.surname; 636 row["surname"] = user.SurName;
633 row["passwordHash"] = user.passwordHash; 637 row["passwordHash"] = user.PasswordHash;
634 row["passwordSalt"] = user.passwordSalt; 638 row["passwordSalt"] = user.PasswordSalt;
635 639
636 640
637 row["homeRegionX"] = user.homeRegionX; 641 row["homeRegionX"] = user.HomeRegionX;
638 row["homeRegionY"] = user.homeRegionY; 642 row["homeRegionY"] = user.HomeRegionY;
639 row["homeLocationX"] = user.homeLocation.X; 643 row["homeLocationX"] = user.HomeLocation.X;
640 row["homeLocationY"] = user.homeLocation.Y; 644 row["homeLocationY"] = user.HomeLocation.Y;
641 row["homeLocationZ"] = user.homeLocation.Z; 645 row["homeLocationZ"] = user.HomeLocation.Z;
642 row["homeLookAtX"] = user.homeLookAt.X; 646 row["homeLookAtX"] = user.HomeLookAt.X;
643 row["homeLookAtY"] = user.homeLookAt.Y; 647 row["homeLookAtY"] = user.HomeLookAt.Y;
644 row["homeLookAtZ"] = user.homeLookAt.Z; 648 row["homeLookAtZ"] = user.HomeLookAt.Z;
645 649
646 row["created"] = user.created; 650 row["created"] = user.Created;
647 row["lastLogin"] = user.lastLogin; 651 row["lastLogin"] = user.LastLogin;
648 row["rootInventoryFolderID"] = user.rootInventoryFolderID; 652 row["rootInventoryFolderID"] = user.RootInventoryFolderID;
649 row["userInventoryURI"] = user.userInventoryURI; 653 row["userInventoryURI"] = user.UserInventoryURI;
650 row["userAssetURI"] = user.userAssetURI; 654 row["userAssetURI"] = user.UserAssetURI;
651 row["profileCanDoMask"] = user.profileCanDoMask; 655 row["profileCanDoMask"] = user.ProfileCanDoMask;
652 row["profileWantDoMask"] = user.profileWantDoMask; 656 row["profileWantDoMask"] = user.ProfileWantDoMask;
653 row["profileAboutText"] = user.profileAboutText; 657 row["profileAboutText"] = user.ProfileAboutText;
654 row["profileFirstText"] = user.profileFirstText; 658 row["profileFirstText"] = user.ProfileFirstText;
655 row["profileImage"] = user.profileImage; 659 row["profileImage"] = user.ProfileImage;
656 row["profileFirstImage"] = user.profileFirstImage; 660 row["profileFirstImage"] = user.ProfileFirstImage;
657 row["webLoginKey"] = user.webLoginKey; 661 row["webLoginKey"] = user.WebLoginKey;
658 662
659 // ADO.NET doesn't handle NULL very well 663 // ADO.NET doesn't handle NULL very well
660 foreach (DataColumn col in ds.Tables["users"].Columns) 664 foreach (DataColumn col in ds.Tables["users"].Columns)