aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-28 03:08:09 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-28 03:08:09 +0300
commitc9ed379e39be94b588f4b62f893760c53b2d2a4f (patch)
tree7b1c83af5bd323c299997d3bcdb9cc44046e2d72 /src
parente64feefc61e0fd104bfc40c61411b67423734924 (diff)
downloadminetest-c9ed379e39be94b588f4b62f893760c53b2d2a4f.tar.gz
minetest-c9ed379e39be94b588f4b62f893760c53b2d2a4f.tar.bz2
minetest-c9ed379e39be94b588f4b62f893760c53b2d2a4f.zip
Add enable_rollback_recording setting, defaulting to false
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/server.cpp7
-rw-r--r--src/server.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index dabdbb4aa..6b85feb60 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -122,6 +122,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("enable_pvp", "true");
settings->setDefault("disallow_empty_password", "false");
settings->setDefault("disable_anticheat", "false");
+ settings->setDefault("enable_rollback_recording", "false");
settings->setDefault("profiler_print_interval", "0");
settings->setDefault("enable_mapgen_debug_info", "false");
diff --git a/src/server.cpp b/src/server.cpp
index 6a126b60d..05dff06c5 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -937,6 +937,7 @@ Server::Server(
m_banmanager(path_world+DIR_DELIM+"ipban.txt"),
m_rollback(NULL),
m_rollback_sink_enabled(true),
+ m_enable_rollback_recording(false),
m_lua(NULL),
m_itemdef(createItemDefManager()),
m_nodedef(createNodeDefManager()),
@@ -1873,6 +1874,10 @@ void Server::AsyncRunStep()
counter = 0.0;
m_emergethread.trigger();
+
+ // Update m_enable_rollback_recording here too
+ m_enable_rollback_recording =
+ g_settings->getBool("enable_rollback_recording");
}
}
@@ -4658,6 +4663,8 @@ MtEventManager* Server::getEventManager()
}
IRollbackReportSink* Server::getRollbackReportSink()
{
+ if(!m_enable_rollback_recording)
+ return NULL;
if(!m_rollback_sink_enabled)
return NULL;
return m_rollback;
diff --git a/src/server.h b/src/server.h
index 668d42416..223c1b0ff 100644
--- a/src/server.h
+++ b/src/server.h
@@ -734,6 +734,7 @@ private:
// Rollback manager (behind m_env_mutex)
IRollbackManager *m_rollback;
bool m_rollback_sink_enabled;
+ bool m_enable_rollback_recording; // Updated once in a while
// Scripting
// Envlock and conlock should be locked when using Lua