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

avinationmerge
Melanie Thielker 2010-05-04 17:56:30 +02:00
parent dbce360566
commit da849aea78
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)