From da849aea780b83e3b954ef26772c11ca8c4c2371 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 4 May 2010 17:56:30 +0200 Subject: Allow regions to get the list of the other regions in the estate --- OpenSim/Data/MySQL/MySQLEstateData.cs | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'OpenSim') 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 public List GetRegions(int estateID) { - return new List(); + List result = new List(); + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + try + { + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "select RegionID from estate_map where EstateID = ?EstateID"; + cmd.Parameters.AddWithValue("?EstateID", estateID.ToString()); + + using (IDataReader reader = cmd.ExecuteReader()) + { + while(reader.Read()) + result.Add(new UUID(reader["RegionID"].ToString())); + reader.Close(); + } + } + } + catch (Exception e) + { + m_log.Error("[REGION DB]: Error reading estate map. " + e.ToString()); + return result; + } + dbcon.Close(); + } + + return result; } public bool DeleteEstate(int estateID) -- cgit v1.1