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/SQLite/SQLiteRegionData.cs | 114 -------------------------------- 1 file changed, 114 deletions(-) (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs') diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 0e67fb9..4e87e0d 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -62,7 +62,6 @@ namespace OpenSim.Data.SQLite private SqliteDataAdapter terrainDa; private SqliteDataAdapter landDa; private SqliteDataAdapter landAccessListDa; - private SqliteDataAdapter regionBanListDa; private SqliteConnection m_conn; @@ -119,9 +118,6 @@ namespace OpenSim.Data.SQLite SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, m_conn); landAccessListDa = new SqliteDataAdapter(landAccessListSelectCmd); - SqliteCommand regionBanListSelectCmd = new SqliteCommand(regionbanListSelect, m_conn); - regionBanListDa = new SqliteDataAdapter(regionBanListSelectCmd); - // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(m_conn, assem, "RegionStore"); @@ -157,10 +153,6 @@ namespace OpenSim.Data.SQLite ds.Tables.Add(createLandAccessListTable()); setupLandAccessCommands(landAccessListDa, m_conn); - ds.Tables.Add(createRegionBanListTable()); - setupRegionBanCommands(regionBanListDa, m_conn); - - // WORKAROUND: This is a work around for sqlite on // windows, which gets really unhappy with blob columns // that have no sample data in them. At some point we @@ -201,15 +193,6 @@ namespace OpenSim.Data.SQLite m_log.Info("[REGION DB]: Caught fill error on landaccesslist table"); } - try - { - regionBanListDa.Fill(ds.Tables["regionban"]); - } - catch (Exception) - { - m_log.Info("[REGION DB]: Caught fill error on regionban table"); - } - return; } } @@ -900,21 +883,6 @@ namespace OpenSim.Data.SQLite return landaccess; } - /// - /// create "regionban" table - /// - /// regionban datatable - private static DataTable createRegionBanListTable() - { - DataTable regionbanlist = new DataTable("regionban"); - createCol(regionbanlist, "regionUUID", typeof(String)); - createCol(regionbanlist, "bannedUUID", typeof(String)); - createCol(regionbanlist, "bannedIp", typeof(String)); - createCol(regionbanlist, "bannedIpHostMask", typeof(String)); - - return regionbanlist; - } - /*********************************************************************** * * Convert between ADO.NET <=> OpenSim Objects @@ -1178,74 +1146,6 @@ namespace OpenSim.Data.SQLite return entry; } - - /// - /// Load a region banlist - /// - /// the region UUID - /// The banlist - public List LoadRegionBanList(LLUUID regionUUID) - { - List regionbanlist = new List(); - lock (ds) - { - DataTable regionban = ds.Tables["regionban"]; - 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 en entry into region banlist - /// - /// - public void AddToRegionBanlist(RegionBanListItem item) - { - lock (ds) - { - using (SqliteCommand cmd = new SqliteCommand("insert into regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask) values (:regionUUID,:bannedUUID,:bannedIp,:bannedIpHostMask)", m_conn)) - { - cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString())); - cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString())); - cmd.Parameters.Add(new SqliteParameter(":bannedIp", item.bannedIP)); - cmd.Parameters.Add(new SqliteParameter(":bannedIpHostMask", item.bannedIPHostMask)); - cmd.ExecuteNonQuery(); - } - } - } - - /// - /// remove an entry from the region banlist - /// - /// - public void RemoveFromRegionBanlist(RegionBanListItem item) - { - lock (ds) - { - using (SqliteCommand cmd = new SqliteCommand("delete from regionban where regionUUID=:regionUUID AND bannedUUID=:bannedUUID", m_conn)) - { - cmd.Parameters.Add(new SqliteParameter(":regionUUID", item.regionUUID.ToString())); - cmd.Parameters.Add(new SqliteParameter(":bannedUUID", item.bannedUUID.ToString())); - cmd.ExecuteNonQuery(); - } - } - } - /// /// /// @@ -1827,20 +1727,6 @@ namespace OpenSim.Data.SQLite /// /// /// - private void setupRegionBanCommands(SqliteDataAdapter da, SqliteConnection conn) - { - da.InsertCommand = createInsertCommand("regionban", ds.Tables["regionban"]); - da.InsertCommand.Connection = conn; - - da.UpdateCommand = createUpdateCommand("regionban", "regionUUID=:regionUUID AND bannedUUID=:bannedUUID", ds.Tables["regionban"]); - da.UpdateCommand.Connection = conn; - } - - /// - /// - /// - /// - /// private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn) { da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]); -- cgit v1.1