diff options
author | StrawberryFride | 2010-02-24 16:42:39 +0000 |
---|---|---|
committer | Melanie | 2010-02-24 15:50:44 +0000 |
commit | 2fa5694ec9857f208b6fe4d0890fd2ab8ac1b8bf (patch) | |
tree | 672ec2bb3e64b8f930faa9a87801ba9042e2d4f7 /OpenSim/Data/MSSQL/MSSQLRegionData.cs | |
parent | Fixed typo that was affecting the BasicInventoryAccessModule (diff) | |
download | opensim-SC-2fa5694ec9857f208b6fe4d0890fd2ab8ac1b8bf.zip opensim-SC-2fa5694ec9857f208b6fe4d0890fd2ab8ac1b8bf.tar.gz opensim-SC-2fa5694ec9857f208b6fe4d0890fd2ab8ac1b8bf.tar.bz2 opensim-SC-2fa5694ec9857f208b6fe4d0890fd2ab8ac1b8bf.tar.xz |
MSSQL Additions for Presence Refactor branch. Most functionality tested and works, some outstanding issues around login location and border crossings on y axis.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index fbfb78e..66c3f81 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -129,10 +129,10 @@ namespace OpenSim.Data.MSSQL | |||
129 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) | 129 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) |
130 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | 130 | using (SqlCommand cmd = new SqlCommand(sql, conn)) |
131 | { | 131 | { |
132 | cmd.Parameters.Add(m_database.CreateParameter("@startX", startX.ToString())); | 132 | cmd.Parameters.Add(m_database.CreateParameter("@startX", startX)); |
133 | cmd.Parameters.Add(m_database.CreateParameter("@startY", startY.ToString())); | 133 | cmd.Parameters.Add(m_database.CreateParameter("@startY", startY)); |
134 | cmd.Parameters.Add(m_database.CreateParameter("@endX", endX.ToString())); | 134 | cmd.Parameters.Add(m_database.CreateParameter("@endX", endX)); |
135 | cmd.Parameters.Add(m_database.CreateParameter("@endY", endY.ToString())); | 135 | cmd.Parameters.Add(m_database.CreateParameter("@endY", endY)); |
136 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); | 136 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); |
137 | conn.Open(); | 137 | conn.Open(); |
138 | return RunCommand(cmd); | 138 | return RunCommand(cmd); |
@@ -310,12 +310,34 @@ namespace OpenSim.Data.MSSQL | |||
310 | 310 | ||
311 | public List<RegionData> GetDefaultRegions(UUID scopeID) | 311 | public List<RegionData> GetDefaultRegions(UUID scopeID) |
312 | { | 312 | { |
313 | return null; | 313 | string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0"; |
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 | |||
314 | } | 325 | } |
315 | 326 | ||
316 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | 327 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) |
317 | { | 328 | { |
318 | return null; | 329 | string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0"; |
330 | if (scopeID != UUID.Zero) | ||
331 | sql += " AND ScopeID = @scopeID"; | ||
332 | |||
333 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) | ||
334 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
335 | { | ||
336 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); | ||
337 | conn.Open(); | ||
338 | // TODO: distance-sort results | ||
339 | return RunCommand(cmd); | ||
340 | } | ||
319 | } | 341 | } |
320 | } | 342 | } |
321 | } | 343 | } |