From 46492f3c1182d68139f914bfe89c81ca8dae1733 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 6 Nov 2008 17:07:08 +0000 Subject: From: arthursv@linux.vnet.ibm.com Add more unit tests for user cases Persist more user fields into mysql that already had columns defined but weren't getting passed to the mysql manager. --- OpenSim/Data/MySQL/MySQLManager.cs | 38 ++++++++++++++++++------------------- OpenSim/Data/MySQL/MySQLUserData.cs | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index c584eb9..a54c020 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -561,7 +561,7 @@ namespace OpenSim.Data.MySQL retval.Created = Convert.ToInt32(reader["created"].ToString()); retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); - + retval.UserInventoryURI = (string) reader["userInventoryURI"]; retval.UserAssetURI = (string) reader["userAssetURI"]; @@ -751,6 +751,7 @@ namespace OpenSim.Data.MySQL /// A salted hash of the users password /// The salt used for the password hash /// A regionHandle of the users home region + /// The UUID of the user's home region /// Home region position vector /// Home region position vector /// Home region position vector @@ -770,22 +771,22 @@ namespace OpenSim.Data.MySQL /// Ignored /// Success? public bool insertUserRow(UUID uuid, string username, string lastname, string email, string passwordHash, - string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, + string passwordSalt, UInt64 homeRegion, UUID 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, - UUID profileImage, UUID firstImage, UUID webLoginKey) + UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner) { m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString()); string sql = - "INSERT INTO users (`UUID`, `username`, `lastname`, `email`, `passwordHash`, `passwordSalt`, `homeRegion`, "; + "INSERT INTO users (`UUID`, `username`, `lastname`, `email`, `passwordHash`, `passwordSalt`, `homeRegion`, `homeRegionID`, "; sql += "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; sql += "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`, `customType`, `partner`) VALUES "; - sql += "(?UUID, ?username, ?lastname, ?email, ?passwordHash, ?passwordSalt, ?homeRegion, "; + sql += "(?UUID, ?username, ?lastname, ?email, ?passwordHash, ?passwordSalt, ?homeRegion, ?homeRegionID, "; sql += "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; sql += @@ -800,6 +801,7 @@ namespace OpenSim.Data.MySQL parameters["?passwordHash"] = passwordHash; parameters["?passwordSalt"] = passwordSalt; parameters["?homeRegion"] = homeRegion.ToString(); + parameters["?homeRegionID"] = homeRegionID.ToString(); parameters["?homeLocationX"] = homeLocX.ToString(); parameters["?homeLocationY"] = homeLocY.ToString(); parameters["?homeLocationZ"] = homeLocZ.ToString(); @@ -808,23 +810,21 @@ namespace OpenSim.Data.MySQL parameters["?homeLookAtZ"] = homeLookAtZ.ToString(); parameters["?created"] = created.ToString(); parameters["?lastLogin"] = lastlogin.ToString(); - parameters["?userInventoryURI"] = String.Empty; - parameters["?userAssetURI"] = String.Empty; - parameters["?profileCanDoMask"] = "0"; - parameters["?profileWantDoMask"] = "0"; + parameters["?userInventoryURI"] = inventoryURI; + parameters["?userAssetURI"] = assetURI; + parameters["?profileCanDoMask"] = canDoMask.ToString(); + parameters["?profileWantDoMask"] = wantDoMask.ToString(); parameters["?profileAboutText"] = aboutText; parameters["?profileFirstText"] = firstText; parameters["?profileImage"] = profileImage.ToString(); parameters["?profileFirstImage"] = firstImage.ToString(); - parameters["?webLoginKey"] = string.Empty; - parameters["?userFlags"] = "0"; - parameters["?godLevel"] = "0"; - parameters["?customType"] = ""; - parameters["?partner"] = ""; - - + parameters["?webLoginKey"] = webLoginKey.ToString(); + parameters["?userFlags"] = userFlags.ToString(); + parameters["?godLevel"] = godLevel.ToString(); + parameters["?customType"] = customType == null ? "" : customType; + parameters["?partner"] = partner.ToString(); bool returnval = false; - + try { IDbCommand result = Query(sql, parameters); @@ -911,8 +911,8 @@ namespace OpenSim.Data.MySQL parameters["?lastLogin"] = lastlogin.ToString(); parameters["?userInventoryURI"] = inventoryURI; parameters["?userAssetURI"] = assetURI; - parameters["?profileCanDoMask"] = "0"; - parameters["?profileWantDoMask"] = "0"; + parameters["?profileCanDoMask"] = canDoMask.ToString(); + parameters["?profileWantDoMask"] = wantDoMask.ToString(); parameters["?profileAboutText"] = aboutText; parameters["?profileFirstText"] = firstText; parameters["?profileImage"] = profileImage.ToString(); diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 47670d2..82b5bbc 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -643,13 +643,13 @@ namespace OpenSim.Data.MySQL try { dbm.Manager.insertUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt, - user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, + 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); + user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel, user.CustomType, user.Partner); } catch (Exception e) { -- cgit v1.1