diff options
author | David Athay <ko2fan@gmail.com> | 2008-10-21 13:11:10 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-10-21 13:11:10 +0000 |
commit | faab9e8fd3c312c7651398ce68e2e4e4fa36ac78 (patch) | |
tree | a368a38e6d0dac75b1164396433def1a9405e501 /src/game-server/main-game.cpp | |
parent | 104be5479d7c1192a73711b932e87c571e434985 (diff) | |
download | manaserv-faab9e8fd3c312c7651398ce68e2e4e4fa36ac78.tar.gz manaserv-faab9e8fd3c312c7651398ce68e2e4e4fa36ac78.tar.xz manaserv-faab9e8fd3c312c7651398ce68e2e4e4fa36ac78.zip |
Game Server now reconnects to Account Server. Some postal system bugs fixed.
Diffstat (limited to 'src/game-server/main-game.cpp')
-rw-r--r-- | src/game-server/main-game.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index b1c454e..898bcb8 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -276,8 +276,7 @@ int main(int argc, char *argv[]) initialize(); if (!accountHandler->start()) { - LOG_FATAL("Unable to create a connection to an account server."); - return 3; + LOG_INFO("Unable to create a connection to an account server."); } int gameServerPort = @@ -308,11 +307,22 @@ int main(int argc, char *argv[]) // Print world time at 10 second intervals to show we're alive if (worldTime % 100 == 0) { LOG_INFO("World time: " << worldTime); - accountHandler->sendStatistics(); } - // Handle all messages that are in the message queues - accountHandler->process(); + if (accountHandler->isConnected()) + { + // Handle all messages that are in the message queues + accountHandler->process(); + + if (worldTime % 100 == 0) + { + accountHandler->sendStatistics(); + } + } + else + { + accountHandler->start(); + } gameHandler->process(); // Update all active objects/beings GameState::update(); |