diff options
author | David Athay <ko2fan@gmail.com> | 2009-04-20 15:08:28 +0100 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-04-20 15:08:28 +0100 |
commit | f1d6803dd8a90db885d4d7c1734783acdcd95485 (patch) | |
tree | 5e0de497043464a240a3e43fda00d0500c499dab /src | |
parent | d6dbd51deeae42a621534e6565aaeb468ecc5d17 (diff) | |
download | mana-client-f1d6803dd8a90db885d4d7c1734783acdcd95485.tar.gz mana-client-f1d6803dd8a90db885d4d7c1734783acdcd95485.tar.bz2 mana-client-f1d6803dd8a90db885d4d7c1734783acdcd95485.tar.xz mana-client-f1d6803dd8a90db885d4d7c1734783acdcd95485.zip |
Fix clearing handlers on connecting to game server.
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 3 | ||||
-rw-r--r-- | src/net/tmwserv/chathandler.cpp | 1 | ||||
-rw-r--r-- | src/net/tmwserv/connection.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwserv/maphandler.cpp | 5 |
5 files changed, 9 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index e074fc30..dd257013 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -382,8 +382,6 @@ Game::Game(): Game::~Game() { - Net::getGeneralHandler()->unload(); - destroyGuiWindows(); delete beingManager; diff --git a/src/main.cpp b/src/main.cpp index f6126693..f5b3c4d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1029,7 +1029,7 @@ int main(int argc, char *argv[]) chatServerConnection->isConnected()) { accountServerConnection->disconnect(); - Net::clearHandlers(); +// Net::clearHandlers(); state = STATE_GAME; } @@ -1308,6 +1308,7 @@ int main(int argc, char *argv[]) case STATE_EXIT: logger->log("State: EXIT"); logoutThenExit(); + Net::getGeneralHandler()->unload(); break; default: diff --git a/src/net/tmwserv/chathandler.cpp b/src/net/tmwserv/chathandler.cpp index 5b1b28dd..e3421e93 100644 --- a/src/net/tmwserv/chathandler.cpp +++ b/src/net/tmwserv/chathandler.cpp @@ -69,6 +69,7 @@ ChatHandler::ChatHandler() 0 }; handledMessages = _messages; + chatHandler = this; } void ChatHandler::handleMessage(MessageIn &msg) diff --git a/src/net/tmwserv/connection.cpp b/src/net/tmwserv/connection.cpp index 0fcd530b..6762af89 100644 --- a/src/net/tmwserv/connection.cpp +++ b/src/net/tmwserv/connection.cpp @@ -83,7 +83,7 @@ void Net::Connection::disconnect() bool Net::Connection::isConnected() { - return bool (mConnection) ? + return (mConnection) ? (mConnection->state == ENET_PEER_STATE_CONNECTED) : false; } diff --git a/src/net/tmwserv/maphandler.cpp b/src/net/tmwserv/maphandler.cpp index ff47c1a7..400188bf 100644 --- a/src/net/tmwserv/maphandler.cpp +++ b/src/net/tmwserv/maphandler.cpp @@ -27,11 +27,16 @@ namespace TmwServ { MapHandler::MapHandler() { + static const Uint16 _messages[] = { + 0 + }; + handledMessages = _messages; mapHandler = this; } void MapHandler::handleMessage(MessageIn &msg) { + } void MapHandler::connect(LoginData *loginData) |