aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteSimulationData.cs
diff options
context:
space:
mode:
authorRobert Adams2013-09-24 13:41:44 -0700
committerRobert Adams2013-09-28 07:33:55 -0700
commitaea5d3a84212a236fe1a766131b8e3513f3705a8 (patch)
treebf433ef9106c2de99e5a6d90a048c6c38e107670 /OpenSim/Data/SQLite/SQLiteSimulationData.cs
parentvarregion: go back to using Constants.RegionSize so as not to break (diff)
downloadopensim-SC-aea5d3a84212a236fe1a766131b8e3513f3705a8.zip
opensim-SC-aea5d3a84212a236fe1a766131b8e3513f3705a8.tar.gz
opensim-SC-aea5d3a84212a236fe1a766131b8e3513f3705a8.tar.bz2
opensim-SC-aea5d3a84212a236fe1a766131b8e3513f3705a8.tar.xz
Remove time based terrain storage in SQLite so revision number can be used
to denote terrain format revision. Add terrain DB format revision codes to ISimulationDataStore.cs. Setup so legacy compatible terrain storage and fetch is possible while allowing future format extensions.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs14
1 files changed, 2 insertions, 12 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index d938b6b..b70af6b 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -828,22 +828,12 @@ namespace OpenSim.Data.SQLite
828 { 828 {
829 lock (ds) 829 lock (ds)
830 { 830 {
831 int revision = Util.UnixTimeSinceEpoch(); 831 int revision = (int)DBTerrainRevision.Legacy256;
832
833 // This is added to get rid of the infinitely growing
834 // terrain databases which negatively impact on SQLite
835 // over time. Before reenabling this feature there
836 // needs to be a limitter put on the number of
837 // revisions in the database, as this old
838 // implementation is a DOS attack waiting to happen.
839 832
840 using ( 833 using (
841 SqliteCommand cmd = 834 SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID", m_conn))
842 new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision <= :Revision",
843 m_conn))
844 { 835 {
845 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); 836 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
846 cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
847 cmd.ExecuteNonQuery(); 837 cmd.ExecuteNonQuery();
848 } 838 }
849 839