summaryrefslogtreecommitdiff
path: root/src/net/manaserv/gamehandler.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-08-15 15:57:21 -0400
committerChuck Miller <shadowmil@gmail.com>2010-08-15 15:57:21 -0400
commit8f573b6c425dc82be42ad80eae565b0641a90a3b (patch)
tree149c7889d384e10fd9dc95f1aa90478e69b314c8 /src/net/manaserv/gamehandler.cpp
parentfee9fbce12e620f25aecdc0690285cc47fa8791d (diff)
parent2b676bbf6fcf7dfd45cb33f06dacd2ca5bce19fe (diff)
downloadmana-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.cpp10
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()