diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/pethandler.cpp | 18 | ||||
-rw-r--r-- | src/net/eathena/pethandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 9d6772006..60ec03cd2 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -41,15 +41,25 @@ PetHandler::PetHandler() : { static const uint16_t _messages[] = { + SMSG_PET_MESSAGE, 0 }; handledMessages = _messages; petHandler = this; } -void PetHandler::handleMessage(Net::MessageIn &msg A_UNUSED) +void PetHandler::handleMessage(Net::MessageIn &msg) { BLOCK_START("PetHandler::handleMessage") + switch (msg.getId()) + { + case SMSG_PET_MESSAGE: + processPetMessage(msg); + break; + + default: + break; + } BLOCK_END("PetHandler::handleMessage") } @@ -91,4 +101,10 @@ void PetHandler::requestPetState(const int data) const outMsg.writeInt32(data, "param"); } +void PetHandler::processPetMessage(Net::MessageIn &msg) +{ + msg.readInt32("pet id"); + msg.readInt32("param"); +} + } // namespace EAthena diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h index af3e1d918..f08ce43fa 100644 --- a/src/net/eathena/pethandler.h +++ b/src/net/eathena/pethandler.h @@ -53,6 +53,8 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void requestPetState(const int data) const override final; + void processPetMessage(Net::MessageIn &msg); + protected: int mRandCounter; }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 3e806f76d..fc9e9a2f0 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -204,6 +204,8 @@ #define SMSG_MAIL_OPEN_WINDOW 0x0260 +#define SMSG_PET_MESSAGE 0x01aa + /********************************** * Packets from client to server * **********************************/ |