diff --git a/OpenSim/Data/DB4o/DB4oManager.cs b/OpenSim/Data/DB4o/DB4oManager.cs index d9085c54a7..13bd61c397 100644 --- a/OpenSim/Data/DB4o/DB4oManager.cs +++ b/OpenSim/Data/DB4o/DB4oManager.cs @@ -125,10 +125,10 @@ namespace OpenSim.Data.DB4o IObjectSet result = database.Get(typeof (UserProfileData)); foreach (UserProfileData row in result) { - if (userProfiles.ContainsKey(row.UUID)) - userProfiles[row.UUID] = row; + if (userProfiles.ContainsKey(row.Id)) + userProfiles[row.Id] = row; else - userProfiles.Add(row.UUID, row); + userProfiles.Add(row.Id, row); } database.Close(); } @@ -145,13 +145,13 @@ namespace OpenSim.Data.DB4o /// true on success, false on fail to persist to db public bool UpdateRecord(UserProfileData record) { - if (userProfiles.ContainsKey(record.UUID)) + if (userProfiles.ContainsKey(record.Id)) { - userProfiles[record.UUID] = record; + userProfiles[record.Id] = record; } else { - userProfiles.Add(record.UUID, record); + userProfiles.Add(record.Id, record); } try diff --git a/OpenSim/Data/DB4o/DB4oUserData.cs b/OpenSim/Data/DB4o/DB4oUserData.cs index 62671e375b..d0108ab6a4 100644 --- a/OpenSim/Data/DB4o/DB4oUserData.cs +++ b/OpenSim/Data/DB4o/DB4oUserData.cs @@ -85,7 +85,7 @@ namespace OpenSim.Data.DB4o { foreach (UserProfileData profile in manager.userProfiles.Values) { - if (profile.username == fname && profile.surname == lname) + if (profile.FirstName == fname && profile.SurName == lname) return profile; } return null; @@ -100,7 +100,7 @@ namespace OpenSim.Data.DB4o { try { - return GetUserByUUID(uuid).currentAgent; + return GetUserByUUID(uuid).CurrentAgent; } catch (Exception) { @@ -128,7 +128,7 @@ namespace OpenSim.Data.DB4o { try { - return GetUserByName(fname, lname).currentAgent; + return GetUserByName(fname, lname).CurrentAgent; } catch (Exception) { @@ -138,7 +138,7 @@ namespace OpenSim.Data.DB4o public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) { UserProfileData user = GetUserByUUID(AgentID); - user.webLoginKey = WebLoginKey; + user.WebLoginKey = WebLoginKey; UpdateUserProfile(user); } diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 51540925a5..e33468a52d 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 c045084642..aae0095acf 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); diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 0d3613688d..110f1922b4 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -427,60 +427,71 @@ namespace OpenSim.Data.MySQL if (reader.Read()) { - if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) + LLUUID id; + if (!LLUUID.TryParse((string)reader["UUID"], out id)) return null; - retval.username = (string) reader["username"]; - retval.surname = (string) reader["lastname"]; - retval.passwordHash = (string) reader["passwordHash"]; - retval.passwordSalt = (string) reader["passwordSalt"]; + retval.Id = id; + retval.FirstName = (string) reader["username"]; + retval.SurName = (string) reader["lastname"]; - retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); - retval.homeLocation = new LLVector3( + retval.PasswordHash = (string) reader["passwordHash"]; + retval.PasswordSalt = (string) reader["passwordSalt"]; + + 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()); if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) - retval.profileAboutText = ""; + retval.ProfileAboutText = ""; else - retval.profileAboutText = (string) reader["profileAboutText"]; + retval.ProfileAboutText = (string) reader["profileAboutText"]; if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) - retval.profileFirstText = ""; + retval.ProfileFirstText = ""; else - retval.profileFirstText = (string)reader["profileFirstText"]; + retval.ProfileFirstText = (string)reader["profileFirstText"]; if (reader.IsDBNull(reader.GetOrdinal("profileImage"))) - retval.profileImage = LLUUID.Zero; - else - LLUUID.TryParse((string)reader["profileImage"], out retval.profileImage); + retval.ProfileImage = LLUUID.Zero; + else { + LLUUID tmp; + LLUUID.TryParse((string)reader["profileImage"], out tmp); + retval.ProfileImage = tmp; + } if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage"))) - retval.profileFirstImage = LLUUID.Zero; - else - LLUUID.TryParse((string)reader["profileFirstImage"], out retval.profileFirstImage); + retval.ProfileFirstImage = LLUUID.Zero; + else { + LLUUID tmp; + LLUUID.TryParse((string)reader["profileFirstImage"], out tmp); + retval.ProfileFirstImage = tmp; + } if(reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) { - retval.webLoginKey = LLUUID.Zero; + retval.WebLoginKey = LLUUID.Zero; } else { - LLUUID.TryParse((string)reader["webLoginKey"], out retval.webLoginKey); + LLUUID tmp; + LLUUID.TryParse((string)reader["webLoginKey"], out tmp); + retval.WebLoginKey = tmp; } } else diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index bd094f66dc..56542077df 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL override public UserAgentData GetAgentByName(string user, string last) { UserProfileData profile = GetUserByName(user, last); - return GetAgentByUUID(profile.UUID); + return GetAgentByUUID(profile.Id); } override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) @@ -547,14 +547,14 @@ namespace OpenSim.Data.MySQL { lock (database) { - 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); + database.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) @@ -590,11 +590,11 @@ namespace OpenSim.Data.MySQL /// The profile data to use to update the DB override public bool UpdateUserProfile(UserProfileData user) { - database.updateUserRow(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); + database.updateUserRow(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); return true; } diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index ad3d1a481a..e395565129 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -114,7 +114,7 @@ namespace OpenSim.Data.SQLite row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid)); if (row != null) { - user.currentAgent = buildUserAgent(row); + user.CurrentAgent = buildUserAgent(row); } return user; } @@ -135,10 +135,10 @@ namespace OpenSim.Data.SQLite if (rows.Length > 0) { UserProfileData user = buildUserProfile(rows[0]); - DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(user.UUID)); + DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(user.Id)); if (row != null) { - user.currentAgent = buildUserAgent(row); + user.CurrentAgent = buildUserAgent(row); } return user; } @@ -297,7 +297,7 @@ namespace OpenSim.Data.SQLite { try { - return GetUserByUUID(uuid).currentAgent; + return GetUserByUUID(uuid).CurrentAgent; } catch (Exception) { @@ -325,7 +325,7 @@ namespace OpenSim.Data.SQLite { try { - return GetUserByName(fname, lname).currentAgent; + return GetUserByName(fname, lname).CurrentAgent; } catch (Exception) { @@ -347,7 +347,7 @@ namespace OpenSim.Data.SQLite else { UserProfileData user = GetUserByUUID(AgentID); - user.webLoginKey = WebLoginKey; + user.WebLoginKey = WebLoginKey; fillUserRow(row, user); da.Update(ds, "users"); @@ -365,7 +365,7 @@ namespace OpenSim.Data.SQLite DataTable users = ds.Tables["users"]; lock (ds) { - DataRow row = users.Rows.Find(Util.ToRawUuidString(user.UUID)); + DataRow row = users.Rows.Find(Util.ToRawUuidString(user.Id)); if (row == null) { row = users.NewRow(); @@ -381,19 +381,19 @@ namespace OpenSim.Data.SQLite // useragents table once the useragent is null // // A database guy should look at this and figure out the best way to clear the useragents table. - if (user.currentAgent != null) + if (user.CurrentAgent != null) { DataTable ua = ds.Tables["useragents"]; - row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); + row = ua.Rows.Find(Util.ToRawUuidString(user.Id)); if (row == null) { row = ua.NewRow(); - fillUserAgentRow(row, user.currentAgent); + fillUserAgentRow(row, user.CurrentAgent); ua.Rows.Add(row); } else { - fillUserAgentRow(row, user.currentAgent); + fillUserAgentRow(row, user.CurrentAgent); } } else @@ -401,7 +401,7 @@ namespace OpenSim.Data.SQLite // I just added this to help the standalone login situation. //It still needs to be looked at by a Database guy DataTable ua = ds.Tables["useragents"]; - row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); + row = ua.Rows.Find(Util.ToRawUuidString(user.Id)); if (row == null) { @@ -591,70 +591,74 @@ namespace OpenSim.Data.SQLite // interesting has to be done to actually get these values // back out. Not enough time to figure it out yet. UserProfileData user = new UserProfileData(); - LLUUID.TryParse((String)row["UUID"], out user.UUID); - user.username = (String) row["username"]; - user.surname = (String) row["surname"]; - user.passwordHash = (String) row["passwordHash"]; - user.passwordSalt = (String) row["passwordSalt"]; + LLUUID tmp; + LLUUID.TryParse((String)row["UUID"], out tmp); + user.Id = tmp; + user.FirstName = (String) row["username"]; + user.SurName = (String) row["surname"]; + user.PasswordHash = (String) row["passwordHash"]; + user.PasswordSalt = (String) row["passwordSalt"]; - user.homeRegionX = Convert.ToUInt32(row["homeRegionX"]); - user.homeRegionY = Convert.ToUInt32(row["homeRegionY"]); - user.homeLocation = new LLVector3( + user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]); + user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]); + user.HomeLocation = new LLVector3( Convert.ToSingle(row["homeLocationX"]), Convert.ToSingle(row["homeLocationY"]), Convert.ToSingle(row["homeLocationZ"]) ); - user.homeLookAt = new LLVector3( + user.HomeLookAt = new LLVector3( Convert.ToSingle(row["homeLookAtX"]), Convert.ToSingle(row["homeLookAtY"]), Convert.ToSingle(row["homeLookAtZ"]) ); - user.created = Convert.ToInt32(row["created"]); - user.lastLogin = Convert.ToInt32(row["lastLogin"]); - user.rootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]); - user.userInventoryURI = (String) row["userInventoryURI"]; - user.userAssetURI = (String) row["userAssetURI"]; - user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); - user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]); - user.profileAboutText = (String) row["profileAboutText"]; - user.profileFirstText = (String) row["profileFirstText"]; - LLUUID.TryParse((String)row["profileImage"], out user.profileImage); - LLUUID.TryParse((String)row["profileFirstImage"], out user.profileFirstImage); - user.webLoginKey = new LLUUID((String) row["webLoginKey"]); + user.Created = Convert.ToInt32(row["created"]); + user.LastLogin = Convert.ToInt32(row["lastLogin"]); + user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]); + user.UserInventoryURI = (String) row["userInventoryURI"]; + user.UserAssetURI = (String) row["userAssetURI"]; + user.ProfileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); + user.ProfileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]); + user.ProfileAboutText = (String) row["profileAboutText"]; + user.ProfileFirstText = (String) row["profileFirstText"]; + LLUUID.TryParse((String)row["profileImage"], out tmp); + user.ProfileImage = tmp; + LLUUID.TryParse((String)row["profileFirstImage"], out tmp); + user.ProfileFirstImage = tmp; + user.WebLoginKey = new LLUUID((String) row["webLoginKey"]); return user; } private void fillUserRow(DataRow row, UserProfileData user) { - row["UUID"] = Util.ToRawUuidString(user.UUID); - row["username"] = user.username; - row["surname"] = user.surname; - row["passwordHash"] = user.passwordHash; - row["passwordSalt"] = user.passwordSalt; + row["UUID"] = Util.ToRawUuidString(user.Id); + row["username"] = user.FirstName; + row["surname"] = user.SurName; + row["passwordHash"] = user.PasswordHash; + row["passwordSalt"] = user.PasswordSalt; - row["homeRegionX"] = user.homeRegionX; - row["homeRegionY"] = user.homeRegionY; - row["homeLocationX"] = user.homeLocation.X; - row["homeLocationY"] = user.homeLocation.Y; - row["homeLocationZ"] = user.homeLocation.Z; - row["homeLookAtX"] = user.homeLookAt.X; - row["homeLookAtY"] = user.homeLookAt.Y; - row["homeLookAtZ"] = user.homeLookAt.Z; + row["homeRegionX"] = user.HomeRegionX; + row["homeRegionY"] = user.HomeRegionY; + row["homeLocationX"] = user.HomeLocation.X; + row["homeLocationY"] = user.HomeLocation.Y; + row["homeLocationZ"] = user.HomeLocation.Z; + row["homeLookAtX"] = user.HomeLookAt.X; + row["homeLookAtY"] = user.HomeLookAt.Y; + row["homeLookAtZ"] = user.HomeLookAt.Z; - row["created"] = user.created; - row["lastLogin"] = user.lastLogin; - row["rootInventoryFolderID"] = user.rootInventoryFolderID; - row["userInventoryURI"] = user.userInventoryURI; - row["userAssetURI"] = user.userAssetURI; - row["profileCanDoMask"] = user.profileCanDoMask; - row["profileWantDoMask"] = user.profileWantDoMask; - row["profileAboutText"] = user.profileAboutText; - row["profileFirstText"] = user.profileFirstText; - row["profileImage"] = user.profileImage; - row["profileFirstImage"] = user.profileFirstImage; - row["webLoginKey"] = user.webLoginKey; + row["created"] = user.Created; + row["lastLogin"] = user.LastLogin; + row["rootInventoryFolderID"] = user.RootInventoryFolderID; + row["userInventoryURI"] = user.UserInventoryURI; + row["userAssetURI"] = user.UserAssetURI; + row["profileCanDoMask"] = user.ProfileCanDoMask; + row["profileWantDoMask"] = user.ProfileWantDoMask; + row["profileAboutText"] = user.ProfileAboutText; + row["profileFirstText"] = user.ProfileFirstText; + row["profileImage"] = user.ProfileImage; + row["profileFirstImage"] = user.ProfileFirstImage; + row["webLoginKey"] = user.WebLoginKey; // ADO.NET doesn't handle NULL very well foreach (DataColumn col in ds.Tables["users"].Columns) diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index e39333becf..75fe1aa269 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -114,7 +114,7 @@ namespace OpenSim.Framework.Communications.Cache // "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", // folderInfo.name, folderInfo.folderID, userID); - if (userID == UserProfile.UUID) + if (userID == UserProfile.Id) { if (RootFolder == null) { @@ -169,7 +169,7 @@ namespace OpenSim.Framework.Communications.Cache /// public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) { - if ((userID == UserProfile.UUID) && (RootFolder != null)) + if ((userID == UserProfile.Id) && (RootFolder != null)) { if (itemInfo.Folder == RootFolder.ID) { @@ -194,7 +194,7 @@ namespace OpenSim.Framework.Communications.Cache public void AddItem(LLUUID userID, InventoryItemBase itemInfo) { - if ((userID == UserProfile.UUID) && (RootFolder != null)) + if ((userID == UserProfile.Id) && (RootFolder != null)) { ItemReceive(userID, itemInfo); m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); @@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo) { - if ((userID == UserProfile.UUID) && (RootFolder != null)) + if ((userID == UserProfile.Id) && (RootFolder != null)) { m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); } @@ -212,7 +212,7 @@ namespace OpenSim.Framework.Communications.Cache public bool DeleteItem(LLUUID userID, InventoryItemBase item) { bool result = false; - if ((userID == UserProfile.UUID) && (RootFolder != null)) + if ((userID == UserProfile.Id) && (RootFolder != null)) { result = RootFolder.DeleteItem(item.ID); if (result) diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 95a0e053e2..6b01d8f998 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -164,9 +164,9 @@ namespace OpenSim.Framework.Communications } else { - m_inventoryService.CreateNewUserInventory(userProf.UUID); + m_inventoryService.CreateNewUserInventory(userProf.Id); m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); - return userProf.UUID; + return userProf.Id; } } @@ -249,9 +249,9 @@ namespace OpenSim.Framework.Communications UserProfileData profileData = m_userService.GetUserProfile(uuid); if (profileData != null) { - LLUUID profileId = profileData.UUID; - string firstname = profileData.username; - string lastname = profileData.surname; + LLUUID profileId = profileData.Id; + string firstname = profileData.FirstName; + string lastname = profileData.SurName; remote_client.SendNameReply(profileId, firstname, lastname); } diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 6f558a0e5a..e5ad7a06e1 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -184,13 +184,13 @@ namespace OpenSim.Framework.UserManagement else { // If we already have a session... - if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) + if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) { //TODO: The following statements can cause trouble: // If agentOnline could not turn from true back to false normally // because of some problem, for instance, the crashment of server or client, // the user cannot log in any longer. - userProfile.currentAgent.agentOnline = false; + userProfile.CurrentAgent.agentOnline = false; m_userManager.CommitAgent(ref userProfile); // Reject the login @@ -207,7 +207,7 @@ namespace OpenSim.Framework.UserManagement try { - LLUUID agentID = userProfile.UUID; + LLUUID agentID = userProfile.Id; // Inventory Library Section InventoryData inventData = GetInventorySkeleton(agentID); @@ -217,16 +217,16 @@ namespace OpenSim.Framework.UserManagement InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); ArrayList InventoryRoot = new ArrayList(); InventoryRoot.Add(InventoryRootHash); - userProfile.rootInventoryFolderID = inventData.RootFolderID; + userProfile.RootInventoryFolderID = inventData.RootFolderID; // Circuit Code uint circode = (uint) (Util.RandomClass.Next()); - logResponse.Lastname = userProfile.surname; - logResponse.Firstname = userProfile.username; + logResponse.Lastname = userProfile.SurName; + logResponse.Firstname = userProfile.FirstName; logResponse.AgentID = agentID.ToString(); - logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); - logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); + logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); + logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; logResponse.InventoryLibrary = GetInventoryLibrary(); @@ -334,9 +334,9 @@ namespace OpenSim.Framework.UserManagement else { // If we already have a session... - if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) + if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) { - userProfile.currentAgent = null; + userProfile.CurrentAgent = null; m_userManager.CommitAgent(ref userProfile); // Reject the login @@ -349,7 +349,7 @@ namespace OpenSim.Framework.UserManagement try { - LLUUID agentID = userProfile.UUID; + LLUUID agentID = userProfile.Id; // Inventory Library Section InventoryData inventData = GetInventorySkeleton(agentID); @@ -359,16 +359,16 @@ namespace OpenSim.Framework.UserManagement InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); ArrayList InventoryRoot = new ArrayList(); InventoryRoot.Add(InventoryRootHash); - userProfile.rootInventoryFolderID = inventData.RootFolderID; + userProfile.RootInventoryFolderID = inventData.RootFolderID; // Circuit Code uint circode = (uint)(Util.RandomClass.Next()); - logResponse.Lastname = userProfile.surname; - logResponse.Firstname = userProfile.username; + logResponse.Lastname = userProfile.SurName; + logResponse.Firstname = userProfile.FirstName; logResponse.AgentID = agentID.ToString(); - logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); - logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); + logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); + logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; logResponse.InventoryLibrary = GetInventoryLibrary(); @@ -491,7 +491,7 @@ namespace OpenSim.Framework.UserManagement if (goodweblogin) { LLUUID webloginkey = LLUUID.Random(); - m_userManager.StoreWebLoginKey(user.UUID, webloginkey); + m_userManager.StoreWebLoginKey(user.Id, webloginkey); statuscode = 301; string redirectURL = "about:blank?redirect-http-hack=" + @@ -639,7 +639,7 @@ namespace OpenSim.Framework.UserManagement public virtual bool AuthenticateUser(UserProfileData profile, string password) { bool passwordSuccess = false; - m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); + m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id); // Web Login method seems to also occasionally send the hashed password itself @@ -650,13 +650,13 @@ namespace OpenSim.Framework.UserManagement password = password.Remove(0, 3); //remove $1$ - string s = Util.Md5Hash(password + ":" + profile.passwordSalt); + string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); // Testing... //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash); //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password); - passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) - || profile.passwordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); + passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) + || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); return passwordSuccess; } @@ -664,10 +664,10 @@ namespace OpenSim.Framework.UserManagement public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) { bool passwordSuccess = false; - m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); + m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id); // Match web login key unless it's the default weblogin key LLUUID.Zero - passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); + passwordSuccess = ((profile.WebLoginKey==webloginkey) && profile.WebLoginKey != LLUUID.Zero); return passwordSuccess; } diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 332583cb5c..02be6bdbf2 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -96,7 +96,7 @@ namespace OpenSim.Framework.UserManagement if (profile != null) { - profile.currentAgent = getUserAgent(profile.UUID); + profile.CurrentAgent = getUserAgent(profile.Id); return profile; } } @@ -113,7 +113,7 @@ namespace OpenSim.Framework.UserManagement if (null != profile) { - profile.currentAgent = getUserAgent(profile.UUID); + profile.CurrentAgent = getUserAgent(profile.Id); return profile; } } @@ -298,7 +298,7 @@ namespace OpenSim.Framework.UserManagement public void clearUserAgent(LLUUID agentID) { UserProfileData profile = GetUserProfile(agentID); - profile.currentAgent = null; + profile.CurrentAgent = null; setUserProfile(profile); } @@ -355,28 +355,28 @@ namespace OpenSim.Framework.UserManagement agent.sessionID = new LLUUID(randDataS, 0); // Profile UUID - agent.UUID = profile.UUID; + agent.UUID = profile.Id; // Current position (from Home) - agent.currentHandle = profile.homeRegion; - agent.currentPos = profile.homeLocation; + agent.currentHandle = profile.HomeRegion; + agent.currentPos = profile.HomeLocation; // If user specified additional start, use that if (requestData.ContainsKey("start")) { string startLoc = ((string)requestData["start"]).Trim(); - if (("last" == startLoc) && (profile.currentAgent != null)) + if (("last" == startLoc) && (profile.CurrentAgent != null)) { - if ((profile.currentAgent.currentPos.X > 0) - && (profile.currentAgent.currentPos.Y > 0) - && (profile.currentAgent.currentPos.Z > 0) + if ((profile.CurrentAgent.currentPos.X > 0) + && (profile.CurrentAgent.currentPos.Y > 0) + && (profile.CurrentAgent.currentPos.Z > 0) ) { // TODO: Right now, currentRegion has not been used in GridServer for requesting region. // TODO: It is only using currentHandle. - agent.currentRegion = profile.currentAgent.currentRegion; - agent.currentHandle = profile.currentAgent.currentHandle; - agent.currentPos = profile.currentAgent.currentPos; + agent.currentRegion = profile.CurrentAgent.currentRegion; + agent.currentHandle = profile.CurrentAgent.currentHandle; + agent.currentPos = profile.CurrentAgent.currentPos; } } @@ -406,7 +406,7 @@ namespace OpenSim.Framework.UserManagement agent.regionID = LLUUID.Zero; // Fill in later agent.currentRegion = LLUUID.Zero; // Fill in later - profile.currentAgent = agent; + profile.CurrentAgent = agent; } /// @@ -432,9 +432,9 @@ namespace OpenSim.Framework.UserManagement if (userProfile != null) { // This line needs to be in side the above if statement or the UserServer will crash on some logouts. - m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); + m_log.Info("[LOGOUT]: " + userProfile.FirstName + " " + userProfile.SurName + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); - userAgent = userProfile.currentAgent; + userAgent = userProfile.CurrentAgent; if (userAgent != null) { userAgent.agentOnline = false; @@ -447,7 +447,7 @@ namespace OpenSim.Framework.UserManagement userAgent.currentHandle = regionhandle; userAgent.currentPos = currentPos; - userProfile.currentAgent = userAgent; + userProfile.CurrentAgent = userAgent; CommitAgent(ref userProfile); } @@ -481,11 +481,11 @@ namespace OpenSim.Framework.UserManagement agent.sessionID = new LLUUID(randDataS, 0); // Profile UUID - agent.UUID = profile.UUID; + agent.UUID = profile.Id; // Current position (from Home) - agent.currentHandle = profile.homeRegion; - agent.currentPos = profile.homeLocation; + agent.currentHandle = profile.HomeRegion; + agent.currentPos = profile.HomeLocation; // What time did the user login? agent.loginTime = Util.UnixTimeSinceEpoch(); @@ -495,7 +495,7 @@ namespace OpenSim.Framework.UserManagement agent.regionID = LLUUID.Zero; // Fill in later agent.currentRegion = LLUUID.Zero; // Fill in later - profile.currentAgent = agent; + profile.CurrentAgent = agent; } /// @@ -508,7 +508,7 @@ namespace OpenSim.Framework.UserManagement // TODO: how is this function different from setUserProfile? -> Add AddUserAgent() here and commit both tables "users" and "agents" // TODO: what is the logic should be? bool ret = false; - ret = AddUserAgent(profile.currentAgent); + ret = AddUserAgent(profile.CurrentAgent); ret = ret & setUserProfile(profile); return ret; } @@ -522,16 +522,16 @@ namespace OpenSim.Framework.UserManagement public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) { UserProfileData user = new UserProfileData(); - user.homeLocation = new LLVector3(128, 128, 100); - user.UUID = LLUUID.Random(); - user.username = firstName; - user.surname = lastName; - user.passwordHash = pass; - user.passwordSalt = String.Empty; - user.created = Util.UnixTimeSinceEpoch(); - user.homeLookAt = new LLVector3(100, 100, 100); - user.homeRegionX = regX; - user.homeRegionY = regY; + user.HomeLocation = new LLVector3(128, 128, 100); + user.Id = LLUUID.Random(); + user.FirstName = firstName; + user.SurName = lastName; + user.PasswordHash = pass; + user.PasswordSalt = String.Empty; + user.Created = Util.UnixTimeSinceEpoch(); + user.HomeLookAt = new LLVector3(100, 100, 100); + user.HomeRegionX = regX; + user.HomeRegionY = regY; foreach (KeyValuePair plugin in _plugins) { @@ -545,14 +545,14 @@ namespace OpenSim.Framework.UserManagement } } - return user.UUID; + return user.Id; } public bool UpdateUserProfileProperties(UserProfileData UserProfile) { - if (null == GetUserProfile(UserProfile.UUID)) + if (null == GetUserProfile(UserProfile.Id)) { - m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.UUID.ToString()); + m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.Id.ToString()); return false; } foreach (KeyValuePair plugin in _plugins) @@ -563,7 +563,7 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.UUID.ToString() + m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.Id.ToString() + " via " + plugin.Key + "(" + e.ToString() + ")"); return false; } diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 6a49f0d8f3..016dc8d225 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -38,37 +38,37 @@ namespace OpenSim.Framework /// /// The ID value for this user /// - public LLUUID UUID; + private LLUUID _id; /// /// The last used Web_login_key /// - public LLUUID webLoginKey; + private LLUUID webLoginKey; /// /// The first component of a users account name /// - public string username; + private string username; /// /// The second component of a users account name /// - public string surname; + private string surname; /// /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) /// /// This is double MD5'd because the client sends an unsalted MD5 to the loginserver - public string passwordHash; + private string passwordHash; /// /// The salt used for the users hash, should be 32 bytes or longer /// - public string passwordSalt; + private string passwordSalt; /// /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into /// - public ulong homeRegion + public ulong HomeRegion { get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); } set @@ -78,74 +78,272 @@ namespace OpenSim.Framework } } - public uint homeRegionX; - public uint homeRegionY; + public LLUUID Id { + get { + return _id; + } + set { + _id = value; + } + } + + public LLUUID WebLoginKey { + get { + return webLoginKey; + } + set { + webLoginKey = value; + } + } + + public string FirstName { + get { + return username; + } + set { + username = value; + } + } + + public string SurName { + get { + return surname; + } + set { + surname = value; + } + } + + public string PasswordHash { + get { + return passwordHash; + } + set { + passwordHash = value; + } + } + + public string PasswordSalt { + get { + return passwordSalt; + } + set { + passwordSalt = value; + } + } + + public uint HomeRegionX { + get { + return homeRegionX; + } + set { + homeRegionX = value; + } + } + + public uint HomeRegionY { + get { + return homeRegionY; + } + set { + homeRegionY = value; + } + } + + public LLVector3 HomeLocation { + get { + return homeLocation; + } + set { + homeLocation = value; + } + } + + public LLVector3 HomeLookAt { + get { + return homeLookAt; + } + set { + homeLookAt = value; + } + } + + public int Created { + get { + return created; + } + set { + created = value; + } + } + + public int LastLogin { + get { + return lastLogin; + } + set { + lastLogin = value; + } + } + + public LLUUID RootInventoryFolderID { + get { + return rootInventoryFolderID; + } + set { + rootInventoryFolderID = value; + } + } + + public string UserInventoryURI { + get { + return userInventoryURI; + } + set { + userInventoryURI = value; + } + } + + public string UserAssetURI { + get { + return userAssetURI; + } + set { + userAssetURI = value; + } + } + + public uint ProfileCanDoMask { + get { + return profileCanDoMask; + } + set { + profileCanDoMask = value; + } + } + + public uint ProfileWantDoMask { + get { + return profileWantDoMask; + } + set { + profileWantDoMask = value; + } + } + + public string ProfileAboutText { + get { + return profileAboutText; + } + set { + profileAboutText = value; + } + } + + public string ProfileFirstText { + get { + return profileFirstText; + } + set { + profileFirstText = value; + } + } + + public LLUUID ProfileImage { + get { + return profileImage; + } + set { + profileImage = value; + } + } + + public LLUUID ProfileFirstImage { + get { + return profileFirstImage; + } + set { + profileFirstImage = value; + } + } + + public UserAgentData CurrentAgent { + get { + return currentAgent; + } + set { + currentAgent = value; + } + } + + private uint homeRegionX; + private uint homeRegionY; /// /// The coordinates inside the region of the home location /// - public LLVector3 homeLocation; + private LLVector3 homeLocation; /// /// Where the user will be looking when they rez. /// - public LLVector3 homeLookAt; + private LLVector3 homeLookAt; /// /// A UNIX Timestamp (seconds since epoch) for the users creation /// - public int created; + private int created; /// /// A UNIX Timestamp for the users last login date / time /// - public int lastLogin; + private int lastLogin; - public LLUUID rootInventoryFolderID; + private LLUUID rootInventoryFolderID; /// /// A URI to the users inventory server, used for foreigners and large grids /// - public string userInventoryURI = String.Empty; + private string userInventoryURI = String.Empty; /// /// A URI to the users asset server, used for foreigners and large grids. /// - public string userAssetURI = String.Empty; + private string userAssetURI = String.Empty; /// /// A uint mask containing the "I can do" fields of the users profile /// - public uint profileCanDoMask; + private uint profileCanDoMask; /// /// A uint mask containing the "I want to do" part of the users profile /// - public uint profileWantDoMask; // Profile window "I want to" mask + private uint profileWantDoMask; // Profile window "I want to" mask /// /// The about text listed in a users profile. /// - public string profileAboutText = String.Empty; + private string profileAboutText = String.Empty; /// /// The first life about text listed in a users profile /// - public string profileFirstText = String.Empty; + private string profileFirstText = String.Empty; /// /// The profile image for an avatar stored on the asset server /// - public LLUUID profileImage; + private LLUUID profileImage; /// /// The profile image for the users first life tab /// - public LLUUID profileFirstImage; + private LLUUID profileFirstImage; /// /// The users last registered agent (filled in on the user server) /// - public UserAgentData currentAgent; + private UserAgentData currentAgent; } } diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index d40995196f..f6554155a9 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -85,14 +85,14 @@ namespace OpenSim.Grid.UserServer { SimInfo = RegionProfileData.RequestSimProfileData( - theUser.currentAgent.currentHandle, m_config.GridServerURL, + theUser.CurrentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else if (startLocationRequest == "home") { SimInfo = RegionProfileData.RequestSimProfileData( - theUser.homeRegion, m_config.GridServerURL, + theUser.HomeRegion, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else @@ -104,7 +104,7 @@ namespace OpenSim.Grid.UserServer // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' SimInfo = RegionProfileData.RequestSimProfileData( - theUser.currentAgent.currentHandle, m_config.GridServerURL, + theUser.CurrentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else @@ -120,7 +120,7 @@ namespace OpenSim.Grid.UserServer m_log.Info("[LOGIN]: Didn't find region with a close name match sending to home location"); SimInfo = RegionProfileData.RequestSimProfileData( - theUser.homeRegion, m_config.GridServerURL, + theUser.HomeRegion, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else { start_x = Convert.ToInt32(startLocationRequestParsed[1]); @@ -135,10 +135,10 @@ namespace OpenSim.Grid.UserServer //CFK: m_log.Info("[LOGIN]: Home Location"); response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + - "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + - "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; + "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + + "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; // Destination //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into @@ -164,25 +164,25 @@ namespace OpenSim.Grid.UserServer //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); - theUser.currentAgent.currentRegion = SimInfo.UUID; - theUser.currentAgent.currentHandle = SimInfo.regionHandle; + theUser.CurrentAgent.currentRegion = SimInfo.UUID; + theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; if (start_x >= 0 && start_y >= 0 && start_z >= 0) { - theUser.currentAgent.currentPos.X = start_x; - theUser.currentAgent.currentPos.Y = start_y; - theUser.currentAgent.currentPos.Z = start_z; + theUser.CurrentAgent.currentPos.X = start_x; + theUser.CurrentAgent.currentPos.Y = start_y; + theUser.CurrentAgent.currentPos.Z = start_z; } // Prepare notification Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); - SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); - SimParams["firstname"] = theUser.username; - SimParams["lastname"] = theUser.surname; - SimParams["agent_id"] = theUser.UUID.ToString(); + SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); + SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); + SimParams["firstname"] = theUser.FirstName; + SimParams["lastname"] = theUser.SurName; + SimParams["agent_id"] = theUser.Id.ToString(); SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); - SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); - SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); - SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); - SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); + SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); + SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); + SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); SimParams["caps_path"] = capsPath; ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams); @@ -206,9 +206,9 @@ namespace OpenSim.Grid.UserServer if (handlerUserLoggedInAtLocation != null) { m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, - theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos.X,theUser.currentAgent.currentPos.Y,theUser.currentAgent.currentPos.Z, - theUser.username,theUser.surname); + handlerUserLoggedInAtLocation(theUser.Id, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, + theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X,theUser.CurrentAgent.currentPos.Y,theUser.CurrentAgent.currentPos.Z, + theUser.FirstName,theUser.SurName); } } catch (Exception) @@ -237,10 +237,10 @@ namespace OpenSim.Grid.UserServer m_log.Info("[LOGIN]: Home Location"); response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + - "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + - "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; + "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + + "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; // Destination m_log.Info("[LOGIN]: " + @@ -259,21 +259,21 @@ namespace OpenSim.Grid.UserServer m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); // Update agent with target sim - theUser.currentAgent.currentRegion = SimInfo.UUID; - theUser.currentAgent.currentHandle = SimInfo.regionHandle; + theUser.CurrentAgent.currentRegion = SimInfo.UUID; + theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; // Prepare notification Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); - SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString(); - SimParams["firstname"] = theUser.username; - SimParams["lastname"] = theUser.surname; - SimParams["agent_id"] = theUser.UUID.ToString(); + SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); + SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); + SimParams["firstname"] = theUser.FirstName; + SimParams["lastname"] = theUser.SurName; + SimParams["agent_id"] = theUser.Id.ToString(); SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); - SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); - SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); - SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); - SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); + SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); + SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); + SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); SimParams["caps_path"] = capsPath; ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams); @@ -286,9 +286,9 @@ namespace OpenSim.Grid.UserServer if (handlerUserLoggedInAtLocation != null) { m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, - theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos.X, theUser.currentAgent.currentPos.Y, theUser.currentAgent.currentPos.Z, - theUser.username, theUser.surname); + handlerUserLoggedInAtLocation(theUser.Id, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, + theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X, theUser.CurrentAgent.currentPos.Y, theUser.CurrentAgent.currentPos.Z, + theUser.FirstName, theUser.SurName); } } diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index a6695c95dc..cf05bfd8fa 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -125,31 +125,31 @@ namespace OpenSim.Grid.UserServer Hashtable responseData = new Hashtable(); // Account information - responseData["firstname"] = profile.username; - responseData["lastname"] = profile.surname; - responseData["uuid"] = profile.UUID.ToString(); + responseData["firstname"] = profile.FirstName; + responseData["lastname"] = profile.SurName; + responseData["uuid"] = profile.Id.ToString(); // Server Information - responseData["server_inventory"] = profile.userInventoryURI; - responseData["server_asset"] = profile.userAssetURI; + responseData["server_inventory"] = profile.UserInventoryURI; + responseData["server_asset"] = profile.UserAssetURI; // Profile Information - responseData["profile_about"] = profile.profileAboutText; - responseData["profile_firstlife_about"] = profile.profileFirstText; - responseData["profile_firstlife_image"] = profile.profileFirstImage.ToString(); - responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); - responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); - responseData["profile_image"] = profile.profileImage.ToString(); - responseData["profile_created"] = profile.created.ToString(); - responseData["profile_lastlogin"] = profile.lastLogin.ToString(); + responseData["profile_about"] = profile.ProfileAboutText; + responseData["profile_firstlife_about"] = profile.ProfileFirstText; + responseData["profile_firstlife_image"] = profile.ProfileFirstImage.ToString(); + responseData["profile_can_do"] = profile.ProfileCanDoMask.ToString(); + responseData["profile_want_do"] = profile.ProfileWantDoMask.ToString(); + responseData["profile_image"] = profile.ProfileImage.ToString(); + responseData["profile_created"] = profile.Created.ToString(); + responseData["profile_lastlogin"] = profile.LastLogin.ToString(); // Home region information - responseData["home_coordinates_x"] = profile.homeLocation.X.ToString(); - responseData["home_coordinates_y"] = profile.homeLocation.Y.ToString(); - responseData["home_coordinates_z"] = profile.homeLocation.Z.ToString(); + responseData["home_coordinates_x"] = profile.HomeLocation.X.ToString(); + responseData["home_coordinates_y"] = profile.HomeLocation.Y.ToString(); + responseData["home_coordinates_z"] = profile.HomeLocation.Z.ToString(); - responseData["home_region"] = profile.homeRegion.ToString(); + responseData["home_region"] = profile.HomeRegion.ToString(); - responseData["home_look_x"] = profile.homeLookAt.X.ToString(); - responseData["home_look_y"] = profile.homeLookAt.Y.ToString(); - responseData["home_look_z"] = profile.homeLookAt.Z.ToString(); + responseData["home_look_x"] = profile.HomeLookAt.X.ToString(); + responseData["home_look_y"] = profile.HomeLookAt.Y.ToString(); + responseData["home_look_z"] = profile.HomeLookAt.Z.ToString(); response.Value = responseData; return response; @@ -341,11 +341,11 @@ namespace OpenSim.Grid.UserServer } if (requestData.Contains("FLImageID")) { - userProfile.profileFirstImage = new LLUUID((string)requestData["FLImageID"]); + userProfile.ProfileFirstImage = new LLUUID((string)requestData["FLImageID"]); } if (requestData.Contains("ImageID")) { - userProfile.profileImage = new LLUUID((string)requestData["ImageID"]); + userProfile.ProfileImage = new LLUUID((string)requestData["ImageID"]); } // dont' know how yet if (requestData.Contains("MaturePublish")) @@ -353,11 +353,11 @@ namespace OpenSim.Grid.UserServer } if (requestData.Contains("AboutText")) { - userProfile.profileAboutText = (string)requestData["AboutText"]; + userProfile.ProfileAboutText = (string)requestData["AboutText"]; } if (requestData.Contains("FLAboutText")) { - userProfile.profileFirstText = (string)requestData["FLAboutText"]; + userProfile.ProfileFirstText = (string)requestData["FLAboutText"]; } // not in DB yet. if (requestData.Contains("ProfileURL")) diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index a91987f264..e8c3f7c2a2 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -3100,11 +3100,11 @@ namespace OpenSim.Region.ClientStack { AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = Packet.PropertiesData; UserProfileData UserProfile = new UserProfileData(); - UserProfile.UUID = AgentId; - UserProfile.profileAboutText = Helpers.FieldToUTF8String(Properties.AboutText); - UserProfile.profileFirstText = Helpers.FieldToUTF8String(Properties.FLAboutText); - UserProfile.profileFirstImage = Properties.FLImageID; - UserProfile.profileImage = Properties.ImageID; + UserProfile.Id = AgentId; + UserProfile.ProfileAboutText = Helpers.FieldToUTF8String(Properties.AboutText); + UserProfile.ProfileFirstText = Helpers.FieldToUTF8String(Properties.FLAboutText); + UserProfile.ProfileFirstImage = Properties.FLImageID; + UserProfile.ProfileImage = Properties.ImageID; handlerUpdateAvatarProperties(this, UserProfile); } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 4dd58f2ebd..e91cab554f 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -149,8 +149,8 @@ namespace OpenSim.Region.ClientStack if (masterAvatar != null) { - m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.UUID.ToString() + "]"); - scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; + m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.Id.ToString() + "]"); + scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.Id; } else { diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 4632716424..d1d3e220d1 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -87,7 +87,7 @@ namespace OpenSim.Region.Communications.Local profile = m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { - m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); + m_Parent.InventoryService.CreateNewUserInventory(profile.Id); } return profile; @@ -107,17 +107,17 @@ namespace OpenSim.Region.Communications.Local else { m_log.Info( - "[LOGIN]: Authenticating " + profile.username + " " + profile.surname); + "[LOGIN]: Authenticating " + profile.FirstName + " " + profile.SurName); if (!password.StartsWith("$1$")) password = "$1$" + Util.Md5Hash(password); password = password.Remove(0, 3); //remove $1$ - string s = Util.Md5Hash(password + ":" + profile.passwordSalt); + string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); - bool loginresult = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) - || profile.passwordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); + bool loginresult = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) + || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); return loginresult; } } @@ -127,18 +127,18 @@ namespace OpenSim.Region.Communications.Local ulong currentRegion = 0; if (startLocationRequest == "last") { - currentRegion = theUser.currentAgent.currentHandle; + currentRegion = theUser.CurrentAgent.currentHandle; } else if (startLocationRequest == "home") { - currentRegion = theUser.homeRegion; + currentRegion = theUser.HomeRegion; } else { m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it"); // LocalBackEndServices can't possibly look up a region by name :( // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z' - currentRegion = theUser.currentAgent.currentHandle; + currentRegion = theUser.CurrentAgent.currentHandle; } RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); @@ -147,10 +147,10 @@ namespace OpenSim.Region.Communications.Local { response.Home = "{'region_handle':[r" + (reg.RegionLocX * Constants.RegionSize).ToString() + ",r" + (reg.RegionLocY * Constants.RegionSize).ToString() + "], " + - "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + - "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + - theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; + "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + + "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); response.SimAddress = reg.ExternalEndPoint.Address.ToString(); response.SimPort = (uint) reg.ExternalEndPoint.Port; @@ -164,12 +164,12 @@ namespace OpenSim.Region.Communications.Local "[CAPS]: Sending new CAPS seed url {0} to client {1}", response.SeedCapability, response.AgentID); - theUser.currentAgent.currentRegion = reg.RegionID; - theUser.currentAgent.currentHandle = reg.RegionHandle; + theUser.CurrentAgent.currentRegion = reg.RegionID; + theUser.CurrentAgent.currentHandle = reg.RegionHandle; LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); - response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.UUID)); + response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.Id)); Login _login = new Login(); //copy data to login object diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index c31367f7ef..00514e87b8 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -84,7 +84,7 @@ namespace OpenSim.Region.Communications.Local } else { - m_inventoryService.CreateNewUserInventory(profile.UUID); + m_inventoryService.CreateNewUserInventory(profile.Id); } return profile; diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 79e323a737..9796cf411d 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -60,24 +60,24 @@ namespace OpenSim.Region.Communications.OGS1 } UserProfileData userData = new UserProfileData(); - userData.username = (string) data["firstname"]; - userData.surname = (string) data["lastname"]; - userData.UUID = new LLUUID((string) data["uuid"]); - userData.userInventoryURI = (string) data["server_inventory"]; - userData.userAssetURI = (string) data["server_asset"]; - userData.profileFirstText = (string) data["profile_firstlife_about"]; - userData.profileFirstImage = new LLUUID((string) data["profile_firstlife_image"]); - userData.profileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]); - userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); - userData.profileAboutText = (string)data["profile_about"]; - userData.profileImage = new LLUUID((string) data["profile_image"]); - userData.lastLogin = Convert.ToInt32((string) data["profile_lastlogin"]); - userData.homeRegion = Convert.ToUInt64((string) data["home_region"]); - userData.homeLocation = + userData.FirstName = (string) data["firstname"]; + userData.SurName = (string) data["lastname"]; + userData.Id = new LLUUID((string) data["uuid"]); + userData.UserInventoryURI = (string) data["server_inventory"]; + userData.UserAssetURI = (string) data["server_asset"]; + userData.ProfileFirstText = (string) data["profile_firstlife_about"]; + userData.ProfileFirstImage = new LLUUID((string) data["profile_firstlife_image"]); + userData.ProfileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]); + userData.ProfileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); + userData.ProfileAboutText = (string)data["profile_about"]; + userData.ProfileImage = new LLUUID((string) data["profile_image"]); + userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]); + userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]); + userData.HomeLocation = new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]), (float) Convert.ToDecimal((string) data["home_coordinates_y"]), (float) Convert.ToDecimal((string) data["home_coordinates_z"])); - userData.homeLookAt = + userData.HomeLookAt = new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]), (float) Convert.ToDecimal((string) data["home_look_y"]), (float) Convert.ToDecimal((string) data["home_look_z"])); @@ -306,13 +306,13 @@ namespace OpenSim.Region.Communications.OGS1 { m_log.Debug("[OGS1 USER SERVICES]: Asking UserServer to update profile."); Hashtable param = new Hashtable(); - param["avatar_uuid"] = UserProfile.UUID.ToString(); + param["avatar_uuid"] = UserProfile.Id.ToString(); //param["AllowPublish"] = UserProfile.ToString(); - param["FLImageID"] = UserProfile.profileFirstImage.ToString(); - param["ImageID"] = UserProfile.profileImage.ToString(); + param["FLImageID"] = UserProfile.ProfileFirstImage.ToString(); + param["ImageID"] = UserProfile.ProfileImage.ToString(); //param["MaturePublish"] = MaturePublish.ToString(); - param["AboutText"] = UserProfile.profileAboutText; - param["FLAboutText"] = UserProfile.profileFirstText; + param["AboutText"] = UserProfile.ProfileAboutText; + param["FLAboutText"] = UserProfile.ProfileFirstText; //param["ProfileURL"] = UserProfile.ProfileURL.ToString(); IList parameters = new ArrayList(); parameters.Add(param); diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index a8bbed10f5..a82f4bee12 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.DataSnapshot { XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(userOwnerUUID); - username.InnerText = userProfile.username + " " + userProfile.surname; + username.InnerText = userProfile.FirstName + " " + userProfile.SurName; userblock.AppendChild(username); } catch (Exception) diff --git a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs index 0ead5f78a5..699e68dc87 100644 --- a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs @@ -90,10 +90,10 @@ namespace OpenSim.Region.Environment.Modules UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID); if (null != profile) { - remoteClient.SendAvatarProperties(profile.UUID, profile.profileAboutText, - Util.ToDateTime(profile.created).ToString(), - System.String.Empty, profile.profileFirstText, profile.profileCanDoMask, - profile.profileFirstImage, profile.profileImage, System.String.Empty, partner); + remoteClient.SendAvatarProperties(profile.Id, profile.ProfileAboutText, + Util.ToDateTime(profile.Created).ToString(), + System.String.Empty, profile.ProfileFirstText, profile.ProfileCanDoMask, + profile.ProfileFirstImage, profile.ProfileImage, System.String.Empty, partner); } else { @@ -103,15 +103,15 @@ namespace OpenSim.Region.Environment.Modules public void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData newProfile) { - UserProfileData Profile = m_scene.CommsManager.UserService.GetUserProfile(newProfile.UUID); + UserProfileData Profile = m_scene.CommsManager.UserService.GetUserProfile(newProfile.Id); // if it's the profile of the user requesting the update, then we change only a few things. - if (remoteClient.AgentId.CompareTo(Profile.UUID) == 0) + if (remoteClient.AgentId.CompareTo(Profile.Id) == 0) { - Profile.profileImage = newProfile.profileImage; - Profile.profileFirstImage = newProfile.profileFirstImage; - Profile.profileAboutText = newProfile.profileAboutText; - Profile.profileFirstText = newProfile.profileFirstText; + Profile.ProfileImage = newProfile.ProfileImage; + Profile.ProfileFirstImage = newProfile.ProfileFirstImage; + Profile.ProfileAboutText = newProfile.ProfileAboutText; + Profile.ProfileFirstText = newProfile.ProfileFirstText; } else { @@ -119,7 +119,7 @@ namespace OpenSim.Region.Environment.Modules } if (m_scene.CommsManager.UserService.UpdateUserProfileProperties(Profile)) { - RequestAvatarProperty(remoteClient, newProfile.UUID); + RequestAvatarProperty(remoteClient, newProfile.Id); } } } diff --git a/OpenSim/Region/Environment/Modules/VoiceModule.cs b/OpenSim/Region/Environment/Modules/VoiceModule.cs index b2545070f2..8ca4698e11 100644 --- a/OpenSim/Region/Environment/Modules/VoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/VoiceModule.cs @@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Modules if (null == userInfo) throw new Exception("cannot get user details"); LLSDVoiceAccountResponse voiceAccountResponse = - new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.passwordHash); + new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.PasswordHash); string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r); return r; diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 50bd3867a2..a070248bf5 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -407,7 +407,7 @@ namespace OpenSim.Region.ScriptEngine.Common UserProfileData profile = World.CommsManager.UserService.GetUserProfile(objecUUID); if (profile != null) { - string avatarname = profile.username + " " + profile.surname; + string avatarname = profile.FirstName + " " + profile.SurName; return avatarname; } // try an scene object diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs index c025b5b880..fd8dbd108c 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs @@ -272,7 +272,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID); if (profile != null) { - avatarname = profile.username + " " + profile.surname; + avatarname = profile.FirstName + " " + profile.SurName; } // try an scene object SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);