diff options
author | Melanie Thielker | 2010-05-04 17:56:30 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-05-04 17:56:30 +0200 |
commit | da849aea780b83e3b954ef26772c11ca8c4c2371 (patch) | |
tree | 9f98b3e8c1d944d5b3478aece7818575640db1b7 | |
parent | Fix full circle sensors (diff) | |
download | opensim-SC-da849aea780b83e3b954ef26772c11ca8c4c2371.zip opensim-SC-da849aea780b83e3b954ef26772c11ca8c4c2371.tar.gz opensim-SC-da849aea780b83e3b954ef26772c11ca8c4c2371.tar.bz2 opensim-SC-da849aea780b83e3b954ef26772c11ca8c4c2371.tar.xz |
Allow regions to get the list of the other regions in the estate
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index d0c02f0..08e2144 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -474,7 +474,36 @@ namespace OpenSim.Data.MySQL | |||
474 | 474 | ||
475 | public List<UUID> GetRegions(int estateID) | 475 | public List<UUID> GetRegions(int estateID) |
476 | { | 476 | { |
477 | return new List<UUID>(); | 477 | List<UUID> result = new List<UUID>(); |
478 | |||
479 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
480 | { | ||
481 | dbcon.Open(); | ||
482 | |||
483 | try | ||
484 | { | ||
485 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
486 | { | ||
487 | cmd.CommandText = "select RegionID from estate_map where EstateID = ?EstateID"; | ||
488 | cmd.Parameters.AddWithValue("?EstateID", estateID.ToString()); | ||
489 | |||
490 | using (IDataReader reader = cmd.ExecuteReader()) | ||
491 | { | ||
492 | while(reader.Read()) | ||
493 | result.Add(new UUID(reader["RegionID"].ToString())); | ||
494 | reader.Close(); | ||
495 | } | ||
496 | } | ||
497 | } | ||
498 | catch (Exception e) | ||
499 | { | ||
500 | m_log.Error("[REGION DB]: Error reading estate map. " + e.ToString()); | ||
501 | return result; | ||
502 | } | ||
503 | dbcon.Close(); | ||
504 | } | ||
505 | |||
506 | return result; | ||
478 | } | 507 | } |
479 | 508 | ||
480 | public bool DeleteEstate(int estateID) | 509 | public bool DeleteEstate(int estateID) |