From f58941e89f122c2e1fd54a2f817fb8114e6c80ed Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 5 Apr 2011 01:30:13 +0100 Subject: Make the "All Estates" option work from the client (this makes chosen changes to all the estates that the user owns). This applies to adding/removing estate users, groups, managers and bans. This is the application of the AllEstates_0.5.patch from http://opensimulator.org/mantis/view.php?id=5420 Thanks very much, Snoopy! --- OpenSim/Data/MSSQL/MSSQLEstateData.cs | 5 +++++ OpenSim/Data/MySQL/MySQLEstateData.cs | 30 +++++++++++++++++++++++++++ OpenSim/Data/SQLite/SQLiteEstateData.cs | 22 ++++++++++++++++++++ OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs | 24 ++++++++++++++++++++- 4 files changed, 80 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data') 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 return new List(); } + public List GetEstatesByOwner(UUID ownerID) + { + return new List(); + } + public bool LinkRegion(UUID regionID, int estateID) { // 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 return result; } + public List GetEstatesByOwner(UUID ownerID) + { + List result = new List(); + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "select estateID from estate_settings where EstateOwner = ?EstateOwner"; + cmd.Parameters.AddWithValue("?EstateOwner", ownerID); + + using (IDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(Convert.ToInt32(reader["EstateID"])); + } + reader.Close(); + } + } + + + dbcon.Close(); + } + + return result; + } + public bool LinkRegion(UUID regionID, int estateID) { 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 return result; } + public List GetEstatesByOwner(UUID ownerID) + { + List result = new List(); + + string sql = "select EstateID from estate_settings where estate_settings.EstateOwner = :EstateOwner"; + + SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); + + cmd.CommandText = sql; + cmd.Parameters.AddWithValue(":EstateOwner", ownerID); + + IDataReader r = cmd.ExecuteReader(); + + while (r.Read()) + { + result.Add(Convert.ToInt32(r["EstateID"])); + } + r.Close(); + + return result; + } + public bool LinkRegion(UUID regionID, int estateID) { 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 return result; } - + + public List GetEstatesByOwner(UUID ownerID) + { + List result = new List(); + + string sql = "select EstateID from estate_settings where estate_settings.EstateOwner = :EstateOwner"; + + SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); + + cmd.CommandText = sql; + cmd.Parameters.Add(":EstateOwner", ownerID); + + IDataReader r = cmd.ExecuteReader(); + + while (r.Read()) + { + result.Add(Convert.ToInt32(r["EstateID"])); + } + r.Close(); + + return result; + } + public bool LinkRegion(UUID regionID, int estateID) { SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); -- cgit v1.1