summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2009-12-18 21:43:53 +0100
committerFreeyorp <Freeyorp101@hotmail.com>2009-12-19 19:12:15 +1300
commit6ad0ab8123de1ee3f27ad38300dc7ef896bab569 (patch)
tree785e9bd0f019e74329b080116d03b7c1b10d82b0 /src/game.cpp
parent7018bbb12c0807efb93acc5d90ec20d59cb3f1a9 (diff)
downloadmana-6ad0ab8123de1ee3f27ad38300dc7ef896bab569.tar.gz
mana-6ad0ab8123de1ee3f27ad38300dc7ef896bab569.tar.bz2
mana-6ad0ab8123de1ee3f27ad38300dc7ef896bab569.tar.xz
mana-6ad0ab8123de1ee3f27ad38300dc7ef896bab569.zip
Client now returns to server selection after server disconnection
This resolves http://bugs.manasource.org/view.php?id=37
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a91fdc23..b04d1990 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -85,7 +85,7 @@
#include <guichan/exception.hpp>
#include <guichan/focushandler.hpp>
-#include "physfs.h"
+#include <physfs.h>
#include <sys/stat.h>
@@ -151,23 +151,6 @@ const int MAX_TICK_VALUE = 10000;
const int MILLISECONDS_IN_A_TICK = 10;
/**
- * Listener used for exiting handling.
- */
-namespace {
- class ExitListener : public gcn::ActionListener
- {
- public:
- void action(const gcn::ActionEvent &event)
- {
- if (event.getId() == "yes" || event.getId() == "ok")
- state = STATE_EXIT;
-
- disconnectedDialog = NULL;
- }
- } exitListener;
-}
-
-/**
* Advances game logic counter.
* Called every 10 milliseconds by SDL_AddTimer()
* @see MILLISECONDS_IN_A_TICK value
@@ -302,6 +285,8 @@ Game::Game():
mLastTarget(Being::UNKNOWN),
mLogicCounterId(0), mSecondsCounterId(0)
{
+ disconnectedDialog = NULL;
+
createGuiWindows();
mWindowMenu = new WindowMenu;
@@ -498,14 +483,13 @@ void Game::logic()
{
if (state != STATE_ERROR)
{
- errorMessage = _("The connection to the server was lost, "
- "the program will now quit");
+ errorMessage = _("The connection to the server was lost.");
}
if (!disconnectedDialog)
{
disconnectedDialog = new OkDialog(_("Network Error"), errorMessage);
- disconnectedDialog->addActionListener(&exitListener);
+ disconnectedDialog->addActionListener(&errorListener);
disconnectedDialog->requestMoveToTop();
}
}