diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLEstateData.cs | 5 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 30 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 22 | ||||
-rw-r--r-- | OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs | 24 |
4 files changed, 80 insertions, 1 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLEstateData.cs b/OpenSim/Data/MSSQL/MSSQLEstateData.cs index 92a8d80..d10ebe4 100644 --- a/OpenSim/Data/MSSQL/MSSQLEstateData.cs +++ b/OpenSim/Data/MSSQL/MSSQLEstateData.cs | |||
@@ -372,6 +372,11 @@ namespace OpenSim.Data.MSSQL | |||
372 | return new List<int>(); | 372 | return new List<int>(); |
373 | } | 373 | } |
374 | 374 | ||
375 | public List<int> GetEstatesByOwner(UUID ownerID) | ||
376 | { | ||
377 | return new List<int>(); | ||
378 | } | ||
379 | |||
375 | public bool LinkRegion(UUID regionID, int estateID) | 380 | public bool LinkRegion(UUID regionID, int estateID) |
376 | { | 381 | { |
377 | // TODO: Implementation! | 382 | // TODO: Implementation! |
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 6d72e82..86416d1 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -484,6 +484,36 @@ namespace OpenSim.Data.MySQL | |||
484 | return result; | 484 | return result; |
485 | } | 485 | } |
486 | 486 | ||
487 | public List<int> GetEstatesByOwner(UUID ownerID) | ||
488 | { | ||
489 | List<int> result = new List<int>(); | ||
490 | |||
491 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
492 | { | ||
493 | dbcon.Open(); | ||
494 | |||
495 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
496 | { | ||
497 | cmd.CommandText = "select estateID from estate_settings where EstateOwner = ?EstateOwner"; | ||
498 | cmd.Parameters.AddWithValue("?EstateOwner", ownerID); | ||
499 | |||
500 | using (IDataReader reader = cmd.ExecuteReader()) | ||
501 | { | ||
502 | while (reader.Read()) | ||
503 | { | ||
504 | result.Add(Convert.ToInt32(reader["EstateID"])); | ||
505 | } | ||
506 | reader.Close(); | ||
507 | } | ||
508 | } | ||
509 | |||
510 | |||
511 | dbcon.Close(); | ||
512 | } | ||
513 | |||
514 | return result; | ||
515 | } | ||
516 | |||
487 | public bool LinkRegion(UUID regionID, int estateID) | 517 | public bool LinkRegion(UUID regionID, int estateID) |
488 | { | 518 | { |
489 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 519 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index 6afc540..2f05a6e 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -412,6 +412,28 @@ namespace OpenSim.Data.SQLite | |||
412 | return result; | 412 | return result; |
413 | } | 413 | } |
414 | 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 | } | ||
436 | |||
415 | public bool LinkRegion(UUID regionID, int estateID) | 437 | public bool LinkRegion(UUID regionID, int estateID) |
416 | { | 438 | { |
417 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 439 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs index ad28c00..4dd225f 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs | |||
@@ -401,7 +401,29 @@ namespace OpenSim.Data.SQLiteLegacy | |||
401 | 401 | ||
402 | return result; | 402 | return result; |
403 | } | 403 | } |
404 | 404 | ||
405 | public List<int> GetEstatesByOwner(UUID ownerID) | ||
406 | { | ||
407 | List<int> result = new List<int>(); | ||
408 | |||
409 | string sql = "select EstateID from estate_settings where estate_settings.EstateOwner = :EstateOwner"; | ||
410 | |||
411 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | ||
412 | |||
413 | cmd.CommandText = sql; | ||
414 | cmd.Parameters.Add(":EstateOwner", ownerID); | ||
415 | |||
416 | IDataReader r = cmd.ExecuteReader(); | ||
417 | |||
418 | while (r.Read()) | ||
419 | { | ||
420 | result.Add(Convert.ToInt32(r["EstateID"])); | ||
421 | } | ||
422 | r.Close(); | ||
423 | |||
424 | return result; | ||
425 | } | ||
426 | |||
405 | public bool LinkRegion(UUID regionID, int estateID) | 427 | public bool LinkRegion(UUID regionID, int estateID) |
406 | { | 428 | { |
407 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 429 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |