aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/AvatarPickerAvatar.cs14
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs42
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLUserData.cs42
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs187
-rw-r--r--OpenSim/Framework/Data/GridData.cs13
-rw-r--r--OpenSim/Framework/Data/UserDataBase.cs27
-rw-r--r--OpenSim/Framework/IUserData.cs11
-rw-r--r--OpenSim/Framework/UserProfileData.cs14
8 files changed, 167 insertions, 183 deletions
diff --git a/OpenSim/Framework/AvatarPickerAvatar.cs b/OpenSim/Framework/AvatarPickerAvatar.cs
new file mode 100644
index 0000000..5f0de38
--- /dev/null
+++ b/OpenSim/Framework/AvatarPickerAvatar.cs
@@ -0,0 +1,14 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework
7{
8 public class AvatarPickerAvatar
9 {
10 public LLUUID AvatarID;
11 public string firstName;
12 public string lastName;
13 }
14}
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
index 979e349..be0417d 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.MSSQL
37 /// <summary> 37 /// <summary>
38 /// A database interface class to a user profile storage system 38 /// A database interface class to a user profile storage system
39 /// </summary> 39 /// </summary>
40 public class MSSQLUserData : IUserData 40 public class MSSQLUserData : 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
@@ -53,7 +53,7 @@ namespace OpenSim.Framework.Data.MSSQL
53 /// <summary> 53 /// <summary>
54 /// Loads and initialises the MySQL storage plugin 54 /// Loads and initialises the MySQL storage plugin
55 /// </summary> 55 /// </summary>
56 public void Initialise() 56 override public void Initialise()
57 { 57 {
58 // Load from an INI file connection details 58 // Load from an INI file connection details
59 // TODO: move this to XML? 59 // TODO: move this to XML?
@@ -131,7 +131,7 @@ namespace OpenSim.Framework.Data.MSSQL
131 /// <param name="user">The first part of the account name</param> 131 /// <param name="user">The first part of the account name</param>
132 /// <param name="last">The second part of the account name</param> 132 /// <param name="last">The second part of the account name</param>
133 /// <returns>A user profile</returns> 133 /// <returns>A user profile</returns>
134 public UserProfileData GetUserByName(string user, string last) 134 override public UserProfileData GetUserByName(string user, string last)
135 { 135 {
136 try 136 try
137 { 137 {
@@ -163,7 +163,7 @@ namespace OpenSim.Framework.Data.MSSQL
163 163
164 #region User Friends List Data 164 #region User Friends List Data
165 165
166 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 166 override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
167 { 167 {
168 int dtvalue = Util.UnixTimeSinceEpoch(); 168 int dtvalue = Util.UnixTimeSinceEpoch();
169 169
@@ -206,7 +206,7 @@ namespace OpenSim.Framework.Data.MSSQL
206 } 206 }
207 } 207 }
208 208
209 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 209 override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
210 { 210 {
211 Dictionary<string, string> param = new Dictionary<string, string>(); 211 Dictionary<string, string> param = new Dictionary<string, string>();
212 param["@ownerID"] = friendlistowner.UUID.ToString(); 212 param["@ownerID"] = friendlistowner.UUID.ToString();
@@ -239,7 +239,7 @@ namespace OpenSim.Framework.Data.MSSQL
239 } 239 }
240 } 240 }
241 241
242 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 242 override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
243 { 243 {
244 Dictionary<string, string> param = new Dictionary<string, string>(); 244 Dictionary<string, string> param = new Dictionary<string, string>();
245 param["@ownerID"] = friendlistowner.UUID.ToString(); 245 param["@ownerID"] = friendlistowner.UUID.ToString();
@@ -270,7 +270,7 @@ namespace OpenSim.Framework.Data.MSSQL
270 } 270 }
271 271
272 272
273 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 273 override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
274 { 274 {
275 List<FriendListItem> Lfli = new List<FriendListItem>(); 275 List<FriendListItem> Lfli = new List<FriendListItem>();
276 276
@@ -318,14 +318,14 @@ namespace OpenSim.Framework.Data.MSSQL
318 318
319 #endregion 319 #endregion
320 320
321 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) 321 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
322 { 322 {
323 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); 323 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
324 } 324 }
325 325
326 326
327 327
328 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 328 override public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
329 { 329 {
330 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 330 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
331 string[] querysplit; 331 string[] querysplit;
@@ -405,7 +405,7 @@ namespace OpenSim.Framework.Data.MSSQL
405 } 405 }
406 406
407 // See IUserData 407 // See IUserData
408 public UserProfileData GetUserByUUID(LLUUID uuid) 408 override public UserProfileData GetUserByUUID(LLUUID uuid)
409 { 409 {
410 try 410 try
411 { 411 {
@@ -438,7 +438,7 @@ namespace OpenSim.Framework.Data.MSSQL
438 /// </summary> 438 /// </summary>
439 /// <param name="name">The account name</param> 439 /// <param name="name">The account name</param>
440 /// <returns>The users session</returns> 440 /// <returns>The users session</returns>
441 public UserAgentData GetAgentByName(string name) 441 override public UserAgentData GetAgentByName(string name)
442 { 442 {
443 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); 443 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
444 } 444 }
@@ -449,7 +449,7 @@ namespace OpenSim.Framework.Data.MSSQL
449 /// <param name="user">First part of the users account name</param> 449 /// <param name="user">First part of the users account name</param>
450 /// <param name="last">Second part of the users account name</param> 450 /// <param name="last">Second part of the users account name</param>
451 /// <returns>The users session</returns> 451 /// <returns>The users session</returns>
452 public UserAgentData GetAgentByName(string user, string last) 452 override public UserAgentData GetAgentByName(string user, string last)
453 { 453 {
454 UserProfileData profile = GetUserByName(user, last); 454 UserProfileData profile = GetUserByName(user, last);
455 return GetAgentByUUID(profile.UUID); 455 return GetAgentByUUID(profile.UUID);
@@ -460,7 +460,7 @@ namespace OpenSim.Framework.Data.MSSQL
460 /// </summary> 460 /// </summary>
461 /// <param name="uuid">The accounts UUID</param> 461 /// <param name="uuid">The accounts UUID</param>
462 /// <returns>The users session</returns> 462 /// <returns>The users session</returns>
463 public UserAgentData GetAgentByUUID(LLUUID uuid) 463 override public UserAgentData GetAgentByUUID(LLUUID uuid)
464 { 464 {
465 try 465 try
466 { 466 {
@@ -487,7 +487,7 @@ namespace OpenSim.Framework.Data.MSSQL
487 return null; 487 return null;
488 } 488 }
489 } 489 }
490 public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 490 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
491 { 491 {
492 UserProfileData user = GetUserByUUID(AgentID); 492 UserProfileData user = GetUserByUUID(AgentID);
493 user.webLoginKey = WebLoginKey; 493 user.webLoginKey = WebLoginKey;
@@ -498,7 +498,7 @@ namespace OpenSim.Framework.Data.MSSQL
498 /// Creates a new users profile 498 /// Creates a new users profile
499 /// </summary> 499 /// </summary>
500 /// <param name="user">The user profile to create</param> 500 /// <param name="user">The user profile to create</param>
501 public void AddNewUserProfile(UserProfileData user) 501 override public void AddNewUserProfile(UserProfileData user)
502 { 502 {
503 try 503 try
504 { 504 {
@@ -618,13 +618,13 @@ namespace OpenSim.Framework.Data.MSSQL
618 /// Creates a new agent 618 /// Creates a new agent
619 /// </summary> 619 /// </summary>
620 /// <param name="agent">The agent to create</param> 620 /// <param name="agent">The agent to create</param>
621 public void AddNewUserAgent(UserAgentData agent) 621 override public void AddNewUserAgent(UserAgentData agent)
622 { 622 {
623 // Do nothing. 623 // Do nothing.
624 } 624 }
625 625
626 626
627 public bool UpdateUserProfile(UserProfileData user) 627 override public bool UpdateUserProfile(UserProfileData user)
628 { 628 {
629 SqlCommand command = new SqlCommand("UPDATE " + m_usersTableName + " set UUID = @uuid, " + 629 SqlCommand command = new SqlCommand("UPDATE " + m_usersTableName + " set UUID = @uuid, " +
630 "username = @username, " + 630 "username = @username, " +
@@ -724,7 +724,7 @@ namespace OpenSim.Framework.Data.MSSQL
724 /// <param name="to">The receivers account ID</param> 724 /// <param name="to">The receivers account ID</param>
725 /// <param name="amount">The amount to transfer</param> 725 /// <param name="amount">The amount to transfer</param>
726 /// <returns>Success?</returns> 726 /// <returns>Success?</returns>
727 public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) 727 override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
728 { 728 {
729 return false; 729 return false;
730 } 730 }
@@ -737,7 +737,7 @@ namespace OpenSim.Framework.Data.MSSQL
737 /// <param name="to">The receivers account ID</param> 737 /// <param name="to">The receivers account ID</param>
738 /// <param name="item">The item to transfer</param> 738 /// <param name="item">The item to transfer</param>
739 /// <returns>Success?</returns> 739 /// <returns>Success?</returns>
740 public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) 740 override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
741 { 741 {
742 return false; 742 return false;
743 } 743 }
@@ -746,7 +746,7 @@ namespace OpenSim.Framework.Data.MSSQL
746 /// Database provider name 746 /// Database provider name
747 /// </summary> 747 /// </summary>
748 /// <returns>Provider name</returns> 748 /// <returns>Provider name</returns>
749 public string getName() 749 override public string getName()
750 { 750 {
751 return "MSSQL Userdata Interface"; 751 return "MSSQL Userdata Interface";
752 } 752 }
@@ -755,7 +755,7 @@ namespace OpenSim.Framework.Data.MSSQL
755 /// Database provider version 755 /// Database provider version
756 /// </summary> 756 /// </summary>
757 /// <returns>provider version</returns> 757 /// <returns>provider version</returns>
758 public string GetVersion() 758 override public string GetVersion()
759 { 759 {
760 return database.getVersion(); 760 return database.getVersion();
761 } 761 }
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index 010e911..fd640ec 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.MySQL
37 /// <summary> 37 /// <summary>
38 /// A database interface class to a user profile storage system 38 /// A database interface class to a user profile storage system
39 /// </summary> 39 /// </summary>
40 internal class MySQLUserData : IUserData 40 internal class MySQLUserData : 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
@@ -53,7 +53,7 @@ namespace OpenSim.Framework.Data.MySQL
53 /// <summary> 53 /// <summary>
54 /// Loads and initialises the MySQL storage plugin 54 /// Loads and initialises the MySQL storage plugin
55 /// </summary> 55 /// </summary>
56 public void Initialise() 56 override public void Initialise()
57 { 57 {
58 // Load from an INI file connection details 58 // Load from an INI file connection details
59 // TODO: move this to XML? Yes, PLEASE! 59 // TODO: move this to XML? Yes, PLEASE!
@@ -164,7 +164,7 @@ namespace OpenSim.Framework.Data.MySQL
164 #endregion 164 #endregion
165 165
166 // see IUserData 166 // see IUserData
167 public UserProfileData GetUserByName(string user, string last) 167 override public UserProfileData GetUserByName(string user, string last)
168 { 168 {
169 try 169 try
170 { 170 {
@@ -195,7 +195,7 @@ namespace OpenSim.Framework.Data.MySQL
195 195
196 #region User Friends List Data 196 #region User Friends List Data
197 197
198 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 198 override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
199 { 199 {
200 int dtvalue = Util.UnixTimeSinceEpoch(); 200 int dtvalue = Util.UnixTimeSinceEpoch();
201 201
@@ -236,7 +236,7 @@ namespace OpenSim.Framework.Data.MySQL
236 } 236 }
237 } 237 }
238 238
239 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 239 override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
240 { 240 {
241 Dictionary<string, string> param = new Dictionary<string, string>(); 241 Dictionary<string, string> param = new Dictionary<string, string>();
242 param["?ownerID"] = friendlistowner.UUID.ToString(); 242 param["?ownerID"] = friendlistowner.UUID.ToString();
@@ -267,7 +267,7 @@ namespace OpenSim.Framework.Data.MySQL
267 } 267 }
268 } 268 }
269 269
270 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 270 override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
271 { 271 {
272 Dictionary<string, string> param = new Dictionary<string, string>(); 272 Dictionary<string, string> param = new Dictionary<string, string>();
273 param["?ownerID"] = friendlistowner.UUID.ToString(); 273 param["?ownerID"] = friendlistowner.UUID.ToString();
@@ -295,7 +295,7 @@ namespace OpenSim.Framework.Data.MySQL
295 } 295 }
296 } 296 }
297 297
298 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 298 override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
299 { 299 {
300 List<FriendListItem> Lfli = new List<FriendListItem>(); 300 List<FriendListItem> Lfli = new List<FriendListItem>();
301 301
@@ -342,12 +342,12 @@ namespace OpenSim.Framework.Data.MySQL
342 342
343 #endregion 343 #endregion
344 344
345 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) 345 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
346 { 346 {
347 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); 347 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
348 } 348 }
349 349
350 public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 350 override public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
351 { 351 {
352 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); 352 List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>();
353 353
@@ -427,7 +427,7 @@ namespace OpenSim.Framework.Data.MySQL
427 } 427 }
428 428
429 // see IUserData 429 // see IUserData
430 public UserProfileData GetUserByUUID(LLUUID uuid) 430 override public UserProfileData GetUserByUUID(LLUUID uuid)
431 { 431 {
432 try 432 try
433 { 433 {
@@ -460,7 +460,7 @@ namespace OpenSim.Framework.Data.MySQL
460 /// </summary> 460 /// </summary>
461 /// <param name="name">The account name</param> 461 /// <param name="name">The account name</param>
462 /// <returns>The users session</returns> 462 /// <returns>The users session</returns>
463 public UserAgentData GetAgentByName(string name) 463 override public UserAgentData GetAgentByName(string name)
464 { 464 {
465 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]); 465 return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
466 } 466 }
@@ -471,13 +471,13 @@ namespace OpenSim.Framework.Data.MySQL
471 /// <param name="user">First part of the users account name</param> 471 /// <param name="user">First part of the users account name</param>
472 /// <param name="last">Second part of the users account name</param> 472 /// <param name="last">Second part of the users account name</param>
473 /// <returns>The users session</returns> 473 /// <returns>The users session</returns>
474 public UserAgentData GetAgentByName(string user, string last) 474 override public UserAgentData GetAgentByName(string user, string last)
475 { 475 {
476 UserProfileData profile = GetUserByName(user, last); 476 UserProfileData profile = GetUserByName(user, last);
477 return GetAgentByUUID(profile.UUID); 477 return GetAgentByUUID(profile.UUID);
478 } 478 }
479 479
480 public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 480 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
481 { 481 {
482 Dictionary<string, string> param = new Dictionary<string, string>(); 482 Dictionary<string, string> param = new Dictionary<string, string>();
483 param["?UUID"] = AgentID.UUID.ToString(); 483 param["?UUID"] = AgentID.UUID.ToString();
@@ -508,7 +508,7 @@ namespace OpenSim.Framework.Data.MySQL
508 /// </summary> 508 /// </summary>
509 /// <param name="uuid">The accounts UUID</param> 509 /// <param name="uuid">The accounts UUID</param>
510 /// <returns>The users session</returns> 510 /// <returns>The users session</returns>
511 public UserAgentData GetAgentByUUID(LLUUID uuid) 511 override public UserAgentData GetAgentByUUID(LLUUID uuid)
512 { 512 {
513 try 513 try
514 { 514 {
@@ -540,7 +540,7 @@ namespace OpenSim.Framework.Data.MySQL
540 /// Creates a new users profile 540 /// Creates a new users profile
541 /// </summary> 541 /// </summary>
542 /// <param name="user">The user profile to create</param> 542 /// <param name="user">The user profile to create</param>
543 public void AddNewUserProfile(UserProfileData user) 543 override public void AddNewUserProfile(UserProfileData user)
544 { 544 {
545 try 545 try
546 { 546 {
@@ -567,7 +567,7 @@ namespace OpenSim.Framework.Data.MySQL
567 /// Creates a new agent 567 /// Creates a new agent
568 /// </summary> 568 /// </summary>
569 /// <param name="agent">The agent to create</param> 569 /// <param name="agent">The agent to create</param>
570 public void AddNewUserAgent(UserAgentData agent) 570 override public void AddNewUserAgent(UserAgentData agent)
571 { 571 {
572 try 572 try
573 { 573 {
@@ -587,7 +587,7 @@ namespace OpenSim.Framework.Data.MySQL
587 /// Updates a user profile stored in the DB 587 /// Updates a user profile stored in the DB
588 /// </summary> 588 /// </summary>
589 /// <param name="user">The profile data to use to update the DB</param> 589 /// <param name="user">The profile data to use to update the DB</param>
590 public bool UpdateUserProfile(UserProfileData user) 590 override public bool UpdateUserProfile(UserProfileData user)
591 { 591 {
592 database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 592 database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt,
593 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X, 593 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X,
@@ -604,7 +604,7 @@ namespace OpenSim.Framework.Data.MySQL
604 /// <param name="to">The receivers account ID</param> 604 /// <param name="to">The receivers account ID</param>
605 /// <param name="amount">The amount to transfer</param> 605 /// <param name="amount">The amount to transfer</param>
606 /// <returns>Success?</returns> 606 /// <returns>Success?</returns>
607 public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) 607 override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
608 { 608 {
609 return false; 609 return false;
610 } 610 }
@@ -617,7 +617,7 @@ namespace OpenSim.Framework.Data.MySQL
617 /// <param name="to">The receivers account ID</param> 617 /// <param name="to">The receivers account ID</param>
618 /// <param name="item">The item to transfer</param> 618 /// <param name="item">The item to transfer</param>
619 /// <returns>Success?</returns> 619 /// <returns>Success?</returns>
620 public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) 620 override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
621 { 621 {
622 return false; 622 return false;
623 } 623 }
@@ -626,7 +626,7 @@ namespace OpenSim.Framework.Data.MySQL
626 /// Database provider name 626 /// Database provider name
627 /// </summary> 627 /// </summary>
628 /// <returns>Provider name</returns> 628 /// <returns>Provider name</returns>
629 public string getName() 629 override public string getName()
630 { 630 {
631 return "MySQL Userdata Interface"; 631 return "MySQL Userdata Interface";
632 } 632 }
@@ -635,7 +635,7 @@ namespace OpenSim.Framework.Data.MySQL
635 /// Database provider version 635 /// Database provider version
636 /// </summary> 636 /// </summary>
637 /// <returns>provider version</returns> 637 /// <returns>provider version</returns>
638 public string GetVersion() 638 override public string GetVersion()
639 { 639 {
640 return "0.1"; 640 return "0.1";
641 } 641 }
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);
diff --git a/OpenSim/Framework/Data/GridData.cs b/OpenSim/Framework/Data/GridData.cs
index 5eaa2c4..af51d0d 100644
--- a/OpenSim/Framework/Data/GridData.cs
+++ b/OpenSim/Framework/Data/GridData.cs
@@ -29,18 +29,7 @@ using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30 30
31namespace OpenSim.Framework.Data 31namespace OpenSim.Framework.Data
32{ 32{
33 public class AvatarPickerAvatar
34 {
35 public LLUUID AvatarID;
36 public string firstName;
37 public string lastName;
38
39 public AvatarPickerAvatar()
40 {
41 }
42 }
43
44 public enum DataResponse 33 public enum DataResponse
45 { 34 {
46 RESPONSE_OK, 35 RESPONSE_OK,
diff --git a/OpenSim/Framework/Data/UserDataBase.cs b/OpenSim/Framework/Data/UserDataBase.cs
index a704ed4..7a74693 100644
--- a/OpenSim/Framework/Data/UserDataBase.cs
+++ b/OpenSim/Framework/Data/UserDataBase.cs
@@ -1,10 +1,29 @@
1using System; 1using System.Collections.Generic;
2using System.Collections.Generic; 2using libsecondlife;
3using System.Text;
4 3
5namespace OpenSim.Framework.Data 4namespace OpenSim.Framework.Data
6{ 5{
7 public abstract class UserDataBase 6 public abstract class UserDataBase : IUserData
8 { 7 {
8 public abstract UserProfileData GetUserByUUID(LLUUID user);
9 public abstract UserProfileData GetUserByName(string fname, string lname);
10 public abstract UserAgentData GetAgentByUUID(LLUUID user);
11 public abstract UserAgentData GetAgentByName(string name);
12 public abstract UserAgentData GetAgentByName(string fname, string lname);
13 public abstract void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey);
14 public abstract void AddNewUserProfile(UserProfileData user);
15 public abstract bool UpdateUserProfile(UserProfileData user);
16 public abstract void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid);
17 public abstract void AddNewUserAgent(UserAgentData agent);
18 public abstract void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms);
19 public abstract void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend);
20 public abstract void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms);
21 public abstract List<FriendListItem> GetUserFriendList(LLUUID friendlistowner);
22 public abstract bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount);
23 public abstract bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
24 public abstract string GetVersion();
25 public abstract string getName();
26 public abstract void Initialise();
27 public abstract List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
9 } 28 }
10} 29}
diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs
index 4700b4b..9749135 100644
--- a/OpenSim/Framework/IUserData.cs
+++ b/OpenSim/Framework/IUserData.cs
@@ -174,15 +174,4 @@ namespace OpenSim.Framework
174 /// </summary> 174 /// </summary>
175 void Initialise(); 175 void Initialise();
176 } 176 }
177
178 public class AvatarPickerAvatar
179 {
180 public LLUUID AvatarID;
181 public string firstName;
182 public string lastName;
183
184 public AvatarPickerAvatar()
185 {
186 }
187 }
188} 177}
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index 3959be3..c5d27a2 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -148,19 +148,7 @@ namespace OpenSim.Framework
148 /// </summary> 148 /// </summary>
149 public UserAgentData currentAgent; 149 public UserAgentData currentAgent;
150 } 150 }
151 151
152 /// <summary>
153 /// Minimal User Data required to service the AvatarPickerReply
154 /// </summary>
155 //public class AvatarPickerAvatar
156 //{
157 //public LLUUID AvatarID;
158 //public string firstName;
159 //public string lastName;
160 //public AvatarPickerAvatar()
161 //{
162 //}
163 //}
164 /// <summary> 152 /// <summary>
165 /// Information about a users session 153 /// Information about a users session
166 /// </summary> 154 /// </summary>