Allow regions to get the list of the other regions in the estate

slimupdates
Melanie Thielker 2010-05-04 17:56:30 +02:00 committed by Melanie
parent 23d7a942ea
commit 9635af61f0
1 changed files with 30 additions and 1 deletions

View File

@ -474,7 +474,36 @@ namespace OpenSim.Data.MySQL
public List<UUID> GetRegions(int estateID)
{
return new List<UUID>();
List<UUID> result = new List<UUID>();
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)