aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLUserData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserData.cs116
1 files changed, 58 insertions, 58 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs
index cfe5f50..9118012 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs
@@ -30,7 +30,7 @@ using System.Collections.Generic;
30using System.Data; 30using System.Data;
31using System.Data.SqlClient; 31using System.Data.SqlClient;
32using System.Reflection; 32using System.Reflection;
33using libsecondlife; 33using OpenMetaverse;
34using log4net; 34using log4net;
35using OpenSim.Framework; 35using OpenSim.Framework;
36 36
@@ -183,13 +183,13 @@ namespace OpenSim.Data.MSSQL
183 /// <param name="friendlistowner">UUID of the friendlist owner</param> 183 /// <param name="friendlistowner">UUID of the friendlist owner</param>
184 /// <param name="friend">Friend's UUID</param> 184 /// <param name="friend">Friend's UUID</param>
185 /// <param name="perms">Permission flag</param> 185 /// <param name="perms">Permission flag</param>
186 override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 186 override public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
187 { 187 {
188 int dtvalue = Util.UnixTimeSinceEpoch(); 188 int dtvalue = Util.UnixTimeSinceEpoch();
189 189
190 Dictionary<string, string> param = new Dictionary<string, string>(); 190 Dictionary<string, string> param = new Dictionary<string, string>();
191 param["@ownerID"] = friendlistowner.UUID.ToString(); 191 param["@ownerID"] = friendlistowner.ToString();
192 param["@friendID"] = friend.UUID.ToString(); 192 param["@friendID"] = friend.ToString();
193 param["@friendPerms"] = perms.ToString(); 193 param["@friendPerms"] = perms.ToString();
194 param["@datetimestamp"] = dtvalue.ToString(); 194 param["@datetimestamp"] = dtvalue.ToString();
195 195
@@ -229,11 +229,11 @@ namespace OpenSim.Data.MSSQL
229 /// </summary> 229 /// </summary>
230 /// <param name="friendlistowner">UUID of the friendlist owner</param> 230 /// <param name="friendlistowner">UUID of the friendlist owner</param>
231 /// <param name="friend">UUID of the not-so-friendly user to remove from the list</param> 231 /// <param name="friend">UUID of the not-so-friendly user to remove from the list</param>
232 override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 232 override public void RemoveUserFriend(UUID friendlistowner, UUID friend)
233 { 233 {
234 Dictionary<string, string> param = new Dictionary<string, string>(); 234 Dictionary<string, string> param = new Dictionary<string, string>();
235 param["@ownerID"] = friendlistowner.UUID.ToString(); 235 param["@ownerID"] = friendlistowner.ToString();
236 param["@friendID"] = friend.UUID.ToString(); 236 param["@friendID"] = friend.ToString();
237 237
238 238
239 try 239 try
@@ -267,11 +267,11 @@ namespace OpenSim.Data.MSSQL
267 /// <param name="friendlistowner">UUID of the friendlist owner</param> 267 /// <param name="friendlistowner">UUID of the friendlist owner</param>
268 /// <param name="friend">UUID of the friend</param> 268 /// <param name="friend">UUID of the friend</param>
269 /// <param name="perms">new permission flag</param> 269 /// <param name="perms">new permission flag</param>
270 override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 270 override public void UpdateUserFriendPerms(UUID friendlistowner, UUID 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.ToString();
274 param["@friendID"] = friend.UUID.ToString(); 274 param["@friendID"] = friend.ToString();
275 param["@friendPerms"] = perms.ToString(); 275 param["@friendPerms"] = perms.ToString();
276 276
277 277
@@ -298,12 +298,12 @@ namespace OpenSim.Data.MSSQL
298 /// </summary> 298 /// </summary>
299 /// <param name="friendlistowner">UUID of the friendlist owner</param> 299 /// <param name="friendlistowner">UUID of the friendlist owner</param>
300 /// <returns>Friendlist list</returns> 300 /// <returns>Friendlist list</returns>
301 override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 301 override public List<FriendListItem> GetUserFriendList(UUID friendlistowner)
302 { 302 {
303 List<FriendListItem> Lfli = new List<FriendListItem>(); 303 List<FriendListItem> Lfli = new List<FriendListItem>();
304 304
305 Dictionary<string, string> param = new Dictionary<string, string>(); 305 Dictionary<string, string> param = new Dictionary<string, string>();
306 param["@ownerID"] = friendlistowner.UUID.ToString(); 306 param["@ownerID"] = friendlistowner.ToString();
307 307
308 try 308 try
309 { 309 {
@@ -318,8 +318,8 @@ namespace OpenSim.Data.MSSQL
318 while (reader.Read()) 318 while (reader.Read())
319 { 319 {
320 FriendListItem fli = new FriendListItem(); 320 FriendListItem fli = new FriendListItem();
321 fli.FriendListOwner = new LLUUID((string)reader["ownerID"]); 321 fli.FriendListOwner = new UUID((string)reader["ownerID"]);
322 fli.Friend = new LLUUID((string)reader["friendID"]); 322 fli.Friend = new UUID((string)reader["friendID"]);
323 fli.FriendPerms = (uint)Convert.ToInt32(reader["friendPerms"]); 323 fli.FriendPerms = (uint)Convert.ToInt32(reader["friendPerms"]);
324 324
325 // This is not a real column in the database table, it's a joined column from the opposite record 325 // This is not a real column in the database table, it's a joined column from the opposite record
@@ -345,7 +345,7 @@ namespace OpenSim.Data.MSSQL
345 /// <param name="avatarid">avatar uuid</param> 345 /// <param name="avatarid">avatar uuid</param>
346 /// <param name="regionuuid">region uuid</param> 346 /// <param name="regionuuid">region uuid</param>
347 /// <param name="regionhandle">region handle</param> 347 /// <param name="regionhandle">region handle</param>
348 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) 348 override public void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle)
349 { 349 {
350 //m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); 350 //m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
351 } 351 }
@@ -356,7 +356,7 @@ namespace OpenSim.Data.MSSQL
356 /// <param name="queryID"></param> 356 /// <param name="queryID"></param>
357 /// <param name="query"></param> 357 /// <param name="query"></param>
358 /// <returns></returns> 358 /// <returns></returns>
359 override public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 359 override public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query)
360 { 360 {
361 List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>(); 361 List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
362 string[] querysplit; 362 string[] querysplit;
@@ -375,7 +375,7 @@ namespace OpenSim.Data.MSSQL
375 while (reader.Read()) 375 while (reader.Read())
376 { 376 {
377 AvatarPickerAvatar user = new AvatarPickerAvatar(); 377 AvatarPickerAvatar user = new AvatarPickerAvatar();
378 user.AvatarID = new LLUUID((string)reader["UUID"]); 378 user.AvatarID = new UUID((string)reader["UUID"]);
379 user.firstName = (string)reader["username"]; 379 user.firstName = (string)reader["username"];
380 user.lastName = (string)reader["lastname"]; 380 user.lastName = (string)reader["lastname"];
381 returnlist.Add(user); 381 returnlist.Add(user);
@@ -400,7 +400,7 @@ namespace OpenSim.Data.MSSQL
400 while (reader.Read()) 400 while (reader.Read())
401 { 401 {
402 AvatarPickerAvatar user = new AvatarPickerAvatar(); 402 AvatarPickerAvatar user = new AvatarPickerAvatar();
403 user.AvatarID = new LLUUID((string)reader["UUID"]); 403 user.AvatarID = new UUID((string)reader["UUID"]);
404 user.firstName = (string)reader["username"]; 404 user.firstName = (string)reader["username"];
405 user.lastName = (string)reader["lastname"]; 405 user.lastName = (string)reader["lastname"];
406 returnlist.Add(user); 406 returnlist.Add(user);
@@ -420,7 +420,7 @@ namespace OpenSim.Data.MSSQL
420 /// </summary> 420 /// </summary>
421 /// <param name="uuid"></param> 421 /// <param name="uuid"></param>
422 /// <returns></returns> 422 /// <returns></returns>
423 override public UserProfileData GetUserByUUID(LLUUID uuid) 423 override public UserProfileData GetUserByUUID(UUID uuid)
424 { 424 {
425 try 425 try
426 { 426 {
@@ -467,7 +467,7 @@ namespace OpenSim.Data.MSSQL
467 /// </summary> 467 /// </summary>
468 /// <param name="uuid">The accounts UUID</param> 468 /// <param name="uuid">The accounts UUID</param>
469 /// <returns>The users session</returns> 469 /// <returns>The users session</returns>
470 override public UserAgentData GetAgentByUUID(LLUUID uuid) 470 override public UserAgentData GetAgentByUUID(UUID uuid)
471 { 471 {
472 try 472 try
473 { 473 {
@@ -493,7 +493,7 @@ namespace OpenSim.Data.MSSQL
493 /// <param name="AgentID">The agent UUID</param> 493 /// <param name="AgentID">The agent UUID</param>
494 /// <param name="WebLoginKey">the WebLogin Key</param> 494 /// <param name="WebLoginKey">the WebLogin Key</param>
495 /// <remarks>unused ?</remarks> 495 /// <remarks>unused ?</remarks>
496 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 496 override public void StoreWebLoginKey(UUID AgentID, UUID WebLoginKey)
497 { 497 {
498 UserProfileData user = GetUserByUUID(AgentID); 498 UserProfileData user = GetUserByUUID(AgentID);
499 user.WebLoginKey = WebLoginKey; 499 user.WebLoginKey = WebLoginKey;
@@ -549,12 +549,12 @@ namespace OpenSim.Data.MSSQL
549 /// <param name="profileImage">UUID for profile image</param> 549 /// <param name="profileImage">UUID for profile image</param>
550 /// <param name="firstImage">UUID for firstlife image</param> 550 /// <param name="firstImage">UUID for firstlife image</param>
551 /// <returns>Success?</returns> 551 /// <returns>Success?</returns>
552 private bool InsertUserRow(LLUUID uuid, string username, string lastname, string passwordHash, 552 private bool InsertUserRow(UUID uuid, string username, string lastname, string passwordHash,
553 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, 553 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
554 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 554 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
555 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 555 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
556 string aboutText, string firstText, 556 string aboutText, string firstText,
557 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey) 557 UUID profileImage, UUID firstImage, UUID webLoginKey)
558 { 558 {
559 string sql = "INSERT INTO "+m_usersTableName; 559 string sql = "INSERT INTO "+m_usersTableName;
560 sql += " ([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], "; 560 sql += " ([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], ";
@@ -594,7 +594,7 @@ namespace OpenSim.Data.MSSQL
594 parameters["profileFirstText"] = firstText; 594 parameters["profileFirstText"] = firstText;
595 parameters["profileImage"] = profileImage.ToString(); 595 parameters["profileImage"] = profileImage.ToString();
596 parameters["profileFirstImage"] = firstImage.ToString(); 596 parameters["profileFirstImage"] = firstImage.ToString();
597 parameters["webLoginKey"] = LLUUID.Random().ToString(); 597 parameters["webLoginKey"] = UUID.Random().ToString();
598 598
599 599
600 try 600 try
@@ -683,7 +683,7 @@ namespace OpenSim.Data.MSSQL
683 SqlParameter param21 = new SqlParameter("@profileImage", user.Image.ToString()); 683 SqlParameter param21 = new SqlParameter("@profileImage", user.Image.ToString());
684 SqlParameter param22 = new SqlParameter("@profileFirstImage", user.FirstLifeImage.ToString()); 684 SqlParameter param22 = new SqlParameter("@profileFirstImage", user.FirstLifeImage.ToString());
685 SqlParameter param23 = new SqlParameter("@keyUUUID", user.ID.ToString()); 685 SqlParameter param23 = new SqlParameter("@keyUUUID", user.ID.ToString());
686 SqlParameter param24 = new SqlParameter("@webLoginKey", user.WebLoginKey.UUID.ToString()); 686 SqlParameter param24 = new SqlParameter("@webLoginKey", user.WebLoginKey.ToString());
687 command.Parameters.Add(param1); 687 command.Parameters.Add(param1);
688 command.Parameters.Add(param2); 688 command.Parameters.Add(param2);
689 command.Parameters.Add(param3); 689 command.Parameters.Add(param3);
@@ -728,7 +728,7 @@ namespace OpenSim.Data.MSSQL
728 /// <param name="to">The receivers account ID</param> 728 /// <param name="to">The receivers account ID</param>
729 /// <param name="amount">The amount to transfer</param> 729 /// <param name="amount">The amount to transfer</param>
730 /// <returns>false</returns> 730 /// <returns>false</returns>
731 override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) 731 override public bool MoneyTransferRequest(UUID from, UUID to, uint amount)
732 { 732 {
733 return false; 733 return false;
734 } 734 }
@@ -741,14 +741,14 @@ namespace OpenSim.Data.MSSQL
741 /// <param name="to">The receivers account ID</param> 741 /// <param name="to">The receivers account ID</param>
742 /// <param name="item">The item to transfer</param> 742 /// <param name="item">The item to transfer</param>
743 /// <returns>false</returns> 743 /// <returns>false</returns>
744 override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) 744 override public bool InventoryTransferRequest(UUID from, UUID to, UUID item)
745 { 745 {
746 return false; 746 return false;
747 } 747 }
748 748
749 /// Appearance 749 /// Appearance
750 /// TODO: stubs for now to get us to a compiling state gently 750 /// TODO: stubs for now to get us to a compiling state gently
751 override public AvatarAppearance GetUserAppearance(LLUUID user) 751 override public AvatarAppearance GetUserAppearance(UUID user)
752 { 752 {
753// return new AvatarAppearance(); 753// return new AvatarAppearance();
754 try 754 try
@@ -784,37 +784,37 @@ namespace OpenSim.Data.MSSQL
784 { 784 {
785 AvatarAppearance appearance = new AvatarAppearance(); 785 AvatarAppearance appearance = new AvatarAppearance();
786 786
787 appearance.Owner = new LLUUID((string)reader["owner"]); 787 appearance.Owner = new UUID((string)reader["owner"]);
788 appearance.Serial = Convert.ToInt32(reader["serial"]); 788 appearance.Serial = Convert.ToInt32(reader["serial"]);
789 appearance.VisualParams = (byte[])reader["visual_params"]; 789 appearance.VisualParams = (byte[])reader["visual_params"];
790 appearance.Texture = new LLObject.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length); 790 appearance.Texture = new Primitive.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length);
791 appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]); 791 appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]);
792 appearance.BodyItem = new LLUUID((string)reader["body_item"]); 792 appearance.BodyItem = new UUID((string)reader["body_item"]);
793 appearance.BodyAsset = new LLUUID((string)reader["body_asset"]); 793 appearance.BodyAsset = new UUID((string)reader["body_asset"]);
794 appearance.SkinItem = new LLUUID((string)reader["skin_item"]); 794 appearance.SkinItem = new UUID((string)reader["skin_item"]);
795 appearance.SkinAsset = new LLUUID((string)reader["skin_asset"]); 795 appearance.SkinAsset = new UUID((string)reader["skin_asset"]);
796 appearance.HairItem = new LLUUID((string)reader["hair_item"]); 796 appearance.HairItem = new UUID((string)reader["hair_item"]);
797 appearance.HairAsset = new LLUUID((string)reader["hair_asset"]); 797 appearance.HairAsset = new UUID((string)reader["hair_asset"]);
798 appearance.EyesItem = new LLUUID((string)reader["eyes_item"]); 798 appearance.EyesItem = new UUID((string)reader["eyes_item"]);
799 appearance.EyesAsset = new LLUUID((string)reader["eyes_asset"]); 799 appearance.EyesAsset = new UUID((string)reader["eyes_asset"]);
800 appearance.ShirtItem = new LLUUID((string)reader["shirt_item"]); 800 appearance.ShirtItem = new UUID((string)reader["shirt_item"]);
801 appearance.ShirtAsset = new LLUUID((string)reader["shirt_asset"]); 801 appearance.ShirtAsset = new UUID((string)reader["shirt_asset"]);
802 appearance.PantsItem = new LLUUID((string)reader["pants_item"]); 802 appearance.PantsItem = new UUID((string)reader["pants_item"]);
803 appearance.PantsAsset = new LLUUID((string)reader["pants_asset"]); 803 appearance.PantsAsset = new UUID((string)reader["pants_asset"]);
804 appearance.ShoesItem = new LLUUID((string)reader["shoes_item"]); 804 appearance.ShoesItem = new UUID((string)reader["shoes_item"]);
805 appearance.ShoesAsset = new LLUUID((string)reader["shoes_asset"]); 805 appearance.ShoesAsset = new UUID((string)reader["shoes_asset"]);
806 appearance.SocksItem = new LLUUID((string)reader["socks_item"]); 806 appearance.SocksItem = new UUID((string)reader["socks_item"]);
807 appearance.SocksAsset = new LLUUID((string)reader["socks_asset"]); 807 appearance.SocksAsset = new UUID((string)reader["socks_asset"]);
808 appearance.JacketItem = new LLUUID((string)reader["jacket_item"]); 808 appearance.JacketItem = new UUID((string)reader["jacket_item"]);
809 appearance.JacketAsset = new LLUUID((string)reader["jacket_asset"]); 809 appearance.JacketAsset = new UUID((string)reader["jacket_asset"]);
810 appearance.GlovesItem = new LLUUID((string)reader["gloves_item"]); 810 appearance.GlovesItem = new UUID((string)reader["gloves_item"]);
811 appearance.GlovesAsset = new LLUUID((string)reader["gloves_asset"]); 811 appearance.GlovesAsset = new UUID((string)reader["gloves_asset"]);
812 appearance.UnderShirtItem = new LLUUID((string)reader["undershirt_item"]); 812 appearance.UnderShirtItem = new UUID((string)reader["undershirt_item"]);
813 appearance.UnderShirtAsset = new LLUUID((string)reader["undershirt_asset"]); 813 appearance.UnderShirtAsset = new UUID((string)reader["undershirt_asset"]);
814 appearance.UnderPantsItem = new LLUUID((string)reader["underpants_item"]); 814 appearance.UnderPantsItem = new UUID((string)reader["underpants_item"]);
815 appearance.UnderPantsAsset = new LLUUID((string)reader["underpants_asset"]); 815 appearance.UnderPantsAsset = new UUID((string)reader["underpants_asset"]);
816 appearance.SkirtItem = new LLUUID((string)reader["skirt_item"]); 816 appearance.SkirtItem = new UUID((string)reader["skirt_item"]);
817 appearance.SkirtAsset = new LLUUID((string)reader["skirt_asset"]); 817 appearance.SkirtAsset = new UUID((string)reader["skirt_asset"]);
818 818
819 return appearance; 819 return appearance;
820 } 820 }
@@ -831,7 +831,7 @@ namespace OpenSim.Data.MSSQL
831 /// </summary> 831 /// </summary>
832 /// <param name="user">the used UUID</param> 832 /// <param name="user">the used UUID</param>
833 /// <param name="appearance">the appearence</param> 833 /// <param name="appearance">the appearence</param>
834 override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) 834 override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
835 { 835 {
836 string sql = String.Empty; 836 string sql = String.Empty;
837 sql += "DELETE FROM avatarappearance WHERE owner=@owner "; 837 sql += "DELETE FROM avatarappearance WHERE owner=@owner ";
@@ -918,7 +918,7 @@ namespace OpenSim.Data.MSSQL
918 { 918 {
919 } 919 }
920 920
921 override public void ResetAttachments(LLUUID userID) 921 override public void ResetAttachments(UUID userID)
922 { 922 {
923 } 923 }
924 } 924 }