aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
diff options
context:
space:
mode:
authorlbsa712008-03-28 19:58:45 +0000
committerlbsa712008-03-28 19:58:45 +0000
commitca718b6f8d5a76f4f4dcb6625c01c3ec15371bd6 (patch)
tree2115114e520a0ca0944e825e5928ab8a3dd310d0 /OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
parent* Send full inventory folder skeleton to standalone client logins rather than... (diff)
downloadopensim-SC-ca718b6f8d5a76f4f4dcb6625c01c3ec15371bd6.zip
opensim-SC-ca718b6f8d5a76f4f4dcb6625c01c3ec15371bd6.tar.gz
opensim-SC-ca718b6f8d5a76f4f4dcb6625c01c3ec15371bd6.tar.bz2
opensim-SC-ca718b6f8d5a76f4f4dcb6625c01c3ec15371bd6.tar.xz
* Introduced common abstract UserDataBase provider
* Weeded out multiple AvatarPickerAvatar classes
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs187
1 files changed, 86 insertions, 101 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index 4a582ac..2efd4aa 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.SQLite
37 /// <summary> 37 /// <summary>
38 /// A User storage interface for the SQLite database system 38 /// A User storage interface for the SQLite database system
39 /// </summary> 39 /// </summary>
40 public class SQLiteUserData : SQLiteUtil, IUserData 40 public class SQLiteUserData : UserDataBase
41 { 41 {
42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43 43
@@ -60,9 +60,9 @@ namespace OpenSim.Framework.Data.SQLite
60 private DataSet ds; 60 private DataSet ds;
61 private SqliteDataAdapter da; 61 private SqliteDataAdapter da;
62 private SqliteDataAdapter daf; 62 private SqliteDataAdapter daf;
63 SqliteConnection g_conn; 63 SqliteConnection g_conn;
64 64
65 public void Initialise() 65 override public void Initialise()
66 { 66 {
67 SqliteConnection conn = new SqliteConnection("URI=file:userprofiles.db,version=3"); 67 SqliteConnection conn = new SqliteConnection("URI=file:userprofiles.db,version=3");
68 TestTables(conn); 68 TestTables(conn);
@@ -102,7 +102,7 @@ namespace OpenSim.Framework.Data.SQLite
102 } 102 }
103 103
104 // see IUserData 104 // see IUserData
105 public UserProfileData GetUserByUUID(LLUUID uuid) 105 override public UserProfileData GetUserByUUID(LLUUID uuid)
106 { 106 {
107 lock (ds) 107 lock (ds)
108 { 108 {
@@ -125,7 +125,7 @@ namespace OpenSim.Framework.Data.SQLite
125 } 125 }
126 126
127 // see IUserData 127 // see IUserData
128 public UserProfileData GetUserByName(string fname, string lname) 128 override public UserProfileData GetUserByName(string fname, string lname)
129 { 129 {
130 string select = "surname = '" + lname + "' and username = '" + fname + "'"; 130 string select = "surname = '" + lname + "' and username = '" + fname + "'";
131 lock (ds) 131 lock (ds)
@@ -149,8 +149,8 @@ namespace OpenSim.Framework.Data.SQLite
149 } 149 }
150 150
151 #region User Friends List Data 151 #region User Friends List Data
152 152
153 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 153 override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
154 { 154 {
155 string InsertFriends = "insert into userfriends(ownerID, friendID, friendPerms) values(:ownerID, :friendID, :perms)"; 155 string InsertFriends = "insert into userfriends(ownerID, friendID, friendPerms) values(:ownerID, :friendID, :perms)";
156 156
@@ -169,8 +169,8 @@ namespace OpenSim.Framework.Data.SQLite
169 cmd.ExecuteNonQuery(); 169 cmd.ExecuteNonQuery();
170 } 170 }
171 } 171 }
172 172
173 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 173 override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
174 { 174 {
175 string DeletePerms = "delete from friendlist where (ownerID=:ownerID and friendID=:friendID) or (ownerID=:friendID and friendID=:ownerID)"; 175 string DeletePerms = "delete from friendlist where (ownerID=:ownerID and friendID=:friendID) or (ownerID=:friendID and friendID=:ownerID)";
176 using (SqliteCommand cmd = new SqliteCommand(DeletePerms, g_conn)) 176 using (SqliteCommand cmd = new SqliteCommand(DeletePerms, g_conn))
@@ -180,8 +180,8 @@ namespace OpenSim.Framework.Data.SQLite
180 cmd.ExecuteNonQuery(); 180 cmd.ExecuteNonQuery();
181 } 181 }
182 } 182 }
183 183
184 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 184 override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
185 { 185 {
186 string UpdatePerms = "update friendlist set perms=:perms where ownerID=:ownerID and friendID=:friendID"; 186 string UpdatePerms = "update friendlist set perms=:perms where ownerID=:ownerID and friendID=:friendID";
187 using (SqliteCommand cmd = new SqliteCommand(UpdatePerms, g_conn)) 187 using (SqliteCommand cmd = new SqliteCommand(UpdatePerms, g_conn))
@@ -193,7 +193,7 @@ namespace OpenSim.Framework.Data.SQLite
193 } 193 }
194 } 194 }
195 195
196 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 196 override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
197 { 197 {
198 List<FriendListItem> returnlist = new List<FriendListItem>(); 198 List<FriendListItem> returnlist = new List<FriendListItem>();
199 199
@@ -231,13 +231,13 @@ namespace OpenSim.Framework.Data.SQLite
231 231
232 #endregion 232 #endregion
233 233
234 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) 234 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
235 { 235 {
236 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); 236 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
237 } 237 }
238 238
239 239
240 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 240 override public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
241 { 241 {
242 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 242 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
243 string[] querysplit; 243 string[] querysplit;
@@ -292,7 +292,7 @@ namespace OpenSim.Framework.Data.SQLite
292 /// </summary> 292 /// </summary>
293 /// <param name="uuid">The user's account ID</param> 293 /// <param name="uuid">The user's account ID</param>
294 /// <returns>A matching user profile</returns> 294 /// <returns>A matching user profile</returns>
295 public UserAgentData GetAgentByUUID(LLUUID uuid) 295 override public UserAgentData GetAgentByUUID(LLUUID uuid)
296 { 296 {
297 try 297 try
298 { 298 {
@@ -309,7 +309,7 @@ namespace OpenSim.Framework.Data.SQLite
309 /// </summary> 309 /// </summary>
310 /// <param name="name">The account name</param> 310 /// <param name="name">The account name</param>
311 /// <returns>The user's session agent</returns> 311 /// <returns>The user's session agent</returns>
312 public UserAgentData GetAgentByName(string name) 312 override public UserAgentData GetAgentByName(string name)
313 { 313 {
314 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); 314 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
315 } 315 }
@@ -320,7 +320,7 @@ namespace OpenSim.Framework.Data.SQLite
320 /// <param name="fname">The first part of the user's account name</param> 320 /// <param name="fname">The first part of the user's account name</param>
321 /// <param name="lname">The second part of the user's account name</param> 321 /// <param name="lname">The second part of the user's account name</param>
322 /// <returns>A user agent</returns> 322 /// <returns>A user agent</returns>
323 public UserAgentData GetAgentByName(string fname, string lname) 323 override public UserAgentData GetAgentByName(string fname, string lname)
324 { 324 {
325 try 325 try
326 { 326 {
@@ -333,7 +333,7 @@ namespace OpenSim.Framework.Data.SQLite
333 } 333 }
334 334
335 335
336 public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 336 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
337 { 337 {
338 DataTable users = ds.Tables["users"]; 338 DataTable users = ds.Tables["users"];
339 lock (ds) 339 lock (ds)
@@ -359,7 +359,7 @@ namespace OpenSim.Framework.Data.SQLite
359 /// Creates a new user profile 359 /// Creates a new user profile
360 /// </summary> 360 /// </summary>
361 /// <param name="user">The profile to add to the database</param> 361 /// <param name="user">The profile to add to the database</param>
362 public void AddNewUserProfile(UserProfileData user) 362 override public void AddNewUserProfile(UserProfileData user)
363 { 363 {
364 DataTable users = ds.Tables["users"]; 364 DataTable users = ds.Tables["users"];
365 lock (ds) 365 lock (ds)
@@ -425,7 +425,7 @@ namespace OpenSim.Framework.Data.SQLite
425 /// </summary> 425 /// </summary>
426 /// <param name="user">The profile to add to the database</param> 426 /// <param name="user">The profile to add to the database</param>
427 /// <returns>True on success, false on error</returns> 427 /// <returns>True on success, false on error</returns>
428 public bool UpdateUserProfile(UserProfileData user) 428 override public bool UpdateUserProfile(UserProfileData user)
429 { 429 {
430 try 430 try
431 { 431 {
@@ -442,7 +442,7 @@ namespace OpenSim.Framework.Data.SQLite
442 /// Creates a new user agent 442 /// Creates a new user agent
443 /// </summary> 443 /// </summary>
444 /// <param name="agent">The agent to add to the database</param> 444 /// <param name="agent">The agent to add to the database</param>
445 public void AddNewUserAgent(UserAgentData agent) 445 override public void AddNewUserAgent(UserAgentData agent)
446 { 446 {
447 // Do nothing. yet. 447 // Do nothing. yet.
448 } 448 }
@@ -454,7 +454,7 @@ namespace OpenSim.Framework.Data.SQLite
454 /// <param name="to">End account</param> 454 /// <param name="to">End account</param>
455 /// <param name="amount">The amount to move</param> 455 /// <param name="amount">The amount to move</param>
456 /// <returns>Success?</returns> 456 /// <returns>Success?</returns>
457 public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) 457 override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
458 { 458 {
459 return true; 459 return true;
460 } 460 }
@@ -467,7 +467,7 @@ namespace OpenSim.Framework.Data.SQLite
467 /// <param name="to">Receivers account</param> 467 /// <param name="to">Receivers account</param>
468 /// <param name="item">Inventory item</param> 468 /// <param name="item">Inventory item</param>
469 /// <returns>Success?</returns> 469 /// <returns>Success?</returns>
470 public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) 470 override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
471 { 471 {
472 return true; 472 return true;
473 } 473 }
@@ -476,7 +476,7 @@ namespace OpenSim.Framework.Data.SQLite
476 /// Returns the name of the storage provider 476 /// Returns the name of the storage provider
477 /// </summary> 477 /// </summary>
478 /// <returns>Storage provider name</returns> 478 /// <returns>Storage provider name</returns>
479 public string getName() 479 override public string getName()
480 { 480 {
481 return "Sqlite Userdata"; 481 return "Sqlite Userdata";
482 } 482 }
@@ -485,7 +485,7 @@ namespace OpenSim.Framework.Data.SQLite
485 /// Returns the version of the storage provider 485 /// Returns the version of the storage provider
486 /// </summary> 486 /// </summary>
487 /// <returns>Storage provider version</returns> 487 /// <returns>Storage provider version</returns>
488 public string GetVersion() 488 override public string GetVersion()
489 { 489 {
490 return "0.1"; 490 return "0.1";
491 } 491 }
@@ -503,75 +503,75 @@ namespace OpenSim.Framework.Data.SQLite
503 * 503 *
504 **********************************************************************/ 504 **********************************************************************/
505 505
506 private DataTable createUsersTable() 506 private static DataTable createUsersTable()
507 { 507 {
508 DataTable users = new DataTable("users"); 508 DataTable users = new DataTable("users");
509 509
510 createCol(users, "UUID", typeof (String)); 510 SQLiteUtil.createCol(users, "UUID", typeof (String));
511 createCol(users, "username", typeof (String)); 511 SQLiteUtil.createCol(users, "username", typeof (String));
512 createCol(users, "surname", typeof (String)); 512 SQLiteUtil.createCol(users, "surname", typeof (String));
513 createCol(users, "passwordHash", typeof (String)); 513 SQLiteUtil.createCol(users, "passwordHash", typeof (String));
514 createCol(users, "passwordSalt", typeof (String)); 514 SQLiteUtil.createCol(users, "passwordSalt", typeof (String));
515 515
516 createCol(users, "homeRegionX", typeof (Int32)); 516 SQLiteUtil.createCol(users, "homeRegionX", typeof (Int32));
517 createCol(users, "homeRegionY", typeof (Int32)); 517 SQLiteUtil.createCol(users, "homeRegionY", typeof (Int32));
518 createCol(users, "homeLocationX", typeof (Double)); 518 SQLiteUtil.createCol(users, "homeLocationX", typeof (Double));
519 createCol(users, "homeLocationY", typeof (Double)); 519 SQLiteUtil.createCol(users, "homeLocationY", typeof (Double));
520 createCol(users, "homeLocationZ", typeof (Double)); 520 SQLiteUtil.createCol(users, "homeLocationZ", typeof (Double));
521 createCol(users, "homeLookAtX", typeof (Double)); 521 SQLiteUtil.createCol(users, "homeLookAtX", typeof (Double));
522 createCol(users, "homeLookAtY", typeof (Double)); 522 SQLiteUtil.createCol(users, "homeLookAtY", typeof (Double));
523 createCol(users, "homeLookAtZ", typeof (Double)); 523 SQLiteUtil.createCol(users, "homeLookAtZ", typeof (Double));
524 createCol(users, "created", typeof (Int32)); 524 SQLiteUtil.createCol(users, "created", typeof (Int32));
525 createCol(users, "lastLogin", typeof (Int32)); 525 SQLiteUtil.createCol(users, "lastLogin", typeof (Int32));
526 createCol(users, "rootInventoryFolderID", typeof (String)); 526 SQLiteUtil.createCol(users, "rootInventoryFolderID", typeof (String));
527 createCol(users, "userInventoryURI", typeof (String)); 527 SQLiteUtil.createCol(users, "userInventoryURI", typeof (String));
528 createCol(users, "userAssetURI", typeof (String)); 528 SQLiteUtil.createCol(users, "userAssetURI", typeof (String));
529 createCol(users, "profileCanDoMask", typeof (Int32)); 529 SQLiteUtil.createCol(users, "profileCanDoMask", typeof (Int32));
530 createCol(users, "profileWantDoMask", typeof (Int32)); 530 SQLiteUtil.createCol(users, "profileWantDoMask", typeof (Int32));
531 createCol(users, "profileAboutText", typeof (String)); 531 SQLiteUtil.createCol(users, "profileAboutText", typeof (String));
532 createCol(users, "profileFirstText", typeof (String)); 532 SQLiteUtil.createCol(users, "profileFirstText", typeof (String));
533 createCol(users, "profileImage", typeof (String)); 533 SQLiteUtil.createCol(users, "profileImage", typeof (String));
534 createCol(users, "profileFirstImage", typeof (String)); 534 SQLiteUtil.createCol(users, "profileFirstImage", typeof (String));
535 createCol(users, "webLoginKey", typeof(String)); 535 SQLiteUtil.createCol(users, "webLoginKey", typeof(String));
536 // Add in contraints 536 // Add in contraints
537 users.PrimaryKey = new DataColumn[] {users.Columns["UUID"]}; 537 users.PrimaryKey = new DataColumn[] {users.Columns["UUID"]};
538 return users; 538 return users;
539 } 539 }
540 540
541 private DataTable createUserAgentsTable() 541 private static DataTable createUserAgentsTable()
542 { 542 {
543 DataTable ua = new DataTable("useragents"); 543 DataTable ua = new DataTable("useragents");
544 // this is the UUID of the user 544 // this is the UUID of the user
545 createCol(ua, "UUID", typeof (String)); 545 SQLiteUtil.createCol(ua, "UUID", typeof (String));
546 createCol(ua, "agentIP", typeof (String)); 546 SQLiteUtil.createCol(ua, "agentIP", typeof (String));
547 createCol(ua, "agentPort", typeof (Int32)); 547 SQLiteUtil.createCol(ua, "agentPort", typeof (Int32));
548 createCol(ua, "agentOnline", typeof (Boolean)); 548 SQLiteUtil.createCol(ua, "agentOnline", typeof (Boolean));
549 createCol(ua, "sessionID", typeof (String)); 549 SQLiteUtil.createCol(ua, "sessionID", typeof (String));
550 createCol(ua, "secureSessionID", typeof (String)); 550 SQLiteUtil.createCol(ua, "secureSessionID", typeof (String));
551 createCol(ua, "regionID", typeof (String)); 551 SQLiteUtil.createCol(ua, "regionID", typeof (String));
552 createCol(ua, "loginTime", typeof (Int32)); 552 SQLiteUtil.createCol(ua, "loginTime", typeof (Int32));
553 createCol(ua, "logoutTime", typeof (Int32)); 553 SQLiteUtil.createCol(ua, "logoutTime", typeof (Int32));
554 createCol(ua, "currentRegion", typeof (String)); 554 SQLiteUtil.createCol(ua, "currentRegion", typeof (String));
555 createCol(ua, "currentHandle", typeof (String)); 555 SQLiteUtil.createCol(ua, "currentHandle", typeof (String));
556 // vectors 556 // vectors
557 createCol(ua, "currentPosX", typeof (Double)); 557 SQLiteUtil.createCol(ua, "currentPosX", typeof (Double));
558 createCol(ua, "currentPosY", typeof (Double)); 558 SQLiteUtil.createCol(ua, "currentPosY", typeof (Double));
559 createCol(ua, "currentPosZ", typeof (Double)); 559 SQLiteUtil.createCol(ua, "currentPosZ", typeof (Double));
560 // constraints 560 // constraints
561 ua.PrimaryKey = new DataColumn[] {ua.Columns["UUID"]}; 561 ua.PrimaryKey = new DataColumn[] {ua.Columns["UUID"]};
562 562
563 return ua; 563 return ua;
564 } 564 }
565 565
566 private DataTable createUserFriendsTable() 566 private static DataTable createUserFriendsTable()
567 { 567 {
568 DataTable ua = new DataTable("userfriends"); 568 DataTable ua = new DataTable("userfriends");
569 // table contains user <----> user relationship with perms 569 // table contains user <----> user relationship with perms
570 createCol(ua, "ownerID", typeof(String)); 570 SQLiteUtil.createCol(ua, "ownerID", typeof(String));
571 createCol(ua, "friendID", typeof(String)); 571 SQLiteUtil.createCol(ua, "friendID", typeof(String));
572 createCol(ua, "friendPerms", typeof(Int32)); 572 SQLiteUtil.createCol(ua, "friendPerms", typeof(Int32));
573 createCol(ua, "ownerPerms", typeof(Int32)); 573 SQLiteUtil.createCol(ua, "ownerPerms", typeof(Int32));
574 createCol(ua, "datetimestamp", typeof(Int32)); 574 SQLiteUtil.createCol(ua, "datetimestamp", typeof(Int32));
575 575
576 return ua; 576 return ua;
577 } 577 }
@@ -583,8 +583,8 @@ namespace OpenSim.Framework.Data.SQLite
583 * These should be database independant 583 * These should be database independant
584 * 584 *
585 **********************************************************************/ 585 **********************************************************************/
586 586
587 private UserProfileData buildUserProfile(DataRow row) 587 private static UserProfileData buildUserProfile(DataRow row)
588 { 588 {
589 // TODO: this doesn't work yet because something more 589 // TODO: this doesn't work yet because something more
590 // interesting has to be done to actually get these values 590 // interesting has to be done to actually get these values
@@ -624,21 +624,6 @@ namespace OpenSim.Framework.Data.SQLite
624 return user; 624 return user;
625 } 625 }
626 626
627// TODO: unused
628// private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms)
629// {
630// row["ownerID"] = ownerID.UUID.ToString();
631// row["friendID"] = friendID.UUID.ToString();
632// row["friendPerms"] = perms;
633// foreach (DataColumn col in ds.Tables["userfriends"].Columns)
634// {
635// if (row[col] == null)
636// {
637// row[col] = String.Empty;
638// }
639// }
640// }
641
642 private void fillUserRow(DataRow row, UserProfileData user) 627 private void fillUserRow(DataRow row, UserProfileData user)
643 { 628 {
644 row["UUID"] = Util.ToRawUuidString(user.UUID); 629 row["UUID"] = Util.ToRawUuidString(user.UUID);
@@ -680,7 +665,7 @@ namespace OpenSim.Framework.Data.SQLite
680 } 665 }
681 } 666 }
682 667
683 private UserAgentData buildUserAgent(DataRow row) 668 private static UserAgentData buildUserAgent(DataRow row)
684 { 669 {
685 UserAgentData ua = new UserAgentData(); 670 UserAgentData ua = new UserAgentData();
686 671
@@ -703,7 +688,7 @@ namespace OpenSim.Framework.Data.SQLite
703 return ua; 688 return ua;
704 } 689 }
705 690
706 private void fillUserAgentRow(DataRow row, UserAgentData ua) 691 private static void fillUserAgentRow(DataRow row, UserAgentData ua)
707 { 692 {
708 row["UUID"] = ua.UUID; 693 row["UUID"] = ua.UUID;
709 row["agentIP"] = ua.agentIP; 694 row["agentIP"] = ua.agentIP;
@@ -733,29 +718,29 @@ namespace OpenSim.Framework.Data.SQLite
733 718
734 private void setupUserCommands(SqliteDataAdapter da, SqliteConnection conn) 719 private void setupUserCommands(SqliteDataAdapter da, SqliteConnection conn)
735 { 720 {
736 da.InsertCommand = createInsertCommand("users", ds.Tables["users"]); 721 da.InsertCommand = SQLiteUtil.createInsertCommand("users", ds.Tables["users"]);
737 da.InsertCommand.Connection = conn; 722 da.InsertCommand.Connection = conn;
738 723
739 da.UpdateCommand = createUpdateCommand("users", "UUID=:UUID", ds.Tables["users"]); 724 da.UpdateCommand = SQLiteUtil.createUpdateCommand("users", "UUID=:UUID", ds.Tables["users"]);
740 da.UpdateCommand.Connection = conn; 725 da.UpdateCommand.Connection = conn;
741 726
742 SqliteCommand delete = new SqliteCommand("delete from users where UUID = :UUID"); 727 SqliteCommand delete = new SqliteCommand("delete from users where UUID = :UUID");
743 delete.Parameters.Add(createSqliteParameter("UUID", typeof (String))); 728 delete.Parameters.Add(SQLiteUtil.createSqliteParameter("UUID", typeof(String)));
744 delete.Connection = conn; 729 delete.Connection = conn;
745 da.DeleteCommand = delete; 730 da.DeleteCommand = delete;
746 } 731 }
747 732
748 private void setupUserFriendsCommands(SqliteDataAdapter daf, SqliteConnection conn) 733 private void setupUserFriendsCommands(SqliteDataAdapter daf, SqliteConnection conn)
749 { 734 {
750 daf.InsertCommand = createInsertCommand("userfriends", ds.Tables["userfriends"]); 735 daf.InsertCommand = SQLiteUtil.createInsertCommand("userfriends", ds.Tables["userfriends"]);
751 daf.InsertCommand.Connection = conn; 736 daf.InsertCommand.Connection = conn;
752 737
753 daf.UpdateCommand = createUpdateCommand("userfriends", "ownerID=:ownerID and friendID=:friendID", ds.Tables["userfriends"]); 738 daf.UpdateCommand = SQLiteUtil.createUpdateCommand("userfriends", "ownerID=:ownerID and friendID=:friendID", ds.Tables["userfriends"]);
754 daf.UpdateCommand.Connection = conn; 739 daf.UpdateCommand.Connection = conn;
755 740
756 SqliteCommand delete = new SqliteCommand("delete from userfriends where ownerID=:ownerID and friendID=:friendID"); 741 SqliteCommand delete = new SqliteCommand("delete from userfriends where ownerID=:ownerID and friendID=:friendID");
757 delete.Parameters.Add(createSqliteParameter("ownerID", typeof(String))); 742 delete.Parameters.Add(SQLiteUtil.createSqliteParameter("ownerID", typeof(String)));
758 delete.Parameters.Add(createSqliteParameter("friendID", typeof(String))); 743 delete.Parameters.Add(SQLiteUtil.createSqliteParameter("friendID", typeof(String)));
759 delete.Connection = conn; 744 delete.Connection = conn;
760 daf.DeleteCommand = delete; 745 daf.DeleteCommand = delete;
761 746
@@ -763,8 +748,8 @@ namespace OpenSim.Framework.Data.SQLite
763 748
764 private void InitDB(SqliteConnection conn) 749 private void InitDB(SqliteConnection conn)
765 { 750 {
766 string createUsers = defineTable(createUsersTable()); 751 string createUsers = SQLiteUtil.defineTable(createUsersTable());
767 string createFriends = defineTable(createUserFriendsTable()); 752 string createFriends = SQLiteUtil.defineTable(createUserFriendsTable());
768 753
769 SqliteCommand pcmd = new SqliteCommand(createUsers, conn); 754 SqliteCommand pcmd = new SqliteCommand(createUsers, conn);
770 SqliteCommand fcmd = new SqliteCommand(createFriends, conn); 755 SqliteCommand fcmd = new SqliteCommand(createFriends, conn);