From 28d6705358c2e383fb46c57f064de4dcff144e33 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 9 Jan 2010 20:46:32 +0000 Subject: Preliminary work on the new default region setting mechanism --- OpenSim/Data/MySQL/MySQLRegionData.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index b0075e8..d045f61 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -274,5 +274,31 @@ namespace OpenSim.Data.MySQL return false; } + public List GetDefaultRegions(UUID scopeID) + { + string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; + if (scopeID != UUID.Zero) + command += " and ScopeID = ?scopeID"; + + MySqlCommand cmd = new MySqlCommand(command); + + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + + return RunCommand(cmd); + } + + public List GetFallbackRegions(UUID scopeID, int x, int y) + { + string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; + if (scopeID != UUID.Zero) + command += " and ScopeID = ?scopeID"; + + MySqlCommand cmd = new MySqlCommand(command); + + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + + // TODO: distance-sort results + return RunCommand(cmd); + } } } -- cgit v1.1