diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLDataStore.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index 7ee625d..9a44fbd 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs | |||
@@ -442,15 +442,19 @@ namespace OpenSim.Data.MySQL | |||
442 | 442 | ||
443 | public void StoreTerrain(double[,] ter, LLUUID regionID) | 443 | public void StoreTerrain(double[,] ter, LLUUID regionID) |
444 | { | 444 | { |
445 | int revision = Util.UnixTimeSinceEpoch(); | 445 | int revision = 1; |
446 | m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); | 446 | m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); |
447 | 447 | ||
448 | lock (m_dataSet) | 448 | lock (m_dataSet) |
449 | { | 449 | { |
450 | MySqlCommand delete = new MySqlCommand("delete from terrain where RegionUUID=?RegionUUID", m_connection); | ||
450 | MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + | 451 | MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + |
451 | " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection); | 452 | " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection); |
452 | using (cmd) | 453 | using (cmd) |
453 | { | 454 | { |
455 | delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | ||
456 | delete.ExecuteNonQuery(); | ||
457 | |||
454 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | 458 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); |
455 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); | 459 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); |
456 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); | 460 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); |