aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLRegionData.cs
diff options
context:
space:
mode:
authorMelanie2010-08-01 18:00:04 +0100
committerMelanie2010-08-01 18:00:04 +0100
commit5f94b98cb2cbef74d1aea8d38d78d58a5aea2920 (patch)
tree114ccf34f9a444ad909cf44b8cede577425822b1 /OpenSim/Data/MSSQL/MSSQLRegionData.cs
parentFix the XmlRpcRouterModule so it reads from the correct config section ([XMLR... (diff)
parentRenamed variables in RemoteAdmin plugin to be closer to the coding standards. (diff)
downloadopensim-SC-5f94b98cb2cbef74d1aea8d38d78d58a5aea2920.zip
opensim-SC-5f94b98cb2cbef74d1aea8d38d78d58a5aea2920.tar.gz
opensim-SC-5f94b98cb2cbef74d1aea8d38d78d58a5aea2920.tar.bz2
opensim-SC-5f94b98cb2cbef74d1aea8d38d78d58a5aea2920.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLRegionData.cs27
1 files changed, 13 insertions, 14 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 66c3f81..9656be1 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -310,23 +310,23 @@ namespace OpenSim.Data.MSSQL
310 310
311 public List<RegionData> GetDefaultRegions(UUID scopeID) 311 public List<RegionData> GetDefaultRegions(UUID scopeID)
312 { 312 {
313 string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0"; 313 return Get((int)RegionFlags.DefaultRegion, scopeID);
314 if (scopeID != UUID.Zero)
315 sql += " AND ScopeID = @scopeID";
316
317 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
318 using (SqlCommand cmd = new SqlCommand(sql, conn))
319 {
320 cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
321 conn.Open();
322 return RunCommand(cmd);
323 }
324
325 } 314 }
326 315
327 public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) 316 public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
328 { 317 {
329 string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0"; 318 // TODO: distance-sort results
319 return Get((int)RegionFlags.FallbackRegion, scopeID);
320 }
321
322 public List<RegionData> GetHyperlinks(UUID scopeID)
323 {
324 return Get((int)RegionFlags.Hyperlink, scopeID);
325 }
326
327 private List<RegionData> Get(int regionFlags, UUID scopeID)
328 {
329 string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0";
330 if (scopeID != UUID.Zero) 330 if (scopeID != UUID.Zero)
331 sql += " AND ScopeID = @scopeID"; 331 sql += " AND ScopeID = @scopeID";
332 332
@@ -335,7 +335,6 @@ namespace OpenSim.Data.MSSQL
335 { 335 {
336 cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); 336 cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
337 conn.Open(); 337 conn.Open();
338 // TODO: distance-sort results
339 return RunCommand(cmd); 338 return RunCommand(cmd);
340 } 339 }
341 } 340 }