diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 00:56:23 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-20 00:56:23 +0000 |
commit | 01591924a4f33d5a5e4a86db6c256c8ce797a820 (patch) | |
tree | a1fe33f8a28a19fddd9f4ccdf7816f85636c4bcb /src/net/charserverhandler.cpp | |
parent | 0841d65d15e4c318ad8f5fe4b7e257d963ef7841 (diff) | |
download | mana-01591924a4f33d5a5e4a86db6c256c8ce797a820.tar.gz mana-01591924a4f33d5a5e4a86db6c256c8ce797a820.tar.bz2 mana-01591924a4f33d5a5e4a86db6c256c8ce797a820.tar.xz mana-01591924a4f33d5a5e4a86db6c256c8ce797a820.zip |
The Network can now connect to the three servers and affected methods now take
the server type as a parameter. The MessageOut gained a convenience constructor
(same as was added server side). The game states during login sequence have
been renamed and redone in order to ensure no communication is attempted to
unconnected servers. This allowed the removal of the outgoing message queue.
Connecting to the account server has been moved before the login/register phase
(dialogs will still need to be updated). Quite a few things are expected to be
broken since I'm rather tired at the moment. I've left many TODO entries in the
code.
Diffstat (limited to 'src/net/charserverhandler.cpp')
-rw-r--r-- | src/net/charserverhandler.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index b8cc710e..ea9b3196 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -165,14 +165,20 @@ CharServerHandler::handleCharSelectResponse(MessageIn &msg) if (errMsg == 0) { - //std::string token = msg.readString(32); - //std::string gameServer = msg.readString(); - //unsigned short gameServerPort = msg.readShort(); - //std::string chatServer = msg.readString(); - //unsigned short chatServerPort = msg.readShort(); - - // TODO: Connect to game and chat servers, and login using the given - // TODO: token. + // TODO: Somehow be able to send this token once connected + std::string token = msg.readString(32); + std::string gameServer = msg.readString(); + unsigned short gameServerPort = msg.readShort(); + std::string chatServer = msg.readString(); + unsigned short chatServerPort = msg.readShort(); + + logger->log("Game server: %s:%d", gameServer.c_str(), gameServerPort); + logger->log("Chat server: %s:%d", chatServer.c_str(), chatServerPort); + + network->connect(Network::GAME, gameServer, gameServerPort); + network->connect(Network::CHAT, chatServer, chatServerPort); + + state = STATE_CONNECT_GAME; } } |