aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLRegionData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs23
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index c7bddac..aec37e2 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -281,22 +281,26 @@ namespace OpenSim.Data.MySQL
281 281
282 return false; 282 return false;
283 } 283 }
284
284 public List<RegionData> GetDefaultRegions(UUID scopeID) 285 public List<RegionData> GetDefaultRegions(UUID scopeID)
285 { 286 {
286 string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; 287 return Get((int)RegionFlags.DefaultRegion, scopeID);
287 if (scopeID != UUID.Zero) 288 }
288 command += " and ScopeID = ?scopeID";
289
290 MySqlCommand cmd = new MySqlCommand(command);
291 289
292 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 290 public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
291 {
292 // TODO: distance-sort results
293 return Get((int)RegionFlags.FallbackRegion, scopeID);
294 }
293 295
294 return RunCommand(cmd); 296 public List<RegionData> GetHyperlinks(UUID scopeID)
297 {
298 return Get((int)RegionFlags.Hyperlink, scopeID);
295 } 299 }
296 300
297 public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) 301 private List<RegionData> Get(int regionFlags, UUID scopeID)
298 { 302 {
299 string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; 303 string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0";
300 if (scopeID != UUID.Zero) 304 if (scopeID != UUID.Zero)
301 command += " and ScopeID = ?scopeID"; 305 command += " and ScopeID = ?scopeID";
302 306
@@ -304,7 +308,6 @@ namespace OpenSim.Data.MySQL
304 308
305 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 309 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
306 310
307 // TODO: distance-sort results
308 return RunCommand(cmd); 311 return RunCommand(cmd);
309 } 312 }
310 } 313 }