diff options
author | Melanie | 2010-01-09 20:46:32 +0000 |
---|---|---|
committer | Melanie | 2010-01-09 20:46:32 +0000 |
commit | 28d6705358c2e383fb46c57f064de4dcff144e33 (patch) | |
tree | 9a95b712626d89ec8b957352a84b3c51f2b344ca /OpenSim/Data/MySQL | |
parent | Less refs to UserProfileCacheService. Compiles but likely doesn't run. (diff) | |
download | opensim-SC_OLD-28d6705358c2e383fb46c57f064de4dcff144e33.zip opensim-SC_OLD-28d6705358c2e383fb46c57f064de4dcff144e33.tar.gz opensim-SC_OLD-28d6705358c2e383fb46c57f064de4dcff144e33.tar.bz2 opensim-SC_OLD-28d6705358c2e383fb46c57f064de4dcff144e33.tar.xz |
Preliminary work on the new default region setting mechanism
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 26 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/005_GridStore.sql | 6 |
2 files changed, 32 insertions, 0 deletions
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 | |||
274 | 274 | ||
275 | return false; | 275 | return false; |
276 | } | 276 | } |
277 | public List<RegionData> GetDefaultRegions(UUID scopeID) | ||
278 | { | ||
279 | string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; | ||
280 | if (scopeID != UUID.Zero) | ||
281 | command += " and ScopeID = ?scopeID"; | ||
282 | |||
283 | MySqlCommand cmd = new MySqlCommand(command); | ||
284 | |||
285 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | ||
286 | |||
287 | return RunCommand(cmd); | ||
288 | } | ||
289 | |||
290 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | ||
291 | { | ||
292 | string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; | ||
293 | if (scopeID != UUID.Zero) | ||
294 | command += " and ScopeID = ?scopeID"; | ||
295 | |||
296 | MySqlCommand cmd = new MySqlCommand(command); | ||
297 | |||
298 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | ||
299 | |||
300 | // TODO: distance-sort results | ||
301 | return RunCommand(cmd); | ||
302 | } | ||
277 | } | 303 | } |
278 | } | 304 | } |
diff --git a/OpenSim/Data/MySQL/Resources/005_GridStore.sql b/OpenSim/Data/MySQL/Resources/005_GridStore.sql new file mode 100644 index 0000000..835ba89 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/005_GridStore.sql | |||
@@ -0,0 +1,6 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE `regions` ADD COLUMN `flags` integer NOT NULL DEFAULT 0; | ||
4 | CREATE INDEX flags ON regions(flags); | ||
5 | |||
6 | COMMIT; | ||