Permalink
Browse files

Add enable_rollback_recording setting, defaulting to false

  • Loading branch information...
1 parent e64feef commit c9ed379e39be94b588f4b62f893760c53b2d2a4f @celeron55 committed Jul 28, 2012
Showing with 11 additions and 0 deletions.
  1. +2 −0 minetest.conf.example
  2. +1 −0 src/defaultsettings.cpp
  3. +7 −0 src/server.cpp
  4. +1 −0 src/server.h
View
@@ -160,6 +160,8 @@
#disallow_empty_password = false
# If true, disable cheat prevention in multiplayer
#disable_anticheat = false
+# If true, actions are recorded for rollback
+#enable_rollback_recording = false
# Profiler data print interval. #0 = disable.
#profiler_print_interval = 0
View
@@ -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");
View
@@ -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;
View
@@ -734,6 +734,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
// 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

0 comments on commit c9ed379

Please sign in to comment.