From e3157e61aa50d057b4345cb9d49c973afeb26b15 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 14 Aug 2008 00:04:37 +0000 Subject: Mantis #1946 Thank you, HomerHorwitz, for a patch that corrects and improves TP to landmark and home position handling. --- OpenSim/Data/MySQL/MySQLManager.cs | 10 ++++++++-- OpenSim/Data/MySQL/MySQLUserData.cs | 2 +- OpenSim/Data/SQLite/SQLiteUserData.cs | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 89d0672..297b1a7 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -538,6 +538,10 @@ namespace OpenSim.Data.MySQL Convert.ToSingle(reader["homeLookAtY"].ToString()), Convert.ToSingle(reader["homeLookAtZ"].ToString())); + LLUUID regionID = LLUUID.Zero; + LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero + retval.HomeRegionID = regionID; + retval.Created = Convert.ToInt32(reader["created"].ToString()); retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); @@ -583,6 +587,7 @@ namespace OpenSim.Data.MySQL LLUUID.TryParse((string)reader["webLoginKey"], out tmp); retval.WebLoginKey = tmp; } + } else { @@ -806,7 +811,7 @@ namespace OpenSim.Data.MySQL /// UUID for weblogin Key /// Success? public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash, - string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, + string passwordSalt, UInt64 homeRegion, LLUUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ, float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText, @@ -814,7 +819,7 @@ namespace OpenSim.Data.MySQL { string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; - sql += "`homeRegion` = ?homeRegion , `homeLocationX` = ?homeLocationX , "; + sql += "`homeRegion` = ?homeRegion , `homeRegionID` = ?homeRegionID, `homeLocationX` = ?homeLocationX , "; sql += "`homeLocationY` = ?homeLocationY , `homeLocationZ` = ?homeLocationZ , "; sql += "`homeLookAtX` = ?homeLookAtX , `homeLookAtY` = ?homeLookAtY , "; sql += "`homeLookAtZ` = ?homeLookAtZ , `created` = ?created , `lastLogin` = ?lastLogin , "; @@ -831,6 +836,7 @@ namespace OpenSim.Data.MySQL parameters["?passwordHash"] = passwordHash.ToString(); parameters["?passwordSalt"] = passwordSalt.ToString(); parameters["?homeRegion"] = homeRegion.ToString(); + parameters["?homeRegionID"] = homeRegionID.ToString(); parameters["?homeLocationX"] = homeLocX.ToString(); parameters["?homeLocationY"] = homeLocY.ToString(); parameters["?homeLocationZ"] = homeLocZ.ToString(); diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 131823a..d7bf2a8 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -682,7 +682,7 @@ namespace OpenSim.Data.MySQL lock (database) { 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.HomeRegion, user.HomeRegionID, 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.CanDoMask, user.WantDoMask, user.AboutText, user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 45b4dc6..21c9dbc 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -662,6 +662,7 @@ namespace OpenSim.Data.SQLite SQLiteUtil.createCol(users, "homeRegionX", typeof (Int32)); SQLiteUtil.createCol(users, "homeRegionY", typeof (Int32)); + SQLiteUtil.createCol(users, "homeRegionID", typeof (String)); SQLiteUtil.createCol(users, "homeLocationX", typeof (Double)); SQLiteUtil.createCol(users, "homeLocationY", typeof (Double)); SQLiteUtil.createCol(users, "homeLocationZ", typeof (Double)); @@ -769,6 +770,11 @@ namespace OpenSim.Data.SQLite Convert.ToSingle(row["homeLookAtY"]), Convert.ToSingle(row["homeLookAtZ"]) ); + + LLUUID regionID = LLUUID.Zero; + LLUUID.TryParse(row["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero + user.HomeRegionID = regionID; + user.Created = Convert.ToInt32(row["created"]); user.LastLogin = Convert.ToInt32(row["lastLogin"]); user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]); @@ -803,6 +809,7 @@ namespace OpenSim.Data.SQLite row["homeRegionX"] = user.HomeRegionX; row["homeRegionY"] = user.HomeRegionY; + row["homeRegionID"] = user.HomeRegionID; row["homeLocationX"] = user.HomeLocation.X; row["homeLocationY"] = user.HomeLocation.Y; row["homeLocationZ"] = user.HomeLocation.Z; -- cgit v1.1