From 263633e274082135b21b8183b92280b768d18883 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 18 Jul 2008 02:40:47 +0000
Subject: Patch #9151 Makes the estate dialog fully functional. Implements all
client facing functionality. Moves estate data from estate_settings.xml,
which is used to provide defaults, to the region data store. Creates one
estate for each region, and places the region in it. Converts all region bans
to estate bans.
---
OpenSim/Data/MySQL/MySQLDataStore.cs | 143 +----------------------------------
1 file changed, 3 insertions(+), 140 deletions(-)
(limited to 'OpenSim/Data/MySQL/MySQLDataStore.cs')
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 254e526..25956d5 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -53,7 +53,6 @@ namespace OpenSim.Data.MySQL
private const string m_terrainSelect = "select * from terrain limit 1";
private const string m_landSelect = "select * from land";
private const string m_landAccessListSelect = "select * from landaccesslist";
- private const string m_regionBanListSelect = "select * from regionban";
private const string m_regionSettingsSelect = "select * from regionsettings";
private const string m_waitTimeoutSelect = "select @@wait_timeout";
@@ -83,7 +82,6 @@ namespace OpenSim.Data.MySQL
private MySqlDataAdapter m_terrainDataAdapter;
private MySqlDataAdapter m_landDataAdapter;
private MySqlDataAdapter m_landAccessListDataAdapter;
- private MySqlDataAdapter m_regionBanListDataAdapter;
private MySqlDataAdapter m_regionSettingsDataAdapter;
private DataTable m_primTable;
@@ -92,7 +90,6 @@ namespace OpenSim.Data.MySQL
private DataTable m_terrainTable;
private DataTable m_landTable;
private DataTable m_landAccessListTable;
- private DataTable m_regionBanListTable;
private DataTable m_regionSettingsTable;
/// Temporary attribute while this is experimental
@@ -150,9 +147,6 @@ namespace OpenSim.Data.MySQL
MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection);
m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd);
- MySqlCommand regionBanListSelectCmd = new MySqlCommand(m_regionBanListSelect, m_connection);
- m_regionBanListDataAdapter = new MySqlDataAdapter(regionBanListSelectCmd);
-
MySqlCommand regionSettingsSelectCmd = new MySqlCommand(m_regionSettingsSelect, m_connection);
m_regionSettingsDataAdapter = new MySqlDataAdapter(regionSettingsSelectCmd);
@@ -192,11 +186,6 @@ namespace OpenSim.Data.MySQL
setupLandAccessCommands(m_landAccessListDataAdapter, m_connection);
m_landAccessListDataAdapter.Fill(m_landAccessListTable);
- m_regionBanListTable = createRegionBanTable();
- m_dataSet.Tables.Add(m_regionBanListTable);
- SetupRegionBanCommands(m_regionBanListDataAdapter, m_connection);
- m_regionBanListDataAdapter.Fill(m_regionBanListTable);
-
m_regionSettingsTable = createRegionSettingsTable();
m_dataSet.Tables.Add(m_regionSettingsTable);
SetupRegionSettingsCommands(m_regionSettingsDataAdapter, m_connection);
@@ -774,99 +763,6 @@ namespace OpenSim.Data.MySQL
}
///
- /// Load (fetch?) a region banlist
- ///
- /// The region UUID
- /// The Region banlist
- public List LoadRegionBanList(LLUUID regionUUID)
- {
- List regionbanlist = new List();
- lock (m_dataSet)
- {
- CheckConnection();
- DataTable regionban = m_regionBanListTable;
- string searchExp = "regionUUID = '" + regionUUID.ToString() + "'";
- DataRow[] rawbanlist = regionban.Select(searchExp);
- foreach (DataRow rawbanrow in rawbanlist)
- {
- RegionBanListItem rbli = new RegionBanListItem();
- LLUUID tmpvalue = LLUUID.Zero;
-
- rbli.regionUUID = regionUUID;
-
- if (Helpers.TryParse((string)rawbanrow["bannedUUID"], out tmpvalue))
- rbli.bannedUUID = tmpvalue;
-
- rbli.bannedIP = (string)rawbanrow["bannedIp"];
- rbli.bannedIPHostMask = (string)rawbanrow["bannedIpHostMask"];
- regionbanlist.Add(rbli);
- }
- return regionbanlist;
- }
- }
-
- ///
- /// Add an item to region banlist
- ///
- /// The item
- public void AddToRegionBanlist(RegionBanListItem item)
- {
- lock (m_dataSet)
- {
- CheckConnection();
- DataTable regionban = m_regionBanListTable;
- string searchExp = "regionUUID = '" + item.regionUUID.ToString() + "' AND bannedUUID = '" + item.bannedUUID.ToString() + "'";
- DataRow[] rawbanlist = regionban.Select(searchExp);
- if (rawbanlist.Length == 0)
- {
- DataRow regionbanrow = regionban.NewRow();
- regionbanrow["regionUUID"] = item.regionUUID.ToString();
- regionbanrow["bannedUUID"] = item.bannedUUID.ToString();
- regionbanrow["bannedIp"] = item.bannedIP.ToString();
- regionbanrow["bannedIpHostMask"] = item.bannedIPHostMask.ToString();
- regionban.Rows.Add(regionbanrow);
- }
- Commit();
- }
- }
-
- ///
- /// Remove an item from region banlist
- ///
- /// The item
- public void RemoveFromRegionBanlist(RegionBanListItem item)
- {
- lock (m_dataSet)
- {
- CheckConnection();
- DataTable regionban = m_regionBanListTable;
- string searchExp = "regionUUID = '" + item.regionUUID.ToString() + "' AND bannedUUID = '" + item.bannedUUID.ToString() + "'";
- DataRow[] rawbanlist = regionban.Select(searchExp);
- if (rawbanlist.Length > 0)
- {
- foreach (DataRow rbli in rawbanlist)
- {
- regionban.Rows.Remove(rbli);
- }
- }
- Commit();
- }
-
- using
- (
- MySqlCommand cmd =
- new MySqlCommand("delete from regionban where regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID", m_connection)
- )
- {
- cmd.Parameters.Add(new MySqlParameter("?regionUUID", item.regionUUID.ToString()));
- cmd.Parameters.Add(new MySqlParameter("?bannedUUID", item.bannedUUID.ToString()));
- CheckConnection();
- cmd.ExecuteNonQuery();
- }
-
- }
-
- ///
///
///
///
@@ -918,7 +814,6 @@ namespace OpenSim.Data.MySQL
m_terrainDataAdapter.Update(m_terrainTable);
m_landDataAdapter.Update(m_landTable);
m_landAccessListDataAdapter.Update(m_landAccessListTable);
- m_regionBanListDataAdapter.Update(m_regionBanListTable);
m_regionSettingsDataAdapter.Update(m_regionSettingsTable);
m_dataSet.AcceptChanges();
@@ -1006,6 +901,7 @@ namespace OpenSim.Data.MySQL
createCol(regionsettings, "terrain_raise_limit", typeof (Double));
createCol(regionsettings, "terrain_lower_limit", typeof (Double));
createCol(regionsettings, "use_estate_sun", typeof (Int32));
+ createCol(regionsettings, "sandbox", typeof (Int32));
createCol(regionsettings, "fixed_sun", typeof (Int32));
createCol(regionsettings, "sun_position", typeof (Double));
createCol(regionsettings, "covenant", typeof(String));
@@ -1016,21 +912,6 @@ namespace OpenSim.Data.MySQL
}
///
- /// Create the "regionban" table
- ///
- ///
- private static DataTable createRegionBanTable()
- {
- DataTable regionban = new DataTable("regionban");
- createCol(regionban, "regionUUID", typeof(String));
- createCol(regionban, "bannedUUID", typeof(String));
- createCol(regionban, "bannedIp", typeof(String));
- createCol(regionban, "bannedIpHostMask", typeof(String));
- return regionban;
-
- }
-
- ///
/// Create the "prims" table
///
///
@@ -1417,6 +1298,7 @@ namespace OpenSim.Data.MySQL
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
+ newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = new LLUUID((String) row["covenant"]);
@@ -1676,6 +1558,7 @@ namespace OpenSim.Data.MySQL
row["terrain_raise_limit"] = settings.TerrainRaiseLimit;
row["terrain_lower_limit"] = settings.TerrainLowerLimit;
row["use_estate_sun"] = settings.UseEstateSun;
+ row["sandbox"] = settings.Sandbox;
row["fixed_sun"] = settings.FixedSun;
row["sun_position"] = settings.SunPosition;
row["covenant"] = settings.Covenant.ToString();
@@ -2143,26 +2026,6 @@ namespace OpenSim.Data.MySQL
///
///
///
- private void SetupRegionBanCommands(MySqlDataAdapter da, MySqlConnection conn)
- {
- da.InsertCommand = createInsertCommand("regionban", m_regionBanListTable);
- da.InsertCommand.Connection = conn;
-
- da.UpdateCommand = createUpdateCommand("regionban", "regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID", m_regionBanListTable);
- da.UpdateCommand.Connection = conn;
-
- MySqlCommand delete = new MySqlCommand("delete from regionban where regionUUID = ?regionUUID AND bannedUUID = ?bannedUUID");
- delete.Parameters.Add(createMySqlParameter("regionUUID", typeof(String)));
- delete.Parameters.Add(createMySqlParameter("bannedUUID", typeof(String)));
- delete.Connection = conn;
- da.DeleteCommand = delete;
- }
-
- ///
- ///
- ///
- ///
- ///
private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn)
{
da.InsertCommand = createInsertCommand("terrain", m_dataSet.Tables["terrain"]);
--
cgit v1.1