From 63d82eada2fccdecf3c90452e93860a37656e7c4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Mar 2014 19:31:34 +0300 Subject: auto save config if it was changed in game each 10 seconds. --- src/game.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 253c4bff2..195492335 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -390,7 +390,8 @@ Game::Game(): mAdjustPerfomance(config.getBoolValue("adjustPerfomance")), mLowerCounter(0), mPing(0), - mTime(cur_time + 1) + mTime(cur_time + 1), + mTime2(cur_time + 10) { touchManager.setInGame(true); spellManager = new SpellManager; @@ -620,6 +621,13 @@ void Game::slowLogic() Being::reReadConfig(); if (killStats) killStats->recalcStats(); + + if (time > mTime2 || mTime2 - time > 10) + { + mTime2 = time + 10; + config.writeUpdated(); + serverConfig.writeUpdated(); + } } if (shopWindow) -- cgit v1.2.3-60-g2f50