diff options
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/IRegionData.cs | 11 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 10 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 26 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/005_GridStore.sql | 6 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullRegionData.cs | 10 | ||||
-rw-r--r-- | OpenSim/Data/RegionProfileData.cs | 1 |
6 files changed, 63 insertions, 1 deletions
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 7a607ab..b8de1d8 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs | |||
@@ -60,5 +60,16 @@ namespace OpenSim.Data | |||
60 | 60 | ||
61 | bool Delete(UUID regionID); | 61 | bool Delete(UUID regionID); |
62 | 62 | ||
63 | List<RegionData> GetDefaultRegions(UUID scopeID); | ||
64 | List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y); | ||
65 | } | ||
66 | |||
67 | [Flags] | ||
68 | public enum RegionFlags : int | ||
69 | { | ||
70 | DefaultRegion = 1, // Used for new Rez. Random if multiple defined | ||
71 | FallbackRegion = 2, // Regions we redirect to when the destination is down | ||
72 | RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false | ||
73 | NoDirectLogin = 8 // Region unavailable for direct logins (by name) | ||
63 | } | 74 | } |
64 | } | 75 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index a898aab..fbfb78e 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -307,5 +307,15 @@ namespace OpenSim.Data.MSSQL | |||
307 | } | 307 | } |
308 | return false; | 308 | return false; |
309 | } | 309 | } |
310 | |||
311 | public List<RegionData> GetDefaultRegions(UUID scopeID) | ||
312 | { | ||
313 | return null; | ||
314 | } | ||
315 | |||
316 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | ||
317 | { | ||
318 | return null; | ||
319 | } | ||
310 | } | 320 | } |
311 | } | 321 | } |
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; | ||
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index e8263ea..92db87a 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs | |||
@@ -130,5 +130,15 @@ namespace OpenSim.Data.Null | |||
130 | 130 | ||
131 | return true; | 131 | return true; |
132 | } | 132 | } |
133 | |||
134 | public List<RegionData> GetDefaultRegions(UUID scopeID) | ||
135 | { | ||
136 | return null; | ||
137 | } | ||
138 | |||
139 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | ||
140 | { | ||
141 | return null; | ||
142 | } | ||
133 | } | 143 | } |
134 | } | 144 | } |
diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs index 86d7f6b..90713d2 100644 --- a/OpenSim/Data/RegionProfileData.cs +++ b/OpenSim/Data/RegionProfileData.cs | |||
@@ -136,7 +136,6 @@ namespace OpenSim.Data | |||
136 | /// </summary> | 136 | /// </summary> |
137 | public uint maturity; | 137 | public uint maturity; |
138 | 138 | ||
139 | |||
140 | //Data Wrappers | 139 | //Data Wrappers |
141 | public string RegionName | 140 | public string RegionName |
142 | { | 141 | { |