diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-21 02:25:47 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-21 02:25:47 +0200 |
commit | 3b0bff2f743a3abf100368f94efafa7c2843a9b7 (patch) | |
tree | a81464f28cb929d221706e5790c753ed42cc8315 /src/server.cpp | |
parent | d5a78c12530df800f8182f7012cd16237a7ebafe (diff) | |
download | minetest-3b0bff2f743a3abf100368f94efafa7c2843a9b7.tar.gz minetest-3b0bff2f743a3abf100368f94efafa7c2843a9b7.tar.bz2 minetest-3b0bff2f743a3abf100368f94efafa7c2843a9b7.zip |
Cracking blocks while digging
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index 7260e21d3..7582024d1 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1321,13 +1321,23 @@ void Server::AsyncRunStep() { float &counter = m_savemap_timer; counter += dtime; - if(counter >= SERVER_MAP_SAVE_INTERVAL) + if(counter >= g_settings.getFloat("server_map_save_interval")) { counter = 0.0; JMutexAutoLock lock(m_env_mutex); + // Save only changed parts m_env.getMap().save(true); + + // Delete unused sectors + u32 deleted_count = m_env.getMap().deleteUnusedSectors( + g_settings.getFloat("server_unload_unused_sectors_timeout")); + if(deleted_count > 0) + { + dout_server<<"Server: Unloaded "<<deleted_count + <<" sectors from memory"<<std::endl; + } } } } |