summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-02 19:31:34 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-02 19:31:34 +0300
commit63d82eada2fccdecf3c90452e93860a37656e7c4 (patch)
tree1b0fdd869d9066524057339212b7255e59c8485b /src/game.cpp
parentedc8de3400acbbae60930a9c1d4f946df5b2e68f (diff)
downloadplus-63d82eada2fccdecf3c90452e93860a37656e7c4.tar.gz
plus-63d82eada2fccdecf3c90452e93860a37656e7c4.tar.bz2
plus-63d82eada2fccdecf3c90452e93860a37656e7c4.tar.xz
plus-63d82eada2fccdecf3c90452e93860a37656e7c4.zip
auto save config if it was changed in game each 10 seconds.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp10
1 files changed, 9 insertions, 1 deletions
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)