diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-18 15:23:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-18 15:23:24 +0300 |
commit | 485cf3ed0a92beddfbff839d3603ff1f2a98f805 (patch) | |
tree | b177d403b251213a5bc9d2934c1d938ed29ad9df /src | |
parent | ee633de31c7978ae4a776cce4de86729356e1b1f (diff) | |
download | manaplus-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.gz manaplus-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.bz2 manaplus-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.xz manaplus-485cf3ed0a92beddfbff839d3603ff1f2a98f805.zip |
eathena: add packet SMSG_CHAR_CHARACTERS 0x099d.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 31 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 35 insertions, 1 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 8034d873b..79a316420 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -96,6 +96,7 @@ CharServerHandler::CharServerHandler() : SMSG_CHAR_DELETE2_ACK, SMSG_CHAR_DELETE2_ACCEPT_ACTUAL_ACK, SMSG_CHAR_DELETE2_CANCEL_ACK, + SMSG_CHAR_CHARACTERS, 0 }; handledMessages = _messages; @@ -174,6 +175,10 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) processCharDelete2CancelAck(msg); break; + case SMSG_CHAR_CHARACTERS: + processCharCharacters(msg); + break; + default: break; } @@ -676,4 +681,30 @@ void CharServerHandler::processCharDelete2CancelAck(Net::MessageIn &msg) msg.readInt32("result"); } +void CharServerHandler::processCharCharacters(Net::MessageIn &msg) +{ + msg.skip(2, "packet len"); + + delete_all(mCharacters); + mCharacters.clear(); + + // Derive number of characters from message length + const int count = (msg.getLength() - 4) + / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4); + + for (int i = 0; i < count; ++i) + { + Net::Character *const character = new Net::Character; + charServerHandler->readPlayerData(msg, character, false); + mCharacters.push_back(character); + if (character->dummy) + { + logger->log("CharServer: Player: %s (%d)", + character->dummy->getName().c_str(), character->slot); + } + } + + client->setState(STATE_CHAR_SELECT); +} + } // namespace EAthena diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h index ef1e71851..6d0cb48a9 100644 --- a/src/net/eathena/charserverhandler.h +++ b/src/net/eathena/charserverhandler.h @@ -112,6 +112,8 @@ class CharServerHandler final : public MessageHandler, static void processCharDelete2CancelAck(Net::MessageIn &msg); + static void processCharCharacters(Net::MessageIn &msg); + private: static std::string mNewName; static uint32_t mPinSeed; diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index d3ad5d001..b5d286ee7 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -248,7 +248,7 @@ int16_t packet_lengths[] = 31, 0, 0, 0, 0, 0, 0, 14, 0, 0, -1, 0, 0, 288, 12, 0, // #0x0980 0, 0, 0, 29, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, -1, -1, -1, -1, -1, -1, 0, 0, 11, 9, 8, 0, 0, 0, 0, + 31, -1, -1, -1, -1, -1, -1, 0, 0, 11, 9, 8, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 16, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x09C0 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 9de6db139..dccaf107c 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -55,6 +55,7 @@ #define SMSG_CHAR_DELETE2_ACCEPT_ACTUAL_ACK 0x082a #define SMSG_CHAR_DELETE2_CANCEL_ACK 0x082c #define SMSG_CHAR_MAP_INFO 0x0071 +#define SMSG_CHAR_CHARACTERS 0x099d #define SMSG_CHAR_SWITCH_RESPONSE 0x00b3 #define SMSG_CHANGE_MAP_SERVER 0x0092 |