diff options
author | Sean McNamara | 2011-04-10 18:28:54 -0400 |
---|---|---|
committer | Sean McNamara | 2011-04-10 18:28:54 -0400 |
commit | 9c0f3c73b1fd56ac145e866af0316a3285ddb689 (patch) | |
tree | 03541a853c2ecf5829ac296537b14d4553ad4b2e /OpenSim/Data/SQLite/SQLiteEstateData.cs | |
parent | Merge git://opensimulator.org/git/opensim (diff) | |
parent | minor: remove mono compiler warnings (diff) | |
download | opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.zip opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.gz opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.bz2 opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.xz |
Merge git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteEstateData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index 63252aa..2f05a6e 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -357,6 +357,17 @@ namespace OpenSim.Data.SQLite | |||
357 | 357 | ||
358 | return DoLoad(cmd, UUID.Zero, false); | 358 | return DoLoad(cmd, UUID.Zero, false); |
359 | } | 359 | } |
360 | |||
361 | public List<EstateSettings> LoadEstateSettingsAll() | ||
362 | { | ||
363 | List<EstateSettings> estateSettings = new List<EstateSettings>(); | ||
364 | |||
365 | List<int> estateIds = GetEstatesAll(); | ||
366 | foreach (int estateId in estateIds) | ||
367 | estateSettings.Add(LoadEstateSettings(estateId)); | ||
368 | |||
369 | return estateSettings; | ||
370 | } | ||
360 | 371 | ||
361 | public List<int> GetEstates(string search) | 372 | public List<int> GetEstates(string search) |
362 | { | 373 | { |
@@ -379,6 +390,49 @@ namespace OpenSim.Data.SQLite | |||
379 | 390 | ||
380 | return result; | 391 | return result; |
381 | } | 392 | } |
393 | |||
394 | public List<int> GetEstatesAll() | ||
395 | { | ||
396 | List<int> result = new List<int>(); | ||
397 | |||
398 | string sql = "select EstateID from estate_settings"; | ||
399 | |||
400 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | ||
401 | |||
402 | cmd.CommandText = sql; | ||
403 | |||
404 | IDataReader r = cmd.ExecuteReader(); | ||
405 | |||
406 | while (r.Read()) | ||
407 | { | ||
408 | result.Add(Convert.ToInt32(r["EstateID"])); | ||
409 | } | ||
410 | r.Close(); | ||
411 | |||
412 | return result; | ||
413 | } | ||
414 | |||
415 | public List<int> GetEstatesByOwner(UUID ownerID) | ||
416 | { | ||
417 | List<int> result = new List<int>(); | ||
418 | |||
419 | string sql = "select EstateID from estate_settings where estate_settings.EstateOwner = :EstateOwner"; | ||
420 | |||
421 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | ||
422 | |||
423 | cmd.CommandText = sql; | ||
424 | cmd.Parameters.AddWithValue(":EstateOwner", ownerID); | ||
425 | |||
426 | IDataReader r = cmd.ExecuteReader(); | ||
427 | |||
428 | while (r.Read()) | ||
429 | { | ||
430 | result.Add(Convert.ToInt32(r["EstateID"])); | ||
431 | } | ||
432 | r.Close(); | ||
433 | |||
434 | return result; | ||
435 | } | ||
382 | 436 | ||
383 | public bool LinkRegion(UUID regionID, int estateID) | 437 | public bool LinkRegion(UUID regionID, int estateID) |
384 | { | 438 | { |