* Catch exceptions thrown when MySQLEstateData.LinkRegion() is called. This won't fix the bug I'm seeing with regions not realizing they are already part of an estate, but it will fix the OpenSim crash if that situation ever comes up

slimupdates
John Hurliman 2010-03-26 13:50:25 -07:00
parent c6bbb48f2b
commit d6a64bf732
1 changed files with 14 additions and 8 deletions

View File

@ -447,24 +447,30 @@ namespace OpenSim.Data.MySQL
{ {
dbcon.Open(); dbcon.Open();
try
{
using (MySqlCommand cmd = dbcon.CreateCommand()) using (MySqlCommand cmd = dbcon.CreateCommand())
{ {
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
cmd.Parameters.AddWithValue("?RegionID", regionID); cmd.Parameters.AddWithValue("?RegionID", regionID);
cmd.Parameters.AddWithValue("?EstateID", estateID); cmd.Parameters.AddWithValue("?EstateID", estateID);
if (cmd.ExecuteNonQuery() == 0) int ret = cmd.ExecuteNonQuery();
dbcon.Close();
return (ret != 0);
}
}
catch (MySqlException ex)
{ {
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
}
dbcon.Close(); dbcon.Close();
}
return false; return false;
} }
}
dbcon.Close();
}
return true;
}
public List<UUID> GetRegions(int estateID) public List<UUID> GetRegions(int estateID)
{ {