aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohn Hurliman2010-03-26 13:50:25 -0700
committerJohn Hurliman2010-03-26 13:50:25 -0700
commitd6a64bf732ee88bdf9b62ad4f4303514f3215283 (patch)
tree7692eb3e9399a2af3fa74b24f4f28ffd464d7cbd
parentMerge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-d6a64bf732ee88bdf9b62ad4f4303514f3215283.zip
opensim-SC_OLD-d6a64bf732ee88bdf9b62ad4f4303514f3215283.tar.gz
opensim-SC_OLD-d6a64bf732ee88bdf9b62ad4f4303514f3215283.tar.bz2
opensim-SC_OLD-d6a64bf732ee88bdf9b62ad4f4303514f3215283.tar.xz
* 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
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs22
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 7fe1fcc..d0c02f0 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -447,23 +447,29 @@ namespace OpenSim.Data.MySQL
447 { 447 {
448 dbcon.Open(); 448 dbcon.Open();
449 449
450 using (MySqlCommand cmd = dbcon.CreateCommand()) 450 try
451 { 451 {
452 cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; 452 using (MySqlCommand cmd = dbcon.CreateCommand())
453 cmd.Parameters.AddWithValue("?RegionID", regionID);
454 cmd.Parameters.AddWithValue("?EstateID", estateID);
455
456 if (cmd.ExecuteNonQuery() == 0)
457 { 453 {
454 cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
455 cmd.Parameters.AddWithValue("?RegionID", regionID);
456 cmd.Parameters.AddWithValue("?EstateID", estateID);
457
458 int ret = cmd.ExecuteNonQuery();
458 dbcon.Close(); 459 dbcon.Close();
459 return false; 460
461 return (ret != 0);
460 } 462 }
461 } 463 }
464 catch (MySqlException ex)
465 {
466 m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
467 }
462 468
463 dbcon.Close(); 469 dbcon.Close();
464 } 470 }
465 471
466 return true; 472 return false;
467 } 473 }
468 474
469 public List<UUID> GetRegions(int estateID) 475 public List<UUID> GetRegions(int estateID)