diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 14:29:05 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 14:29:05 +0000 |
commit | 292f3e50a59b06bf129893b352466d7d54fa3d71 (patch) | |
tree | 7150b66c08c3dd83e79baef52332922ba3ab324d /src/net/charserverhandler.cpp | |
parent | 0c90838cef0d75e14097dc66c6b5210eef976029 (diff) | |
download | mana-client-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.gz mana-client-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.bz2 mana-client-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.xz mana-client-292f3e50a59b06bf129893b352466d7d54fa3d71.zip |
Fixed selection of player character and implemented sending of game and chat
server tokens. It gets you in the game (or what's left of it), but not on any
map yet.
Diffstat (limited to 'src/net/charserverhandler.cpp')
-rw-r--r-- | src/net/charserverhandler.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index ea9b3196..2bf2c4b4 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -163,10 +163,9 @@ CharServerHandler::handleCharSelectResponse(MessageIn &msg) { int errMsg = msg.readByte(); - if (errMsg == 0) + if (errMsg == ERRMSG_OK) { - // TODO: Somehow be able to send this token once connected - std::string token = msg.readString(32); + token = msg.readString(32); std::string gameServer = msg.readString(); unsigned short gameServerPort = msg.readShort(); std::string chatServer = msg.readString(); @@ -178,6 +177,17 @@ CharServerHandler::handleCharSelectResponse(MessageIn &msg) network->connect(Network::GAME, gameServer, gameServerPort); network->connect(Network::CHAT, chatServer, chatServerPort); + // Keep the selected character and delete the others + player_node = mCharInfo->getEntry(); + mCharInfo->unlock(); + mCharInfo->select(0); + do { + LocalPlayer *tmp = mCharInfo->getEntry(); + if (tmp != player_node) + delete tmp; + mCharInfo->next(); + } while (mCharInfo->getPos()); + state = STATE_CONNECT_GAME; } } |