mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
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.
This commit is contained in:
@@ -828,22 +828,12 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
int revision = Util.UnixTimeSinceEpoch();
|
||||
|
||||
// This is added to get rid of the infinitely growing
|
||||
// terrain databases which negatively impact on SQLite
|
||||
// over time. Before reenabling this feature there
|
||||
// needs to be a limitter put on the number of
|
||||
// revisions in the database, as this old
|
||||
// implementation is a DOS attack waiting to happen.
|
||||
int revision = (int)DBTerrainRevision.Legacy256;
|
||||
|
||||
using (
|
||||
SqliteCommand cmd =
|
||||
new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision <= :Revision",
|
||||
m_conn))
|
||||
SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID", m_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user