From 2d37ff6fb2d0746a90c273410b2fbcc695112003 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 31 May 2009 20:53:59 +0000 Subject: Thank you kindly, StrawberryFride for a patch that: Added in some key code to read properties from MSSQL for user profiles which fixes issues of users having trouble editing estate settings on a grid where estate managers are not god, and fixes the option of enabling grid god functionality on MSSQL grids. I have applied this to trunk only. I need someone else to examine and apply to 0.6.5-Post-Fixes, or give me some direction, please. --- OpenSim/Data/MSSQL/MSSQLUserData.cs | 57 ++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data/MSSQL') diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 1bff28d..e83ea14 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -1139,21 +1139,64 @@ ELSE Convert.ToSingle(reader["homeLookAtY"].ToString()), Convert.ToSingle(reader["homeLookAtZ"].ToString())); + if (reader.IsDBNull(reader.GetOrdinal("homeRegionID"))) + retval.HomeRegionID = UUID.Zero; + else + retval.HomeRegionID = new UUID((Guid)reader["homeRegionID"]); + retval.Created = Convert.ToInt32(reader["created"].ToString()); retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); - retval.UserInventoryURI = (string)reader["userInventoryURI"]; - retval.UserAssetURI = (string)reader["userAssetURI"]; + if (reader.IsDBNull(reader.GetOrdinal("userInventoryURI"))) + retval.UserInventoryURI = ""; + else + retval.UserInventoryURI = (string)reader["userInventoryURI"]; + + if (reader.IsDBNull(reader.GetOrdinal("userAssetURI"))) + retval.UserAssetURI = ""; + else + retval.UserAssetURI = (string)reader["userAssetURI"]; retval.CanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); retval.WantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); - retval.AboutText = (string)reader["profileAboutText"]; - retval.FirstLifeAboutText = (string)reader["profileFirstText"]; - retval.Image = new UUID((Guid)reader["profileImage"]); - retval.FirstLifeImage = new UUID((Guid)reader["profileFirstImage"]); - retval.WebLoginKey = new UUID((Guid)reader["webLoginKey"]); + if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) + retval.AboutText = ""; + else + retval.AboutText = (string)reader["profileAboutText"]; + + if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) + retval.FirstLifeAboutText = ""; + else + retval.FirstLifeAboutText = (string)reader["profileFirstText"]; + + if (reader.IsDBNull(reader.GetOrdinal("profileImage"))) + retval.Image = UUID.Zero; + else + retval.Image = new UUID((Guid)reader["profileImage"]); + + if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage"))) + retval.Image = UUID.Zero; + else + retval.FirstLifeImage = new UUID((Guid)reader["profileFirstImage"]); + + if (reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) + retval.WebLoginKey = UUID.Zero; + else + retval.WebLoginKey = new UUID((Guid)reader["webLoginKey"]); + + retval.UserFlags = Convert.ToInt32(reader["userFlags"].ToString()); + retval.GodLevel = Convert.ToInt32(reader["godLevel"].ToString()); + if (reader.IsDBNull(reader.GetOrdinal("customType"))) + retval.CustomType = ""; + else + retval.CustomType = reader["customType"].ToString(); + + if (reader.IsDBNull(reader.GetOrdinal("partner"))) + retval.Partner = UUID.Zero; + else + retval.Partner = new UUID((Guid)reader["partner"]); } else { -- cgit v1.1