diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-14 22:28:34 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-14 22:28:34 +0000 |
commit | ca5d91316c8a1ba72b5e0f3c7a697e7879987f93 (patch) | |
tree | e18a7c3a5d6fab5218056784017934574764d078 /src/net/charserverhandler.cpp | |
parent | d33140baf3e05bd6c814eb57cffdb62505f7861e (diff) | |
download | mana-ca5d91316c8a1ba72b5e0f3c7a697e7879987f93.tar.gz mana-ca5d91316c8a1ba72b5e0f3c7a697e7879987f93.tar.bz2 mana-ca5d91316c8a1ba72b5e0f3c7a697e7879987f93.tar.xz mana-ca5d91316c8a1ba72b5e0f3c7a697e7879987f93.zip |
Some preparations towards supporting character select and response handling.
Diffstat (limited to 'src/net/charserverhandler.cpp')
-rw-r--r-- | src/net/charserverhandler.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index b4715315..eb7eb34d 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -57,6 +57,7 @@ CharServerHandler::handleMessage(MessageIn *msg) case APMSG_CHAR_CREATE_RESPONSE: handleCharCreateResponse(*msg); break; + case APMSG_CHAR_DELETE_RESPONSE: { int errMsg = msg->readByte(); @@ -89,6 +90,7 @@ CharServerHandler::handleMessage(MessageIn *msg) } } break; + case APMSG_CHAR_INFO: tempPlayer = readPlayerData(msg, slot); mCharInfo->unlock(); @@ -96,6 +98,10 @@ CharServerHandler::handleMessage(MessageIn *msg) mCharInfo->setEntry(tempPlayer); n_character++; break; + + case PMSG_CHAR_SELECT_RESPONSE: + handleCharSelectResponse(*msg); + break; } } @@ -104,12 +110,8 @@ CharServerHandler::handleCharCreateResponse(MessageIn &msg) { int errMsg = msg.readByte(); - // Character creation successful - if (errMsg == ERRMSG_OK) - { - } // Character creation failed - else + if (errMsg != ERRMSG_OK) { std::string message = ""; switch (errMsg) @@ -155,6 +157,24 @@ CharServerHandler::handleCharCreateResponse(MessageIn &msg) } } +void +CharServerHandler::handleCharSelectResponse(MessageIn &msg) +{ + int errMsg = msg.readByte(); + + 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. + } +} + LocalPlayer* CharServerHandler::readPlayerData(MessageIn *msg, int &slot) { |