From c176caeb05c2264654b764e4d010561da60c24fc Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 10 Apr 2008 13:53:06 +0000 Subject: moved fields to properties for UserDataProfile, which was actually a little more work than I expected given the copious use of out params. --- OpenSim/Data/MSSQL/MSSQLManager.cs | 38 ++++++++++----------- OpenSim/Data/MSSQL/MSSQLUserData.cs | 68 ++++++++++++++++++------------------- 2 files changed, 53 insertions(+), 53 deletions(-) (limited to 'OpenSim/Data/MSSQL') diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 5154092..e33468a 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -300,38 +300,38 @@ namespace OpenSim.Data.MSSQL if (reader.Read()) { - retval.UUID = new LLUUID((string)reader["UUID"]); - retval.username = (string)reader["username"]; - retval.surname = (string)reader["lastname"]; + retval.Id = new LLUUID((string)reader["UUID"]); + retval.FirstName = (string)reader["username"]; + retval.SurName = (string)reader["lastname"]; - retval.passwordHash = (string)reader["passwordHash"]; - retval.passwordSalt = (string)reader["passwordSalt"]; + retval.PasswordHash = (string)reader["passwordHash"]; + retval.PasswordSalt = (string)reader["passwordSalt"]; - retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); - retval.homeLocation = new LLVector3( + retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); + retval.HomeLocation = new LLVector3( Convert.ToSingle(reader["homeLocationX"].ToString()), Convert.ToSingle(reader["homeLocationY"].ToString()), Convert.ToSingle(reader["homeLocationZ"].ToString())); - retval.homeLookAt = new LLVector3( + retval.HomeLookAt = new LLVector3( Convert.ToSingle(reader["homeLookAtX"].ToString()), Convert.ToSingle(reader["homeLookAtY"].ToString()), Convert.ToSingle(reader["homeLookAtZ"].ToString())); - retval.created = Convert.ToInt32(reader["created"].ToString()); - retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); + retval.Created = Convert.ToInt32(reader["created"].ToString()); + retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); - retval.userInventoryURI = (string)reader["userInventoryURI"]; - retval.userAssetURI = (string)reader["userAssetURI"]; + retval.UserInventoryURI = (string)reader["userInventoryURI"]; + retval.UserAssetURI = (string)reader["userAssetURI"]; - retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); - retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); + retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); + retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); - retval.profileAboutText = (string)reader["profileAboutText"]; - retval.profileFirstText = (string)reader["profileFirstText"]; + retval.ProfileAboutText = (string)reader["profileAboutText"]; + retval.ProfileFirstText = (string)reader["profileFirstText"]; - retval.profileImage = new LLUUID((string)reader["profileImage"]); - retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]); - retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]); + retval.ProfileImage = new LLUUID((string)reader["profileImage"]); + retval.ProfileFirstImage = new LLUUID((string)reader["profileFirstImage"]); + retval.WebLoginKey = new LLUUID((string)reader["webLoginKey"]); } else { diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index c045084..aae0095 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -453,7 +453,7 @@ namespace OpenSim.Data.MSSQL override public UserAgentData GetAgentByName(string user, string last) { UserProfileData profile = GetUserByName(user, last); - return GetAgentByUUID(profile.UUID); + return GetAgentByUUID(profile.Id); } /// @@ -491,7 +491,7 @@ namespace OpenSim.Data.MSSQL override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) { UserProfileData user = GetUserByUUID(AgentID); - user.webLoginKey = WebLoginKey; + user.WebLoginKey = WebLoginKey; UpdateUserProfile(user); } @@ -505,14 +505,14 @@ namespace OpenSim.Data.MSSQL { lock (database) { - InsertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, - user.homeRegion, user.homeLocation.X, user.homeLocation.Y, - user.homeLocation.Z, - user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, - user.lastLogin, user.userInventoryURI, user.userAssetURI, - user.profileCanDoMask, user.profileWantDoMask, - user.profileAboutText, user.profileFirstText, user.profileImage, - user.profileFirstImage, user.webLoginKey); + InsertUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, + user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, + user.HomeLocation.Z, + user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, + user.LastLogin, user.UserInventoryURI, user.UserAssetURI, + user.ProfileCanDoMask, user.ProfileWantDoMask, + user.ProfileAboutText, user.ProfileFirstText, user.ProfileImage, + user.ProfileFirstImage, user.WebLoginKey); } } catch (Exception e) @@ -651,30 +651,30 @@ namespace OpenSim.Data.MSSQL "profileFirstImage = @profileFirstImage, " + "webLoginKey = @webLoginKey where " + "UUID = @keyUUUID;", database.getConnection()); - SqlParameter param1 = new SqlParameter("@uuid", user.UUID.ToString()); - SqlParameter param2 = new SqlParameter("@username", user.username); - SqlParameter param3 = new SqlParameter("@lastname", user.surname); - SqlParameter param4 = new SqlParameter("@passwordHash", user.passwordHash); - SqlParameter param5 = new SqlParameter("@passwordSalt", user.passwordSalt); - SqlParameter param6 = new SqlParameter("@homeRegion", Convert.ToInt64(user.homeRegion)); - SqlParameter param7 = new SqlParameter("@homeLocationX", user.homeLocation.X); - SqlParameter param8 = new SqlParameter("@homeLocationY", user.homeLocation.Y); - SqlParameter param9 = new SqlParameter("@homeLocationZ", user.homeLocation.Y); - SqlParameter param10 = new SqlParameter("@homeLookAtX", user.homeLookAt.X); - SqlParameter param11 = new SqlParameter("@homeLookAtY", user.homeLookAt.Y); - SqlParameter param12 = new SqlParameter("@homeLookAtZ", user.homeLookAt.Z); - SqlParameter param13 = new SqlParameter("@created", Convert.ToInt32(user.created)); - SqlParameter param14 = new SqlParameter("@lastLogin", Convert.ToInt32(user.lastLogin)); - SqlParameter param15 = new SqlParameter("@userInventoryURI", user.userInventoryURI); - SqlParameter param16 = new SqlParameter("@userAssetURI", user.userAssetURI); - SqlParameter param17 = new SqlParameter("@profileCanDoMask", Convert.ToInt32(user.profileCanDoMask)); - SqlParameter param18 = new SqlParameter("@profileWantDoMask", Convert.ToInt32(user.profileWantDoMask)); - SqlParameter param19 = new SqlParameter("@profileAboutText", user.profileAboutText); - SqlParameter param20 = new SqlParameter("@profileFirstText", user.profileFirstText); - SqlParameter param21 = new SqlParameter("@profileImage", user.profileImage.ToString()); - SqlParameter param22 = new SqlParameter("@profileFirstImage", user.profileFirstImage.ToString()); - SqlParameter param23 = new SqlParameter("@keyUUUID", user.UUID.ToString()); - SqlParameter param24 = new SqlParameter("@webLoginKey", user.webLoginKey.UUID.ToString()); + SqlParameter param1 = new SqlParameter("@uuid", user.Id.ToString()); + SqlParameter param2 = new SqlParameter("@username", user.FirstName); + SqlParameter param3 = new SqlParameter("@lastname", user.SurName); + SqlParameter param4 = new SqlParameter("@passwordHash", user.PasswordHash); + SqlParameter param5 = new SqlParameter("@passwordSalt", user.PasswordSalt); + SqlParameter param6 = new SqlParameter("@homeRegion", Convert.ToInt64(user.HomeRegion)); + SqlParameter param7 = new SqlParameter("@homeLocationX", user.HomeLocation.X); + SqlParameter param8 = new SqlParameter("@homeLocationY", user.HomeLocation.Y); + SqlParameter param9 = new SqlParameter("@homeLocationZ", user.HomeLocation.Y); + SqlParameter param10 = new SqlParameter("@homeLookAtX", user.HomeLookAt.X); + SqlParameter param11 = new SqlParameter("@homeLookAtY", user.HomeLookAt.Y); + SqlParameter param12 = new SqlParameter("@homeLookAtZ", user.HomeLookAt.Z); + SqlParameter param13 = new SqlParameter("@created", Convert.ToInt32(user.Created)); + SqlParameter param14 = new SqlParameter("@lastLogin", Convert.ToInt32(user.LastLogin)); + SqlParameter param15 = new SqlParameter("@userInventoryURI", user.UserInventoryURI); + SqlParameter param16 = new SqlParameter("@userAssetURI", user.UserAssetURI); + SqlParameter param17 = new SqlParameter("@profileCanDoMask", Convert.ToInt32(user.ProfileCanDoMask)); + SqlParameter param18 = new SqlParameter("@profileWantDoMask", Convert.ToInt32(user.ProfileWantDoMask)); + SqlParameter param19 = new SqlParameter("@profileAboutText", user.ProfileAboutText); + SqlParameter param20 = new SqlParameter("@profileFirstText", user.ProfileFirstText); + SqlParameter param21 = new SqlParameter("@profileImage", user.ProfileImage.ToString()); + SqlParameter param22 = new SqlParameter("@profileFirstImage", user.ProfileFirstImage.ToString()); + SqlParameter param23 = new SqlParameter("@keyUUUID", user.Id.ToString()); + SqlParameter param24 = new SqlParameter("@webLoginKey", user.WebLoginKey.UUID.ToString()); command.Parameters.Add(param1); command.Parameters.Add(param2); command.Parameters.Add(param3); -- cgit v1.1