diff options
author | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
commit | 07609565617aa7936758acba5fd625877564a10d (patch) | |
tree | 73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/MSSQLUserData.cs | |
parent | * Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff) | |
download | opensim-SC-07609565617aa7936758acba5fd625877564a10d.zip opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.gz opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.bz2 opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=3142
* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient
* ===As always, please, please backup your database before applying this patch===
* Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLUserData.cs | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 453941f..e0db622 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -445,8 +445,8 @@ namespace OpenSim.Data.MSSQL | |||
445 | while (reader.Read()) | 445 | while (reader.Read()) |
446 | { | 446 | { |
447 | FriendListItem fli = new FriendListItem(); | 447 | FriendListItem fli = new FriendListItem(); |
448 | fli.FriendListOwner = new UUID((string)reader["ownerID"]); | 448 | fli.FriendListOwner = new UUID((Guid)reader["ownerID"]); |
449 | fli.Friend = new UUID((string)reader["friendID"]); | 449 | fli.Friend = new UUID((Guid)reader["friendID"]); |
450 | fli.FriendPerms = (uint)Convert.ToInt32(reader["friendPerms"]); | 450 | fli.FriendPerms = (uint)Convert.ToInt32(reader["friendPerms"]); |
451 | 451 | ||
452 | // This is not a real column in the database table, it's a joined column from the opposite record | 452 | // This is not a real column in the database table, it's a joined column from the opposite record |
@@ -703,14 +703,14 @@ namespace OpenSim.Data.MSSQL | |||
703 | { | 703 | { |
704 | command.Parameters.Add(database.CreateParameter("@uuid", agentID)); | 704 | command.Parameters.Add(database.CreateParameter("@uuid", agentID)); |
705 | command.Parameters.Add(database.CreateParameter("@attachpoint", attachpoint)); | 705 | command.Parameters.Add(database.CreateParameter("@attachpoint", attachpoint)); |
706 | command.Parameters.Add(database.CreateParameter("@item", item["item"].ToString())); | 706 | command.Parameters.Add(database.CreateParameter("@item", new UUID(item["item"].ToString()))); |
707 | command.Parameters.Add(database.CreateParameter("@asset", item["asset"].ToString())); | 707 | command.Parameters.Add(database.CreateParameter("@asset", new UUID(item["asset"].ToString()))); |
708 | firstTime = false; | 708 | firstTime = false; |
709 | } | 709 | } |
710 | command.Parameters["@uuid"].Value = agentID.ToString(); | 710 | command.Parameters["@uuid"].Value = agentID.Guid; //.ToString(); |
711 | command.Parameters["@attachpoint"].Value = attachpoint; | 711 | command.Parameters["@attachpoint"].Value = attachpoint; |
712 | command.Parameters["@item"].Value = item["item"].ToString(); | 712 | command.Parameters["@item"].Value = new Guid(item["item"].ToString()); |
713 | command.Parameters["@asset"].Value = item["asset"].ToString(); | 713 | command.Parameters["@asset"].Value = new Guid(item["asset"].ToString()); |
714 | 714 | ||
715 | try | 715 | try |
716 | { | 716 | { |
@@ -769,7 +769,7 @@ namespace OpenSim.Data.MSSQL | |||
769 | while (reader.Read()) | 769 | while (reader.Read()) |
770 | { | 770 | { |
771 | AvatarPickerAvatar user = new AvatarPickerAvatar(); | 771 | AvatarPickerAvatar user = new AvatarPickerAvatar(); |
772 | user.AvatarID = new UUID((string)reader["UUID"]); | 772 | user.AvatarID = new UUID((Guid)reader["UUID"]); |
773 | user.firstName = (string)reader["username"]; | 773 | user.firstName = (string)reader["username"]; |
774 | user.lastName = (string)reader["lastname"]; | 774 | user.lastName = (string)reader["lastname"]; |
775 | returnlist.Add(user); | 775 | returnlist.Add(user); |
@@ -795,7 +795,7 @@ namespace OpenSim.Data.MSSQL | |||
795 | while (reader.Read()) | 795 | while (reader.Read()) |
796 | { | 796 | { |
797 | AvatarPickerAvatar user = new AvatarPickerAvatar(); | 797 | AvatarPickerAvatar user = new AvatarPickerAvatar(); |
798 | user.AvatarID = new UUID((string)reader["UUID"]); | 798 | user.AvatarID = new UUID((Guid)reader["UUID"]); |
799 | user.firstName = (string)reader["username"]; | 799 | user.firstName = (string)reader["username"]; |
800 | user.lastName = (string)reader["lastname"]; | 800 | user.lastName = (string)reader["lastname"]; |
801 | returnlist.Add(user); | 801 | returnlist.Add(user); |
@@ -858,37 +858,37 @@ namespace OpenSim.Data.MSSQL | |||
858 | { | 858 | { |
859 | AvatarAppearance appearance = new AvatarAppearance(); | 859 | AvatarAppearance appearance = new AvatarAppearance(); |
860 | 860 | ||
861 | appearance.Owner = new UUID((string)reader["owner"]); | 861 | appearance.Owner = new UUID((Guid)reader["owner"]); |
862 | appearance.Serial = Convert.ToInt32(reader["serial"]); | 862 | appearance.Serial = Convert.ToInt32(reader["serial"]); |
863 | appearance.VisualParams = (byte[])reader["visual_params"]; | 863 | appearance.VisualParams = (byte[])reader["visual_params"]; |
864 | appearance.Texture = new Primitive.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length); | 864 | appearance.Texture = new Primitive.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length); |
865 | appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]); | 865 | appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]); |
866 | appearance.BodyItem = new UUID((string)reader["body_item"]); | 866 | appearance.BodyItem = new UUID((Guid)reader["body_item"]); |
867 | appearance.BodyAsset = new UUID((string)reader["body_asset"]); | 867 | appearance.BodyAsset = new UUID((Guid)reader["body_asset"]); |
868 | appearance.SkinItem = new UUID((string)reader["skin_item"]); | 868 | appearance.SkinItem = new UUID((Guid)reader["skin_item"]); |
869 | appearance.SkinAsset = new UUID((string)reader["skin_asset"]); | 869 | appearance.SkinAsset = new UUID((Guid)reader["skin_asset"]); |
870 | appearance.HairItem = new UUID((string)reader["hair_item"]); | 870 | appearance.HairItem = new UUID((Guid)reader["hair_item"]); |
871 | appearance.HairAsset = new UUID((string)reader["hair_asset"]); | 871 | appearance.HairAsset = new UUID((Guid)reader["hair_asset"]); |
872 | appearance.EyesItem = new UUID((string)reader["eyes_item"]); | 872 | appearance.EyesItem = new UUID((Guid)reader["eyes_item"]); |
873 | appearance.EyesAsset = new UUID((string)reader["eyes_asset"]); | 873 | appearance.EyesAsset = new UUID((Guid)reader["eyes_asset"]); |
874 | appearance.ShirtItem = new UUID((string)reader["shirt_item"]); | 874 | appearance.ShirtItem = new UUID((Guid)reader["shirt_item"]); |
875 | appearance.ShirtAsset = new UUID((string)reader["shirt_asset"]); | 875 | appearance.ShirtAsset = new UUID((Guid)reader["shirt_asset"]); |
876 | appearance.PantsItem = new UUID((string)reader["pants_item"]); | 876 | appearance.PantsItem = new UUID((Guid)reader["pants_item"]); |
877 | appearance.PantsAsset = new UUID((string)reader["pants_asset"]); | 877 | appearance.PantsAsset = new UUID((Guid)reader["pants_asset"]); |
878 | appearance.ShoesItem = new UUID((string)reader["shoes_item"]); | 878 | appearance.ShoesItem = new UUID((Guid)reader["shoes_item"]); |
879 | appearance.ShoesAsset = new UUID((string)reader["shoes_asset"]); | 879 | appearance.ShoesAsset = new UUID((Guid)reader["shoes_asset"]); |
880 | appearance.SocksItem = new UUID((string)reader["socks_item"]); | 880 | appearance.SocksItem = new UUID((Guid)reader["socks_item"]); |
881 | appearance.SocksAsset = new UUID((string)reader["socks_asset"]); | 881 | appearance.SocksAsset = new UUID((Guid)reader["socks_asset"]); |
882 | appearance.JacketItem = new UUID((string)reader["jacket_item"]); | 882 | appearance.JacketItem = new UUID((Guid)reader["jacket_item"]); |
883 | appearance.JacketAsset = new UUID((string)reader["jacket_asset"]); | 883 | appearance.JacketAsset = new UUID((Guid)reader["jacket_asset"]); |
884 | appearance.GlovesItem = new UUID((string)reader["gloves_item"]); | 884 | appearance.GlovesItem = new UUID((Guid)reader["gloves_item"]); |
885 | appearance.GlovesAsset = new UUID((string)reader["gloves_asset"]); | 885 | appearance.GlovesAsset = new UUID((Guid)reader["gloves_asset"]); |
886 | appearance.UnderShirtItem = new UUID((string)reader["undershirt_item"]); | 886 | appearance.UnderShirtItem = new UUID((Guid)reader["undershirt_item"]); |
887 | appearance.UnderShirtAsset = new UUID((string)reader["undershirt_asset"]); | 887 | appearance.UnderShirtAsset = new UUID((Guid)reader["undershirt_asset"]); |
888 | appearance.UnderPantsItem = new UUID((string)reader["underpants_item"]); | 888 | appearance.UnderPantsItem = new UUID((Guid)reader["underpants_item"]); |
889 | appearance.UnderPantsAsset = new UUID((string)reader["underpants_asset"]); | 889 | appearance.UnderPantsAsset = new UUID((Guid)reader["underpants_asset"]); |
890 | appearance.SkirtItem = new UUID((string)reader["skirt_item"]); | 890 | appearance.SkirtItem = new UUID((Guid)reader["skirt_item"]); |
891 | appearance.SkirtAsset = new UUID((string)reader["skirt_asset"]); | 891 | appearance.SkirtAsset = new UUID((Guid)reader["skirt_asset"]); |
892 | 892 | ||
893 | return appearance; | 893 | return appearance; |
894 | } | 894 | } |
@@ -969,9 +969,9 @@ ELSE | |||
969 | if (reader.Read()) | 969 | if (reader.Read()) |
970 | { | 970 | { |
971 | // Agent IDs | 971 | // Agent IDs |
972 | retval.ProfileID = new UUID((string)reader["UUID"]); | 972 | retval.ProfileID = new UUID((Guid)reader["UUID"]); |
973 | retval.SessionID = new UUID((string)reader["sessionID"]); | 973 | retval.SessionID = new UUID((Guid)reader["sessionID"]); |
974 | retval.SecureSessionID = new UUID((string)reader["secureSessionID"]); | 974 | retval.SecureSessionID = new UUID((Guid)reader["secureSessionID"]); |
975 | 975 | ||
976 | // Agent Who? | 976 | // Agent Who? |
977 | retval.AgentIP = (string)reader["agentIP"]; | 977 | retval.AgentIP = (string)reader["agentIP"]; |
@@ -983,7 +983,7 @@ ELSE | |||
983 | retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); | 983 | retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); |
984 | 984 | ||
985 | // Current position | 985 | // Current position |
986 | retval.Region = (UUID)(string)reader["currentRegion"]; | 986 | retval.Region = new UUID((Guid)reader["currentRegion"]); |
987 | retval.Handle = Convert.ToUInt64(reader["currentHandle"].ToString()); | 987 | retval.Handle = Convert.ToUInt64(reader["currentHandle"].ToString()); |
988 | Vector3 tmp_v; | 988 | Vector3 tmp_v; |
989 | Vector3.TryParse((string)reader["currentPos"], out tmp_v); | 989 | Vector3.TryParse((string)reader["currentPos"], out tmp_v); |
@@ -1110,7 +1110,7 @@ ELSE | |||
1110 | 1110 | ||
1111 | if (reader.Read()) | 1111 | if (reader.Read()) |
1112 | { | 1112 | { |
1113 | retval.ID = new UUID((string)reader["UUID"]); | 1113 | retval.ID = new UUID((Guid)reader["UUID"]); |
1114 | retval.FirstName = (string)reader["username"]; | 1114 | retval.FirstName = (string)reader["username"]; |
1115 | retval.SurName = (string)reader["lastname"]; | 1115 | retval.SurName = (string)reader["lastname"]; |
1116 | 1116 | ||
@@ -1139,9 +1139,9 @@ ELSE | |||
1139 | retval.AboutText = (string)reader["profileAboutText"]; | 1139 | retval.AboutText = (string)reader["profileAboutText"]; |
1140 | retval.FirstLifeAboutText = (string)reader["profileFirstText"]; | 1140 | retval.FirstLifeAboutText = (string)reader["profileFirstText"]; |
1141 | 1141 | ||
1142 | retval.Image = new UUID((string)reader["profileImage"]); | 1142 | retval.Image = new UUID((Guid)reader["profileImage"]); |
1143 | retval.FirstLifeImage = new UUID((string)reader["profileFirstImage"]); | 1143 | retval.FirstLifeImage = new UUID((Guid)reader["profileFirstImage"]); |
1144 | retval.WebLoginKey = new UUID((string)reader["webLoginKey"]); | 1144 | retval.WebLoginKey = new UUID((Guid)reader["webLoginKey"]); |
1145 | } | 1145 | } |
1146 | else | 1146 | else |
1147 | { | 1147 | { |