diff --git a/client/CMT.cpp b/client/CMT.cpp index de916b0b8..a7dd4b867 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -248,7 +248,8 @@ int main(int argc, char** argv) ("loadserverip",po::value(),"IP for loaded game server") ("loadserverport",po::value(),"port for loaded game server") ("testingport",po::value(),"port for testing, override specified in config file") - ("testingfileprefix",po::value(),"prefix for auto save files"); + ("testingfileprefix",po::value(),"prefix for auto save files") + ("testingsavefrequency",po::value(),"how often auto save should be created"); if(argc > 1) { @@ -313,6 +314,7 @@ int main(int argc, char** argv) testingSettings["enabled"].Bool() = true; testingSettings["port"].String() = vm["testingport"].as(); testingSettings["prefix"].String() = vm["testingfileprefix"].as(); + testingSettings["savefrequency"].Float() = vm.count("testingsavefrequency") ? vm["testingsavefrequency"].as() : 1; } // Initialize logging based on settings diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index e5fae6d36..c67a3785a 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -178,7 +178,7 @@ void CPlayerInterface::yourTurn() } firstCall = 0; } - else + else if(settings["testing"].isNull() || cb->getDate() % static_cast(settings["testing"]["savefrequency"].Float()) == 0) { LOCPLINT->cb->save("Saves/" + prefix + "Autosave_" + boost::lexical_cast(autosaveCount++ + 1)); autosaveCount %= 5;