diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-24 22:54:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-24 22:54:00 +0300 |
commit | f9feb8f1fd4e2dc56218aba40ef94962fa866f84 (patch) | |
tree | 9d2f50f84f74e158b4a1d508d59fe17c55e3a17b /src/game.cpp | |
parent | 2e655b41861169ee1db19ef59345661b7dc70610 (diff) | |
download | mv-f9feb8f1fd4e2dc56218aba40ef94962fa866f84.tar.gz mv-f9feb8f1fd4e2dc56218aba40ef94962fa866f84.tar.bz2 mv-f9feb8f1fd4e2dc56218aba40ef94962fa866f84.tar.xz mv-f9feb8f1fd4e2dc56218aba40ef94962fa866f84.zip |
Fix disconnect by timeout in eathena servers.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp index 386e01a3d..9aad672da 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -367,7 +367,8 @@ Game::Game(): mLastAction(0), mNextAdjustTime(cur_time + adjustDelay), mAdjustLevel(0), - mLowerCounter(0) + mLowerCounter(0), + mPing(0) { spellManager = new SpellManager; spellShortcut = new SpellShortcut; @@ -615,6 +616,13 @@ void Game::slowLogic() } else { + if (Net::getGameHandler()->mustPing() + && get_elapsed_time1(mPing) > 3000) + { + mPing = tick_time; + Net::getGameHandler()->ping(tick_time); + } + if (mAdjustPerfomance) adjustPerfomance(); if (disconnectedDialog) @@ -623,7 +631,6 @@ void Game::slowLogic() disconnectedDialog = nullptr; } } - } void Game::adjustPerfomance() |