Thank you very much, Ahzzmandius for:
converts Parse calls to TryParse Replaces string.empty and lluuid.zero calls on user load to use real values from DB (related to user profile save/load work. Finer grained patching)0.6.0-stable
parent
7794fc3766
commit
cff3c20ee5
|
@ -293,10 +293,14 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
|
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
// Region Main
|
// Region Main gotta-have-or-we-return-null parts
|
||||||
retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString());
|
if (!UInt64.TryParse(reader["regionHandle"].ToString(), out retval.regionHandle))
|
||||||
retval.regionName = (string) reader["regionName"];
|
return null;
|
||||||
retval.UUID = new LLUUID((string) reader["uuid"]);
|
if (!LLUUID.TryParse((string)reader["uuid"], out retval.UUID))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// non-critical parts
|
||||||
|
retval.regionName = (string)reader["regionName"];
|
||||||
|
|
||||||
// Secrets
|
// Secrets
|
||||||
retval.regionRecvKey = (string) reader["regionRecvKey"];
|
retval.regionRecvKey = (string) reader["regionRecvKey"];
|
||||||
|
@ -334,33 +338,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
retval.regionUserSendKey = (string) reader["regionUserSendKey"];
|
retval.regionUserSendKey = (string) reader["regionUserSendKey"];
|
||||||
|
|
||||||
// World Map Addition
|
// World Map Addition
|
||||||
string tempRegionMap = reader["regionMapTexture"].ToString();
|
LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID);
|
||||||
if (tempRegionMap != String.Empty)
|
LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid);
|
||||||
{
|
}
|
||||||
retval.regionMapTextureID = new LLUUID(tempRegionMap);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
retval.regionMapTextureID = LLUUID.Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
// part of an initial brutish effort to provide accurate information (as per the xml region spec)
|
|
||||||
// wrt the ownership of a given region
|
|
||||||
// the (very bad) assumption is that this value is being read and handled inconsistently or
|
|
||||||
// not at all. Current strategy is to put the code in place to support the validity of this information
|
|
||||||
// and to roll forward debugging any issues from that point
|
|
||||||
//
|
|
||||||
// this particular section of the mod attempts to supply a value from the region table to the caller of 'readSimRow()'
|
|
||||||
// for the UUID of the region's owner (master avatar)
|
|
||||||
try
|
|
||||||
{
|
|
||||||
retval.owner_uuid = new LLUUID((string)reader["owner_uuid"]);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
retval.owner_uuid = LLUUID.Zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -387,7 +367,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString());
|
retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString());
|
||||||
retval.reservationName = (string) reader["resName"];
|
retval.reservationName = (string) reader["resName"];
|
||||||
retval.status = Convert.ToInt32(reader["status"].ToString()) == 1;
|
retval.status = Convert.ToInt32(reader["status"].ToString()) == 1;
|
||||||
retval.userUUID = new LLUUID((string) reader["userUUID"]);
|
LLUUID.TryParse((string) reader["userUUID"], out retval.userUUID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -408,9 +388,10 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
// Agent IDs
|
// Agent IDs
|
||||||
retval.UUID = new LLUUID((string) reader["UUID"]);
|
if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID))
|
||||||
retval.sessionID = new LLUUID((string) reader["sessionID"]);
|
return null;
|
||||||
retval.secureSessionID = new LLUUID((string) reader["secureSessionID"]);
|
LLUUID.TryParse((string) reader["sessionID"], out retval.sessionID);
|
||||||
|
LLUUID.TryParse((string)reader["secureSessionID"], out retval.secureSessionID);
|
||||||
|
|
||||||
// Agent Who?
|
// Agent Who?
|
||||||
retval.agentIP = (string) reader["agentIP"];
|
retval.agentIP = (string) reader["agentIP"];
|
||||||
|
@ -444,7 +425,8 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
|
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
retval.UUID = new LLUUID((string) reader["UUID"]);
|
if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID))
|
||||||
|
return null;
|
||||||
retval.username = (string) reader["username"];
|
retval.username = (string) reader["username"];
|
||||||
retval.surname = (string) reader["lastname"];
|
retval.surname = (string) reader["lastname"];
|
||||||
|
|
||||||
|
@ -473,8 +455,8 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
retval.profileAboutText = (string) reader["profileAboutText"];
|
retval.profileAboutText = (string) reader["profileAboutText"];
|
||||||
retval.profileFirstText = (string) reader["profileFirstText"];
|
retval.profileFirstText = (string) reader["profileFirstText"];
|
||||||
|
|
||||||
retval.profileImage = new LLUUID((string) reader["profileImage"]);
|
LLUUID.TryParse((string)reader["profileImage"], out retval.profileImage);
|
||||||
retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]);
|
LLUUID.TryParse((string)reader["profileFirstImage"], out retval.profileFirstImage);
|
||||||
|
|
||||||
if( reader.IsDBNull( reader.GetOrdinal( "webLoginKey" ) ) )
|
if( reader.IsDBNull( reader.GetOrdinal( "webLoginKey" ) ) )
|
||||||
{
|
{
|
||||||
|
@ -482,7 +464,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]);
|
LLUUID.TryParse((string)reader["webLoginKey"], out retval.webLoginKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -605,11 +587,11 @@ namespace OpenSim.Framework.Data.MySQL
|
||||||
parameters["?userAssetURI"] = String.Empty;
|
parameters["?userAssetURI"] = String.Empty;
|
||||||
parameters["?profileCanDoMask"] = "0";
|
parameters["?profileCanDoMask"] = "0";
|
||||||
parameters["?profileWantDoMask"] = "0";
|
parameters["?profileWantDoMask"] = "0";
|
||||||
parameters["?profileAboutText"] = String.Empty;
|
parameters["?profileAboutText"] = aboutText;
|
||||||
parameters["?profileFirstText"] = String.Empty;
|
parameters["?profileFirstText"] = firstText;
|
||||||
parameters["?profileImage"] = LLUUID.Zero.ToString();
|
parameters["?profileImage"] = profileImage.ToString();
|
||||||
parameters["?profileFirstImage"] = LLUUID.Zero.ToString();
|
parameters["?profileFirstImage"] = firstImage.ToString();
|
||||||
parameters["?webLoginKey"] = LLUUID.Random().ToString();
|
parameters["?webLoginKey"] = string.Empty;
|
||||||
|
|
||||||
bool returnval = false;
|
bool returnval = false;
|
||||||
|
|
||||||
|
|
|
@ -123,17 +123,11 @@ namespace OpenSim.Framework.Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006");
|
public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006");
|
||||||
|
|
||||||
// part of an initial brutish effort to provide accurate information (as per the xml region spec)
|
|
||||||
// wrt the ownership of a given region
|
|
||||||
// the (very bad) assumption is that this value is being read and handled inconsistently or
|
|
||||||
// not at all. Current strategy is to put the code in place to support the validity of this information
|
|
||||||
// and to roll forward debugging any issues from that point
|
|
||||||
//
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// this particular mod to the file provides support within the spec for RegionProfileData for the
|
/// this particular mod to the file provides support within the spec for RegionProfileData for the
|
||||||
/// owner_uuid for the region
|
/// owner_uuid for the region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LLUUID owner_uuid;
|
public LLUUID owner_uuid = LLUUID.Zero;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Sim profile data from grid server when in grid mode
|
/// Get Sim profile data from grid server when in grid mode
|
||||||
|
|
Loading…
Reference in New Issue