diff options
author | Chuck Miller <shadowmil@gmail.com> | 2010-08-15 15:57:21 -0400 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-08-15 15:57:21 -0400 |
commit | 8f573b6c425dc82be42ad80eae565b0641a90a3b (patch) | |
tree | 149c7889d384e10fd9dc95f1aa90478e69b314c8 /src/net/manaserv/gamehandler.cpp | |
parent | fee9fbce12e620f25aecdc0690285cc47fa8791d (diff) | |
parent | 2b676bbf6fcf7dfd45cb33f06dacd2ca5bce19fe (diff) | |
download | mana-8f573b6c425dc82be42ad80eae565b0641a90a3b.tar.gz mana-8f573b6c425dc82be42ad80eae565b0641a90a3b.tar.bz2 mana-8f573b6c425dc82be42ad80eae565b0641a90a3b.tar.xz mana-8f573b6c425dc82be42ad80eae565b0641a90a3b.zip |
Merge branch '1.0'
Conflicts:
mana.cbp
mana.files
src/CMakeLists.txt
src/Makefile.am
src/utils/xml.cpp
Diffstat (limited to 'src/net/manaserv/gamehandler.cpp')
-rw-r--r-- | src/net/manaserv/gamehandler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp index 65010ad3..3cb9f0ea 100644 --- a/src/net/manaserv/gamehandler.cpp +++ b/src/net/manaserv/gamehandler.cpp @@ -94,7 +94,10 @@ void GameHandler::handleMessage(Net::MessageIn &msg) void GameHandler::connect() { gameServerConnection->connect(gameServer.hostname, gameServer.port); - chatServerConnection->connect(chatServer.hostname, chatServer.port); + + // Will already be connected if we just changed gameservers + if (!chatServerConnection->isConnected()) + chatServerConnection->connect(chatServer.hostname, chatServer.port); } bool GameHandler::isConnected() @@ -106,7 +109,10 @@ bool GameHandler::isConnected() void GameHandler::disconnect() { gameServerConnection->disconnect(); - chatHandler->disconnect(); + + // No need if we're just changing gameservers + if (Client::getState() != STATE_CHANGE_MAP) + chatHandler->disconnect(); } void GameHandler::who() |